diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000000000000000000000000000000000..4d85656557c02118b5803d1cfa53063cff0cdc17 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "doc/doxygen/doxygen-awesome-css"] + path = doc/doxygen/doxygen-awesome-css + url = https://github.com/jothepro/doxygen-awesome-css.git diff --git a/CHANGELOG.md b/CHANGELOG.md index 57a3c6e5c9412d9ab5d671eab32f047683c208e5..573c49d7ede1783da6ae593e7962f16f4366f376 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ All notable changes to this project will be documented in this file. ## [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 ### Added @@ -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 ###Changed - 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 - now the adaptive compression size (ap1_cmp_size, ap2_cmp_size) is calculate when the --rdcu_par option is used diff --git a/INSTALL.md b/INSTALL.md index 7665bcb92bd15a7bb678129d1bb3eda586d10873..4babccb28977637d79f09c381fce981238eba527 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -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. You can get meson through your package manager or using: -```pip3 install meson``` +``` +pip3 install meson +``` 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/ To generate the documentation you need to run: ``` +git submodule update --init cd <name of the build directory> meson compile doc ``` +You can find the documentation in the directory **generated_documentation**. diff --git a/README.md b/README.md index cad1887c99f2df6c0a2a992a434bd911858f06e1..48c0fd9937a76c428535cf8503d5f41d0c86bc94 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # PLATO Compression/Decompression Tool -If you find a bug or have a feature request please file an [issue][1] or send -me an [email][2]. -Compiled executables can be found [here][3]. The building instructions can be found [here](INSTALL.md). +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](mailto:dominik.loidolt@univie.ac.at?subject=%5BIssue%5D%20cmp_tool). +Compiled executables can be found [here](https://gitlab.phaidra.org/loidoltd15/cmp_tool/-/releases). The building instructions can be found [here](INSTALL.md). ## Usage @@ -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, --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". <a name="fnote2">2</a>) **NOTE:** In the default configurations the **samples** 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 | | `-d <file>` | File containing 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 | -<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`. 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 | |:------------------------|:--------------------------------------------------------------------------------| -| `--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 | | `-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 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 | |:------------|:--------------------------------| @@ -86,7 +86,7 @@ You can find the user manual [here](doc). 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). -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 * Create a cfg directory @@ -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 `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 diff --git a/cmp_tool.c b/cmp_tool.c index 3572c23398944893dd291d74cca53bb76d7b836c..19213b8c4ad394671a07eba4ddbeea18532432b2 100644 --- a/cmp_tool.c +++ b/cmp_tool.c @@ -1,7 +1,7 @@ /** * @file cmp_tool.c - * @author Johannes Seelig (johannes.seelig@univie.ac.at) * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) + * @author Johannes Seelig (johannes.seelig@univie.ac.at) * @date 2020 * * @copyright GPLv2 @@ -23,12 +23,11 @@ #include <stdlib.h> #include <limits.h> #include <getopt.h> -#include <time.h> #include "cmp_tool-config.h" #include "cmp_io.h" #include "cmp_icu.h" -#include "cmp_rdcu.h" /*TODO: shift setup to support */ +#include "cmp_rdcu.h" #include "decmp.h" #include "cmp_guess.h" #include "cmp_entity.h" @@ -42,6 +41,9 @@ #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 */ static int guess_cmp_pars(struct cmp_cfg *cfg, const char *guess_cmp_mode, int guess_level); @@ -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)*/ 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 @@ -70,12 +77,12 @@ enum { static const struct option long_options[] = { {"rdcu_par", no_argument, NULL, 'a'}, - {"model_cfg", no_argument, NULL, 'n'}, + {"model_cfg", optional_argument, NULL, 'n'}, {"help", no_argument, NULL, 'h'}, {"verbose", no_argument, NULL, 'v'}, {"version", no_argument, NULL, 'V'}, {"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_level", required_argument, NULL, GUESS_LEVEL}, {"last_info", required_argument, NULL, LAST_INFO}, @@ -182,6 +189,9 @@ int main(int argc, char **argv) break; case 'n': /* --model_cfg */ print_model_cfg = 1; + cfg.data_type = parse_data_type(optarg); + if (cfg.data_type == DATA_TYPE_UNKNOWN) + exit(EXIT_FAILURE); break; case 'o': output_prefix = optarg; @@ -195,6 +205,9 @@ int main(int argc, char **argv) break; case DIFF_CFG_OPTION: print_diff_cfg = 1; + cfg.data_type = parse_data_type(optarg); + if (cfg.data_type == DATA_TYPE_UNKNOWN) + exit(EXIT_FAILURE); break; case GUESS_OPTION: guess_operation = 1; @@ -262,30 +275,18 @@ int main(int argc, char **argv) #endif if (print_model_cfg == 1) { - cfg = rdcu_cfg_create(CMP_DEF_IMA_MODEL_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); - print_cfg(&cfg, add_rdcu_pars); + if (add_rdcu_pars) + cfg.data_type = DATA_TYPE_IMAGETTE_ADAPTIVE; + cmp_cfg_create_default(&cfg, cfg.data_type, MODEL_CFG); + cmp_cfg_print(&cfg); exit(EXIT_SUCCESS); } if (print_diff_cfg == 1) { - cfg = rdcu_cfg_create(CMP_DEF_IMA_DIFF_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); - print_cfg(&cfg, add_rdcu_pars); + if (add_rdcu_pars) + cfg.data_type = DATA_TYPE_IMAGETTE_ADAPTIVE; + cmp_cfg_create_default(&cfg, cfg.data_type, DIFF_CFG); + cmp_cfg_print(&cfg); exit(EXIT_SUCCESS); } @@ -316,7 +317,7 @@ int main(int argc, char **argv) if (cmp_operation) { printf("## Starting the compression ##\n"); 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) goto fail; printf("DONE\n"); @@ -327,11 +328,12 @@ int main(int argc, char **argv) printf("Importing data file %s ... ", data_file_name); /* count the samples in the data file when samples == 0 */ if (cfg.samples == 0) { - int samples; + int32_t samples; + 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 */ 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) goto fail; cfg.samples = (uint32_t)samples; @@ -359,7 +361,7 @@ int main(int argc, char **argv) uint32_t cmp_size_byte; 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) goto fail; printf("DONE\n"); @@ -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, int guess_level) { @@ -563,7 +587,7 @@ static int guess_cmp_pars(struct cmp_cfg *cfg, const char *guess_cmp_mode, printf("DONE\n"); 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) return -1; printf("DONE\n"); @@ -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) { int error; @@ -591,7 +618,7 @@ static int gen_rdcu_write_pkts(struct cmp_cfg *cfg) /* generation of packets for parallel read/write RDCU setup */ 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) { fprintf(stderr, "%s: %s: Importing last decompression information file failed.\n", 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, } -/* 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) { int cmp_size, error; @@ -735,6 +765,7 @@ static int compression(struct cmp_cfg *cfg, struct cmp_info *info) if (model_id_str) { uint32_t red_val; + error = atoui32("model_id", model_id_str, &red_val); if (error || red_val > UINT16_MAX) return -1; @@ -742,6 +773,7 @@ static int compression(struct cmp_cfg *cfg, struct cmp_info *info) } if (model_counter_str) { uint32_t red_val; + error = atoui32("model_counter", model_counter_str, &red_val); if (error || red_val > UINT8_MAX) return -1; @@ -791,7 +823,7 @@ static int compression(struct cmp_cfg *cfg, struct cmp_info *info) if (!include_cmp_header) { printf("Write decompression information to file %s.info ... ", output_prefix); - error = write_info(info, output_prefix, add_rdcu_pars); + error = cmp_info_to_file(info, output_prefix, add_rdcu_pars); if (error) goto error_cleanup; printf("DONE\n"); @@ -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) { int error; @@ -861,3 +896,47 @@ static int decompression(struct cmp_entity *ent, uint16_t *input_model_buf) 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; +} diff --git a/doc/doxygen/Doxyfile b/doc/doxygen/Doxyfile deleted file mode 100644 index 5bcc6daebd49549c8f68764627e5b1331513975f..0000000000000000000000000000000000000000 --- a/doc/doxygen/Doxyfile +++ /dev/null @@ -1,2658 +0,0 @@ -# Doxyfile 1.9.3 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed in -# front of the TAG it is preceding. -# -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the configuration -# file that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# https://www.gnu.org/software/libiconv/ for the list of possible encodings. -# The default value is: UTF-8. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by -# double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated. This name is used in the -# title of most generated pages and in a few other places. -# The default value is: My Project. - -PROJECT_NAME = "PLATO cmp_tool" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. This -# could be handy for archiving the generated documentation or if some version -# control system is used. - -PROJECT_NUMBER = 0.09 #TODO - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = "PLATO Compression/Decompression Tool" - -# With the PROJECT_LOGO tag one can specify a logo or an icon that is included -# in the documentation. The maximum height of the logo should not exceed 55 -# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy -# the logo to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path -# into which the generated documentation will be written. If a relative path is -# entered, it will be relative to the location where doxygen was started. If -# left blank the current directory will be used. - -OUTPUT_DIRECTORY = - -# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this -# option can be useful when feeding doxygen a huge amount of source files, where -# putting all generated files in the same directory would otherwise causes -# performance problems for the file system. -# The default value is: NO. - -CREATE_SUBDIRS = NO - -# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII -# characters to appear in the names of generated files. If set to NO, non-ASCII -# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode -# U+3044. -# The default value is: NO. - -ALLOW_UNICODE_NAMES = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. -# The default value is: English. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member -# descriptions after the members that are listed in the file and class -# documentation (similar to Javadoc). Set to NO to disable this. -# The default value is: YES. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief -# description of a member or function before the detailed description -# -# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. -# The default value is: YES. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings. Each string in this list, if found -# as the leading text of the brief description, will be stripped from the text -# and the result, after processing the whole list, is used as the annotated -# text. Otherwise, the brief description is used as-is. If left blank, the -# following values are used ($name is automatically replaced with the name of -# the entity):The $name class, The $name widget, The $name file, is, provides, -# specifies, contains, represents, a, an and the. - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# doxygen will generate a detailed section even if there is only a brief -# description. -# The default value is: NO. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. -# The default value is: NO. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path -# before files name in the file list and in the header files. If set to NO the -# shortest path that makes the file name unique will be used -# The default value is: YES. - -FULL_PATH_NAMES = NO - -# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. -# Stripping is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the path to -# strip. -# -# Note that you can specify absolute paths here, but also relative paths, which -# will be relative from the directory where doxygen is started. -# This tag requires that the tag FULL_PATH_NAMES is set to YES. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the -# path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class. If left blank only the name of -# the header file containing the class definition is used. Otherwise one should -# specify the list of include paths that are normally passed to the compiler -# using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't -# support long names like on DOS, Mac, or CD-ROM. -# The default value is: NO. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line (until the first dot) of a Javadoc-style comment as the brief -# description. If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments (thus requiring an explicit @brief command for a brief -# description.) -# The default value is: NO. - -JAVADOC_AUTOBRIEF = NO - -# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line -# such as -# /*************** -# as being the beginning of a Javadoc-style comment "banner". If set to NO, the -# Javadoc-style will behave just like regular comments and it will not be -# interpreted by doxygen. -# The default value is: NO. - -JAVADOC_BANNER = NO - -# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first -# line (until the first dot) of a Qt-style comment as the brief description. If -# set to NO, the Qt-style will behave just like regular Qt-style comments (thus -# requiring an explicit \brief command for a brief description.) -# The default value is: NO. - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a -# multi-line C++ special comment block (i.e. a block of //! or /// comments) as -# a brief description. This used to be the default behavior. The new default is -# to treat a multi-line C++ comment block as a detailed description. Set this -# tag to YES if you prefer the old behavior instead. -# -# Note that setting this tag to YES also means that rational rose comments are -# not recognized any more. -# The default value is: NO. - -MULTILINE_CPP_IS_BRIEF = NO - -# By default Python docstrings are displayed as preformatted text and doxygen's -# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the -# doxygen's special commands can be used and the contents of the docstring -# documentation blocks is shown as doxygen documentation. -# The default value is: YES. - -PYTHON_DOCSTRING = YES - -# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the -# documentation from any documented member that it re-implements. -# The default value is: YES. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new -# page for each member. If set to NO, the documentation of a member will be part -# of the file/class/namespace that contains it. -# The default value is: NO. - -SEPARATE_MEMBER_PAGES = YES - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen -# uses this value to replace tabs by spaces in code fragments. -# Minimum value: 1, maximum value: 16, default value: 4. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that act as commands in -# the documentation. An alias has the form: -# name=value -# For example adding -# "sideeffect=@par Side Effects:^^" -# will allow you to put the command \sideeffect (or @sideeffect) in the -# documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". Note that you cannot put \n's in the value part of an alias -# to insert newlines (in the resulting output). You can put ^^ in the value part -# of an alias to insert a newline as if a physical newline was in the original -# file. When you need a literal { or } or , in the value part of an alias you -# have to escape them by means of a backslash (\), this can lead to conflicts -# with the commands \{ and \} for these it is advised to use the version @{ and -# @} or use a double escape (\\{ and \\}) - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. For -# instance, some of the names that are used will be different. The list of all -# members will be omitted, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or -# Python sources only. Doxygen will then generate output that is more tailored -# for that language. For instance, namespaces will be presented as packages, -# qualified scopes will look different, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources. Doxygen will then generate output that is tailored for Fortran. -# The default value is: NO. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for VHDL. -# The default value is: NO. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice -# sources only. Doxygen will then generate output that is more tailored for that -# language. For instance, namespaces will be presented as modules, types will be -# separated into more groups, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_SLICE = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, -# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, -# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: -# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser -# tries to guess whether the code is fixed or free formatted code, this is the -# default for Fortran type files). For instance to make doxygen treat .inc files -# as Fortran files (default is PHP), and .f files as C (default is Fortran), -# use: inc=Fortran f=C. -# -# Note: For files without extension you can use no_extension as a placeholder. -# -# Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. When specifying no_extension you should add -# * to the FILE_PATTERNS. -# -# Note see also the list of default file extension mappings. - -EXTENSION_MAPPING = - -# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments -# according to the Markdown format, which allows for more readable -# documentation. See https://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you can -# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in -# case of backward compatibilities issues. -# The default value is: YES. - -MARKDOWN_SUPPORT = YES - -# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up -# to that level are automatically included in the table of contents, even if -# they do not have an id attribute. -# Note: This feature currently applies only to Markdown headings. -# Minimum value: 0, maximum value: 99, default value: 5. -# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. - -TOC_INCLUDE_HEADINGS = 5 - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by putting a % sign in front of the word or -# globally by setting AUTOLINK_SUPPORT to NO. -# The default value is: YES. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should set this -# tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); -# versus func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. -# The default value is: NO. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. -# The default value is: NO. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen -# will parse them like normal C++ but will assume all classes use public instead -# of private inheritance when no explicit protection keyword is present. -# The default value is: NO. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES will make -# doxygen to replace the get and set methods by a property in the documentation. -# This will only work if the methods are indeed getting or setting a simple -# type. If this is not the case, or you want to show the methods anyway, you -# should set this option to NO. -# The default value is: YES. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. -# The default value is: NO. - -DISTRIBUTE_GROUP_DOC = NO - -# If one adds a struct or class to a group and this option is enabled, then also -# any nested class or struct is added to the same group. By default this option -# is disabled and one has to add nested compounds explicitly via \ingroup. -# The default value is: NO. - -GROUP_NESTED_COMPOUNDS = NO - -# Set the SUBGROUPING tag to YES to allow class member groups of the same type -# (for instance a group of public functions) to be put as a subgroup of that -# type (e.g. under the Public Functions section). Set it to NO to prevent -# subgrouping. Alternatively, this can be done per class using the -# \nosubgrouping command. -# The default value is: YES. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions -# are shown inside the group in which they are included (e.g. using \ingroup) -# instead of on a separate page (for HTML and Man pages) or section (for LaTeX -# and RTF). -# -# Note that this feature does not work in combination with -# SEPARATE_MEMBER_PAGES. -# The default value is: NO. - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions -# with only public data fields or simple typedef fields will be shown inline in -# the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO, structs, classes, and unions are shown on a separate page (for HTML and -# Man pages) or section (for LaTeX and RTF). -# The default value is: NO. - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or -# enum is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically be -# useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. -# The default value is: NO. - -TYPEDEF_HIDES_STRUCT = NO - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can be -# an expensive process and often the same symbol appears multiple times in the -# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small -# doxygen will become slower. If the cache is too large, memory is wasted. The -# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range -# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 -# symbols. At the end of a run doxygen will report the cache usage and suggest -# the optimal cache size from a speed point of view. -# Minimum value: 0, maximum value: 9, default value: 0. - -LOOKUP_CACHE_SIZE = 0 - -# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use -# during processing. When set to 0 doxygen will based this on the number of -# cores available in the system. You can set it explicitly to a value larger -# than 0 to get more control over the balance between CPU load and processing -# speed. At this moment only the input processing can be done using multiple -# threads. Since this is still an experimental feature the default is set to 1, -# which effectively disables parallel processing. Please report any issues you -# encounter. Generating dot graphs in parallel is controlled by the -# DOT_NUM_THREADS setting. -# Minimum value: 0, maximum value: 32, default value: 1. - -NUM_PROC_THREADS = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in -# documentation are documented, even if no documentation was available. Private -# class members and static file members will be hidden unless the -# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. -# Note: This will also disable the warnings about undocumented members that are -# normally produced when WARNINGS is set to YES. -# The default value is: NO. - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will -# be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual -# methods of a class will be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIV_VIRTUAL = YES - -# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal -# scope will be included in the documentation. -# The default value is: NO. - -EXTRACT_PACKAGE = YES - -# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be -# included in the documentation. -# The default value is: NO. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO, -# only classes defined in header files are included. Does not have any effect -# for Java sources. -# The default value is: YES. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. If set to YES, local methods, -# which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO, only methods in the interface are -# included. -# The default value is: NO. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base name of -# the file that contains the anonymous namespace. By default anonymous namespace -# are hidden. -# The default value is: NO. - -EXTRACT_ANON_NSPACES = NO - -# If this flag is set to YES, the name of an unnamed parameter in a declaration -# will be determined by the corresponding definition. By default unnamed -# parameters remain unnamed in the output. -# The default value is: YES. - -RESOLVE_UNNAMED_PARAMS = YES - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all -# undocumented members inside documented classes or files. If set to NO these -# members will be included in the various overviews, but no documentation -# section is generated. This option has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. If set -# to NO, these classes will be included in the various overviews. This option -# has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# declarations. If set to NO, these declarations will be included in the -# documentation. -# The default value is: NO. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO, these -# blocks will be appended to the function's detailed documentation block. -# The default value is: NO. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation that is typed after a -# \internal command is included. If the tag is set to NO then the documentation -# will be excluded. Set it to YES to include the internal documentation. -# The default value is: NO. - -INTERNAL_DOCS = NO - -# With the correct setting of option CASE_SENSE_NAMES doxygen will better be -# able to match the capabilities of the underlying filesystem. In case the -# filesystem is case sensitive (i.e. it supports files in the same directory -# whose names only differ in casing), the option must be set to YES to properly -# deal with such files in case they appear in the input. For filesystems that -# are not case sensitive the option should be be set to NO to properly deal with -# output files written for symbols that only differ in casing, such as for two -# classes, one named CLASS and the other named Class, and to also support -# references to files without having to specify the exact matching casing. On -# Windows (including Cygwin) and MacOS, users should typically set this option -# to NO, whereas on Linux or other Unix flavors it should typically be set to -# YES. -# The default value is: system dependent. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES, the -# scope will be hidden. -# The default value is: NO. - -HIDE_SCOPE_NAMES = NO - -# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will -# append additional text to a page's title, such as Class Reference. If set to -# YES the compound reference will be hidden. -# The default value is: NO. - -HIDE_COMPOUND_REFERENCE= NO - -# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class -# will show which file needs to be included to use the class. -# The default value is: YES. - -SHOW_HEADERFILE = YES - -# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of -# the files that are included by a file in the documentation of that file. -# The default value is: YES. - -SHOW_INCLUDE_FILES = YES - -# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each -# grouped member an include statement to the documentation, telling the reader -# which file to include in order to use the member. -# The default value is: NO. - -SHOW_GROUPED_MEMB_INC = NO - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include -# files with double quotes in the documentation rather than with sharp brackets. -# The default value is: NO. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the -# documentation for inline members. -# The default value is: YES. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the -# (detailed) documentation of file and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. -# The default value is: YES. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief -# descriptions of file, namespace and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. Note that -# this will also influence the order of the classes in the class list. -# The default value is: NO. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the -# (brief and detailed) documentation of class members so that constructors and -# destructors are listed first. If set to NO the constructors will appear in the -# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. -# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief -# member documentation. -# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting -# detailed member documentation. -# The default value is: NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy -# of group names into alphabetical order. If set to NO the group names will -# appear in their defined order. -# The default value is: NO. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by -# fully-qualified names, including namespaces. If set to NO, the class list will -# be sorted only by class name, not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the alphabetical -# list. -# The default value is: NO. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper -# type resolution of all parameters of a function it will reject a match between -# the prototype and the implementation of a member function even if there is -# only one candidate or it is obvious which candidate to choose by doing a -# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still -# accept a match between prototype and implementation in such cases. -# The default value is: NO. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo -# list. This list is created by putting \todo commands in the documentation. -# The default value is: YES. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test -# list. This list is created by putting \test commands in the documentation. -# The default value is: YES. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug -# list. This list is created by putting \bug commands in the documentation. -# The default value is: YES. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) -# the deprecated list. This list is created by putting \deprecated commands in -# the documentation. -# The default value is: YES. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional documentation -# sections, marked by \if <section_label> ... \endif and \cond <section_label> -# ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the -# initial value of a variable or macro / define can have for it to appear in the -# documentation. If the initializer consists of more lines than specified here -# it will be hidden. Use a value of 0 to hide initializers completely. The -# appearance of the value of individual variables and macros / defines can be -# controlled using \showinitializer or \hideinitializer command in the -# documentation regardless of this setting. -# Minimum value: 0, maximum value: 10000, default value: 30. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES, the -# list will mention the files that were used to generate the documentation. -# The default value is: YES. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This -# will remove the Files entry from the Quick Index and from the Folder Tree View -# (if specified). -# The default value is: YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces -# page. This will remove the Namespaces entry from the Quick Index and from the -# Folder Tree View (if specified). -# The default value is: YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command command input-file, where command is the value of the -# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided -# by doxygen. Whatever the program writes to standard output is used as the file -# version. For an example see the documentation. - -FILE_VERSION_FILTER = "/bin/sh -c 'git log --pretty=\"format:%ci, author:%aN <%aE>, commit:%h\" -1 \"${1}\" || echo no git'" - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. You can -# optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. See also section "Changing the -# layout of pages" for information. -# -# Note that if you run doxygen from a directory containing a file called -# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE -# tag is left empty. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files containing -# the reference definitions. This must be a list of .bib files. The .bib -# extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. -# For LaTeX the style of the bibliography can be controlled using -# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. See also \cite for info how to create references. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated to -# standard output by doxygen. If QUIET is set to YES this implies that the -# messages are off. -# The default value is: NO. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES -# this implies that the warnings are on. -# -# Tip: Turn warnings on while writing the documentation. -# The default value is: YES. - -WARNINGS = YES - -# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate -# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag -# will automatically be disabled. -# The default value is: YES. - -WARN_IF_UNDOCUMENTED = YES - -# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as documenting some parameters in -# a documented function twice, or documenting parameters that don't exist or -# using markup commands wrongly. -# The default value is: YES. - -WARN_IF_DOC_ERROR = YES - -# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete -# function parameter documentation. If set to NO, doxygen will accept that some -# parameters have no documentation without warning. -# The default value is: YES. - -WARN_IF_INCOMPLETE_DOC = YES - -# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that -# are documented, but have no documentation for their parameters or return -# value. If set to NO, doxygen will only warn about wrong parameter -# documentation, but not about the absence of documentation. If EXTRACT_ALL is -# set to YES then this flag will automatically be disabled. See also -# WARN_IF_INCOMPLETE_DOC -# The default value is: NO. - -WARN_NO_PARAMDOC = YES - -# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS -# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but -# at the end of the doxygen process doxygen will return with a non-zero status. -# Possible values are: NO, YES and FAIL_ON_WARNINGS. -# The default value is: NO. - -WARN_AS_ERROR = NO - -# The WARN_FORMAT tag determines the format of the warning messages that doxygen -# can produce. The string should contain the $file, $line, and $text tags, which -# will be replaced by the file and line number from which the warning originated -# and the warning text. Optionally the format may contain $version, which will -# be replaced by the version of the file (if it could be obtained via -# FILE_VERSION_FILTER) -# The default value is: $file:$line: $text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning and error -# messages should be written. If left blank the output is written to standard -# error (stderr). In case the file specified cannot be opened for writing the -# warning and error messages are written to standard error. When as file - is -# specified the warning and error messages are written to standard output -# (stdout). - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag is used to specify the files and/or directories that contain -# documented source files. You may enter file names like myfile.cpp or -# directories like /usr/src/myproject. Separate the files or directories with -# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING -# Note: If this tag is empty the current directory is searched. - -INPUT = ../ - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: -# https://www.gnu.org/software/libiconv/) for the list of possible encodings. -# The default value is: UTF-8. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# read by doxygen. -# -# Note the list of default checked file patterns might differ from the list of -# default file extension mappings. -# -# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, -# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, -# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, -# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C -# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, -# *.vhdl, *.ucf, *.qsf and *.ice. - -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.idl \ - *.ddl \ - *.odl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.l \ - *.cs \ - *.d \ - *.php \ - *.php4 \ - *.php5 \ - *.phtml \ - *.inc \ - *.m \ - *.markdown \ - *.md \ - *.mm \ - *.dox \ - *.py \ - *.pyw \ - *.f90 \ - *.f95 \ - *.f03 \ - *.f08 \ - *.f18 \ - *.f \ - *.for \ - *.vhd \ - *.vhdl \ - *.ucf \ - *.qsf \ - *.ice - -# The RECURSIVE tag can be used to specify whether or not subdirectories should -# be searched for input files as well. -# The default value is: NO. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. -# The default value is: NO. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# ANamespace::AClass, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or directories -# that contain example code fragments that are included (see the \include -# command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank all -# files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude commands -# irrespective of the value of the RECURSIVE tag. -# The default value is: NO. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or directories -# that contain images that are to be included in the documentation (see the -# \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command: -# -# <filter> <input-file> -# -# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the -# name of an input file. Doxygen will then use the output that the filter -# program writes to standard output. If FILTER_PATTERNS is specified, this tag -# will be ignored. -# -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# properly processed by doxygen. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: pattern=filter -# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how -# filters are used. If the FILTER_PATTERNS tag is empty or if none of the -# patterns match the file name, INPUT_FILTER is applied. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# properly processed by doxygen. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will also be used to filter the input files that are used for -# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). -# The default value is: NO. - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and -# it is also possible to disable source filtering for a specific pattern using -# *.ext= (so without naming a filter). -# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want to reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will be -# generated. Documented entities will be cross-referenced with these sources. -# -# Note: To get rid of all source code in the generated output, make sure that -# also VERBATIM_HEADERS is set to NO. -# The default value is: NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. -# The default value is: NO. - -INLINE_SOURCES = YES - -# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any -# special comment blocks from generated source code fragments. Normal C, C++ and -# Fortran comments will always remain visible. -# The default value is: YES. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# entity all documented functions referencing it will be listed. -# The default value is: NO. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES then for each documented function -# all documented entities called/used by that function will be listed. -# The default value is: NO. - -REFERENCES_RELATION = YES - -# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES then the hyperlinks from functions in REFERENCES_RELATION and -# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will -# link to the documentation. -# The default value is: YES. - -REFERENCES_LINK_SOURCE = YES - -# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the -# source code will show a tooltip with additional information such as prototype, -# brief description and links to the definition and documentation. Since this -# will make the HTML file larger and loading of large files a bit slower, you -# can opt to disable this feature. -# The default value is: YES. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -SOURCE_TOOLTIPS = YES - -# If the USE_HTAGS tag is set to YES then the references to source code will -# point to the HTML generated by the htags(1) tool instead of doxygen built-in -# source browser. The htags tool is part of GNU's global source tagging system -# (see https://www.gnu.org/software/global/global.html). You will need version -# 4.8.6 or higher. -# -# To use it do the following: -# - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file -# - Make sure the INPUT points to the root of the source tree -# - Run doxygen as normal -# -# Doxygen will invoke htags (and that will in turn invoke gtags), so these -# tools must be available from the command line (i.e. in the search path). -# -# The result: instead of the source browser generated by doxygen, the links to -# source code will now point to the output of htags. -# The default value is: NO. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a -# verbatim copy of the header file for each class for which an include is -# specified. Set to NO to disable this. -# See also: Section \class. -# The default value is: YES. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all -# compounds will be generated. Enable this if the project contains a lot of -# classes, structs, unions or interfaces. -# The default value is: YES. - -ALPHABETICAL_INDEX = YES - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output -# The default value is: YES. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each -# generated HTML page (for example: .htm, .php, .asp). -# The default value is: .html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a user-defined HTML header file for -# each generated HTML page. If the tag is left blank doxygen will generate a -# standard header. -# -# To get valid HTML the header file that includes any scripts and style sheets -# that doxygen needs, which is dependent on the configuration options used (e.g. -# the setting GENERATE_TREEVIEW). It is highly recommended to start with a -# default header using -# doxygen -w html new_header.html new_footer.html new_stylesheet.css -# YourConfigFile -# and then modify the file new_header.html. See also section "Doxygen usage" -# for information on how to generate the default header that doxygen normally -# uses. -# Note: The header is subject to change so you typically have to regenerate the -# default header when upgrading to a newer version of doxygen. For a description -# of the possible markers and block names see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_HEADER = header.html - -# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each -# generated HTML page. If the tag is left blank doxygen will generate a standard -# footer. See HTML_HEADER for more information on how to generate a default -# footer and what special commands can be used inside the footer. See also -# section "Doxygen usage" for information on how to generate the default footer -# that doxygen normally uses. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FOOTER = footer.html - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined -# cascading style sheets that are included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefore more robust against future updates. -# Doxygen will copy the style sheet files to the output directory. -# Note: The order of the extra style sheet files is of importance (e.g. the last -# style sheet in the list overrules the setting of the previous ones in the -# list). For an example see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = customdoxygen.css - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that the -# files will be copied as-is; there are no commands or markers available. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the style sheet and background images according to -# this color. Hue is specified as an angle on a color-wheel, see -# https://en.wikipedia.org/wiki/Hue for more information. For instance the value -# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 -# purple, and 360 is red again. -# Minimum value: 0, maximum value: 359, default value: 220. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use gray-scales only. A -# value of 255 will produce the most vivid colors. -# Minimum value: 0, maximum value: 255, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the -# luminance component of the colors in the HTML output. Values below 100 -# gradually make the output lighter, whereas values above 100 make the output -# darker. The value divided by 100 is the actual gamma applied, so 80 represents -# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not -# change the gamma. -# Minimum value: 40, maximum value: 240, default value: 80. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to YES can help to show when doxygen was last run and thus if the -# documentation is up to date. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = YES - -# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML -# documentation will contain a main index with vertical navigation menus that -# are dynamically created via JavaScript. If disabled, the navigation index will -# consists of multiple levels of tabs that are statically embedded in every HTML -# page. Disable this option to support browsers that do not have JavaScript, -# like the Qt help browser. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_MENUS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries -# shown in the various tree structured indices initially; the user can expand -# and collapse entries dynamically later on. Doxygen will expand the tree to -# such a level that at most the specified number of entries are visible (unless -# a fully collapsed tree already exceeds this amount). So setting the number of -# entries 1 will produce a full collapsed tree by default. 0 is a special value -# representing an infinite number of entries and will result in a full expanded -# tree by default. -# Minimum value: 0, maximum value: 9999, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files will be -# generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: -# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To -# create a documentation set, doxygen will generate a Makefile in the HTML -# output directory. Running make will produce the docset in that directory and -# running make install will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy -# genXcode/_index.html for more information. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_DOCSET = NO - -# This tag determines the name of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# The default value is: Doxygen generated docs. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# This tag determines the URL of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDURL = - -# This tag specifies a string that should uniquely identify the documentation -# set bundle. This should be a reverse domain-name style string, e.g. -# com.mycompany.MyDocSet. Doxygen will append .docset to the name. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. -# The default value is: org.doxygen.Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. -# The default value is: Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three -# additional HTML index files: index.hhp, index.hhc, and index.hhk. The -# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# on Windows. In the beginning of 2021 Microsoft took the original page, with -# a.o. the download links, offline the HTML help workshop was already many years -# in maintenance mode). You can download the HTML help workshop from the web -# archives at Installation executable (see: -# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo -# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). -# -# The HTML Help Workshop contains a compiler that can convert all HTML output -# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML -# files are now used as the Windows 98 help format, and will replace the old -# Windows help format (.hlp) on all Windows platforms in the future. Compressed -# HTML files also contain an index, a table of contents, and you can search for -# words in the documentation. The HTML workshop also contains a viewer for -# compressed HTML files. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_HTMLHELP = NO - -# The CHM_FILE tag can be used to specify the file name of the resulting .chm -# file. You can add a path in front of the file if the result should not be -# written to the html output directory. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_FILE = - -# The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler (hhc.exe). If non-empty, -# doxygen will try to run the HTML help compiler on the generated index.hhp. -# The file has to be specified with full path. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -HHC_LOCATION = - -# The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the main .chm file (NO). -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -GENERATE_CHI = NO - -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) -# and project file content. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_INDEX_ENCODING = - -# The BINARY_TOC flag controls whether a binary table of contents is generated -# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it -# enables the Previous and Next buttons. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members to -# the table of contents of the HTML help documentation and to the tree view. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that -# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help -# (.qch) of the generated HTML documentation. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify -# the file name of the resulting .qch file. The path specified is relative to -# the HTML output folder. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help -# Project output. For more information please see Qt Help Project / Namespace -# (see: -# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt -# Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: -# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). -# The default value is: doc. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_VIRTUAL_FOLDER = doc - -# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom -# filter to add. For more information please see Qt Help Project / Custom -# Filters (see: -# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: -# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's filter section matches. Qt Help Project / Filter Attributes (see: -# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_SECT_FILTER_ATTRS = - -# The QHG_LOCATION tag can be used to specify the location (absolute path -# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to -# run qhelpgenerator on the generated .qhp file. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be -# generated, together with the HTML files, they form an Eclipse help plugin. To -# install this plugin and make it available under the help contents menu in -# Eclipse, the contents of the directory containing the HTML and XML files needs -# to be copied into the plugins directory of eclipse. The name of the directory -# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. -# After copying Eclipse needs to be restarted before the help appears. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the Eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have this -# name. Each documentation set should have its own identifier. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# If you want full control over the layout of the generated HTML pages it might -# be necessary to disable the index and replace it with your own. The -# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top -# of each HTML page. A value of NO enables the index and the value YES disables -# it. Since the tabs in the index contain the same information as the navigation -# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -DISABLE_INDEX = YES - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. If the tag -# value is set to YES, a side panel will be generated containing a tree-like -# index structure (just like the one that is generated for HTML Help). For this -# to work a browser that supports JavaScript, DHTML, CSS and frames is required -# (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can -# further fine tune the look of the index (see "Fine-tuning the output"). As an -# example, the default style sheet generated by doxygen has an example that -# shows how to put an image at the root of the tree instead of the PROJECT_NAME. -# Since the tree basically has the same information as the tab index, you could -# consider setting DISABLE_INDEX to YES when enabling this option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_TREEVIEW = NO - -# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the -# FULL_SIDEBAR option determines if the side bar is limited to only the treeview -# area (value NO) or if it should extend to the full height of the window (value -# YES). Setting this to YES gives a layout similar to -# https://docs.readthedocs.io with more room for contents, but less room for the -# project logo, title, and description. If either GENERATE_TREEVIEW or -# DISABLE_INDEX is set to NO, this option has no effect. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FULL_SIDEBAR = NO - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that -# doxygen will group on one line in the generated HTML documentation. -# -# Note that a value of 0 will completely suppress the enum values from appearing -# in the overview section. -# Minimum value: 0, maximum value: 20, default value: 4. -# This tag requires that the tag GENERATE_HTML is set to YES. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used -# to set the initial width (in pixels) of the frame in which the tree is shown. -# Minimum value: 0, maximum value: 1500, default value: 250. -# This tag requires that the tag GENERATE_HTML is set to YES. - -TREEVIEW_WIDTH = 250 - -# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to -# external symbols imported via tag files in a separate window. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -EXT_LINKS_IN_WINDOW = NO - -# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email -# addresses. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -OBFUSCATE_EMAILS = YES - -# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg -# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see -# https://inkscape.org) to generate formulas as SVG images instead of PNGs for -# the HTML output. These images will generally look nicer at scaled resolutions. -# Possible values are: png (the default) and svg (looks nicer but requires the -# pdf2svg or inkscape tool). -# The default value is: png. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FORMULA_FORMAT = png - -# Use this tag to change the font size of LaTeX formulas included as images in -# the HTML documentation. When you change the font size after a successful -# doxygen run you need to manually remove any form_*.png images from the HTML -# output directory to force them to be regenerated. -# Minimum value: 8, maximum value: 50, default value: 10. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANSPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - -# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands -# to create new LaTeX commands to be used in formulas as building blocks. See -# the section "Including formulas" for details. - -FORMULA_MACROFILE = - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# https://www.mathjax.org) which uses client side JavaScript for the rendering -# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX -# installed or if you want to formulas look prettier in the HTML output. When -# enabled you may also need to install MathJax separately and configure the path -# to it using the MATHJAX_RELPATH option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -USE_MATHJAX = NO - -# With MATHJAX_VERSION it is possible to specify the MathJax version to be used. -# Note that the different versions of MathJax have different requirements with -# regards to the different settings, so it is possible that also other MathJax -# settings have to be changed when switching between the different MathJax -# versions. -# Possible values are: MathJax_2 and MathJax_3. -# The default value is: MathJax_2. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_VERSION = MathJax_2 - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. For more details about the output format see MathJax -# version 2 (see: -# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 -# (see: -# http://docs.mathjax.org/en/latest/web/components/output.html). -# Possible values are: HTML-CSS (which is slower, but has the best -# compatibility. This is the name for Mathjax version 2, for MathJax version 3 -# this will be translated into chtml), NativeMML (i.e. MathML. Only supported -# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This -# is the name for Mathjax version 3, for MathJax version 2 this will be -# translated into HTML-CSS) and SVG. -# The default value is: HTML-CSS. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the HTML -# output directory using the MATHJAX_RELPATH option. The destination directory -# should contain the MathJax.js script. For instance, if the mathjax directory -# is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax -# Content Delivery Network so you can quickly see the result without installing -# MathJax. However, it is strongly recommended to install a local copy of -# MathJax from https://www.mathjax.org before deployment. The default value is: -# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 -# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/ - -# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax -# extension names that should be enabled during MathJax rendering. For example -# for MathJax version 2 (see https://docs.mathjax.org/en/v2.7-latest/tex.html -# #tex-and-latex-extensions): -# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols -# For example for MathJax version 3 (see -# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): -# MATHJAX_EXTENSIONS = ams -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces -# of code that will be used on startup of the MathJax code. See the MathJax site -# (see: -# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an -# example see the documentation. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box for -# the HTML output. The underlying search engine uses javascript and DHTML and -# should work on any modern browser. Note that when using HTML help -# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) -# there is already a search function so this one should typically be disabled. -# For large projects the javascript based search engine can be slow, then -# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to -# search using the keyboard; to jump to the search box use <access key> + S -# (what the <access key> is depends on the OS and browser, but it is typically -# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down -# key> to jump into the search results window, the results can be navigated -# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel -# the search. The filter options can be selected when the cursor is inside the -# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys> -# to select a filter and <Enter> or <escape> to activate or cancel the filter -# option. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -SEARCHENGINE = NO - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a web server instead of a web client using JavaScript. There -# are two flavors of web server based searching depending on the EXTERNAL_SEARCH -# setting. When disabled, doxygen will generate a PHP script for searching and -# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing -# and searching needs to be provided by external tools. See the section -# "External Indexing and Searching" for details. -# The default value is: NO. -# This tag requires that the tag SEARCHENGINE is set to YES. - -SERVER_BASED_SEARCH = NO - -# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP -# script for searching. Instead the search results are written to an XML file -# which needs to be processed by an external indexer. Doxygen will invoke an -# external search engine pointed to by the SEARCHENGINE_URL option to obtain the -# search results. -# -# Doxygen ships with an example indexer (doxyindexer) and search engine -# (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: -# https://xapian.org/). -# -# See the section "External Indexing and Searching" for details. -# The default value is: NO. -# This tag requires that the tag SEARCHENGINE is set to YES. - -EXTERNAL_SEARCH = NO - -# The SEARCHENGINE_URL should point to a search engine hosted by a web server -# which will return the search results when EXTERNAL_SEARCH is enabled. -# -# Doxygen ships with an example indexer (doxyindexer) and search engine -# (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: -# https://xapian.org/). See the section "External Indexing and Searching" for -# details. -# This tag requires that the tag SEARCHENGINE is set to YES. - -SEARCHENGINE_URL = - -# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed -# search data is written to a file for indexing by an external tool. With the -# SEARCHDATA_FILE tag the name of this file can be specified. -# The default file is: searchdata.xml. -# This tag requires that the tag SEARCHENGINE is set to YES. - -SEARCHDATA_FILE = searchdata.xml - -# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the -# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is -# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple -# projects and redirect the results back to the right project. -# This tag requires that the tag SEARCHENGINE is set to YES. - -EXTERNAL_SEARCH_ID = - -# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen -# projects other than the one defined by this configuration file, but that are -# all added to the same external search index. Each project needs to have a -# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of -# to a relative location where the documentation can be found. The format is: -# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... -# This tag requires that the tag SEARCHENGINE is set to YES. - -EXTRA_SEARCH_MAPPINGS = - -#--------------------------------------------------------------------------- -# Configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. -# The default value is: YES. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: latex. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. -# -# Note that when not enabling USE_PDFLATEX the default is latex when enabling -# USE_PDFLATEX the default is pdflatex and when in the later case latex is -# chosen this is overwritten by pdflatex. For specific output languages the -# default can have been set differently, this depends on the implementation of -# the output language. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate -# index for LaTeX. -# Note: This tag is used in the Makefile / make.bat. -# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file -# (.tex). -# The default file is: makeindex. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -MAKEINDEX_CMD_NAME = makeindex - -# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to -# generate index for LaTeX. In case there is no backslash (\) as first character -# it will be automatically added in the LaTeX code. -# Note: This tag is used in the generated output file (.tex). -# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat. -# The default value is: makeindex. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_MAKEINDEX_CMD = makeindex - -# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX -# documents. This may be useful for small projects and may help to save some -# trees in general. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used by the -# printer. -# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x -# 14 inches) and executive (7.25 x 10.5 inches). -# The default value is: a4. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -PAPER_TYPE = a4 - -# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names -# that should be included in the LaTeX output. The package can be specified just -# by its name or with the correct syntax as to be used with the LaTeX -# \usepackage command. To get the times font for instance you can specify : -# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times} -# To use the option intlimits with the amsmath package you can specify: -# EXTRA_PACKAGES=[intlimits]{amsmath} -# If left blank no extra packages will be included. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a user-defined LaTeX header for -# the generated LaTeX document. The header should contain everything until the -# first chapter. If it is left blank doxygen will generate a standard header. It -# is highly recommended to start with a default header using -# doxygen -w latex new_header.tex new_footer.tex new_stylesheet.sty -# and then modify the file new_header.tex. See also section "Doxygen usage" for -# information on how to generate the default header that doxygen normally uses. -# -# Note: Only use a user-defined header if you know what you are doing! -# Note: The header is subject to change so you typically have to regenerate the -# default header when upgrading to a newer version of doxygen. The following -# commands have a special meaning inside the header (and footer): For a -# description of the possible markers and block names see the documentation. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_HEADER = - -# The LATEX_FOOTER tag can be used to specify a user-defined LaTeX footer for -# the generated LaTeX document. The footer should contain everything after the -# last chapter. If it is left blank doxygen will generate a standard footer. See -# LATEX_HEADER for more information on how to generate a default footer and what -# special commands can be used inside the footer. See also section "Doxygen -# usage" for information on how to generate the default footer that doxygen -# normally uses. Note: Only use a user-defined footer if you know what you are -# doing! -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_FOOTER = - -# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined -# LaTeX style sheets that are included after the standard style sheets created -# by doxygen. Using this option one can overrule certain style aspects. Doxygen -# will copy the style sheet files to the output directory. -# Note: The order of the extra style sheet files is of importance (e.g. the last -# style sheet in the list overrules the setting of the previous ones in the -# list). -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_EXTRA_STYLESHEET = - -# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the LATEX_OUTPUT output -# directory. Note that the files will be copied as-is; there are no commands or -# markers available. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_EXTRA_FILES = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is -# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will -# contain links (just like the HTML output) instead of page references. This -# makes the output suitable for online browsing using a PDF viewer. -# The default value is: YES. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as -# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX -# files. Set this option to YES, to get a higher quality PDF documentation. -# -# See also section LATEX_CMD_NAME for selecting the engine. -# The default value is: YES. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode -# command to the generated LaTeX files. This will instruct LaTeX to keep running -# if errors occur, instead of asking the user for help. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_BATCHMODE = NO - -# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the -# index chapters (such as File Index, Compound Index, etc.) in the output. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_HIDE_INDICES = NO - -# The LATEX_BIB_STYLE tag can be used to specify the style to use for the -# bibliography, e.g. plainnat, or ieeetr. See -# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. -# The default value is: plain. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_BIB_STYLE = plain - -# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated -# page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_TIMESTAMP = NO - -# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute) -# path from which the emoji images will be read. If a relative path is entered, -# it will be relative to the LATEX_OUTPUT directory. If left blank the -# LATEX_OUTPUT directory will be used. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_EMOJI_DIRECTORY = - -#--------------------------------------------------------------------------- -# Configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The -# RTF output is optimized for Word 97 and may not look too pretty with other RTF -# readers/editors. -# The default value is: NO. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: rtf. -# This tag requires that the tag GENERATE_RTF is set to YES. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF -# documents. This may be useful for small projects and may help to save some -# trees in general. -# The default value is: NO. -# This tag requires that the tag GENERATE_RTF is set to YES. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will -# contain hyperlink fields. The RTF file will contain links (just like the HTML -# output) instead of page references. This makes the output suitable for online -# browsing using Word or some other Word compatible readers that support those -# fields. -# -# Note: WordPad (write) and others do not support links. -# The default value is: NO. -# This tag requires that the tag GENERATE_RTF is set to YES. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# configuration file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. -# -# See also section "Doxygen usage" for information on how to generate the -# default style sheet that doxygen normally uses. -# This tag requires that the tag GENERATE_RTF is set to YES. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an RTF document. Syntax is -# similar to doxygen's configuration file. A template extensions file can be -# generated using doxygen -e rtf extensionFile. -# This tag requires that the tag GENERATE_RTF is set to YES. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# Configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for -# classes and files. -# The default value is: NO. - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. A directory man3 will be created inside the directory specified by -# MAN_OUTPUT. -# The default directory is: man. -# This tag requires that the tag GENERATE_MAN is set to YES. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to the generated -# man pages. In case the manual section does not start with a number, the number -# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is -# optional. -# The default value is: .3. -# This tag requires that the tag GENERATE_MAN is set to YES. - -MAN_EXTENSION = .3 - -# The MAN_SUBDIR tag determines the name of the directory created within -# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by -# MAN_EXTENSION with the initial . removed. -# This tag requires that the tag GENERATE_MAN is set to YES. - -MAN_SUBDIR = - -# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it -# will generate one additional man file for each entity documented in the real -# man page(s). These additional files only source the real man page, but without -# them the man command would be unable to find the correct page. -# The default value is: NO. -# This tag requires that the tag GENERATE_MAN is set to YES. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# Configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that -# captures the structure of the code including all documentation. -# The default value is: NO. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: xml. -# This tag requires that the tag GENERATE_XML is set to YES. - -XML_OUTPUT = xml - -# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program -# listings (including syntax highlighting and cross-referencing information) to -# the XML output. Note that enabling this will significantly increase the size -# of the XML output. -# The default value is: YES. -# This tag requires that the tag GENERATE_XML is set to YES. - -XML_PROGRAMLISTING = YES - -# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include -# namespace members in file scope as well, matching the HTML output. -# The default value is: NO. -# This tag requires that the tag GENERATE_XML is set to YES. - -XML_NS_MEMB_FILE_SCOPE = NO - -#--------------------------------------------------------------------------- -# Configuration options related to the DOCBOOK output -#--------------------------------------------------------------------------- - -# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files -# that can be used to generate PDF. -# The default value is: NO. - -GENERATE_DOCBOOK = NO - -# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in -# front of it. -# The default directory is: docbook. -# This tag requires that the tag GENERATE_DOCBOOK is set to YES. - -DOCBOOK_OUTPUT = docbook - -#--------------------------------------------------------------------------- -# Configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures -# the structure of the code including all documentation. Note that this feature -# is still experimental and incomplete at the moment. -# The default value is: NO. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# Configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module -# file that captures the structure of the code including all documentation. -# -# Note that this feature is still experimental and incomplete at the moment. -# The default value is: NO. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary -# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI -# output from the Perl module output. -# The default value is: NO. -# This tag requires that the tag GENERATE_PERLMOD is set to YES. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely -# formatted so it can be parsed by a human reader. This is useful if you want to -# understand what is going on. On the other hand, if this tag is set to NO, the -# size of the Perl module output will be much smaller and Perl will parse it -# just the same. -# The default value is: YES. -# This tag requires that the tag GENERATE_PERLMOD is set to YES. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file are -# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful -# so different doxyrules.make files included by the same Makefile don't -# overwrite each other's variables. -# This tag requires that the tag GENERATE_PERLMOD is set to YES. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all -# C-preprocessor directives found in the sources and include files. -# The default value is: YES. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names -# in the source code. If set to NO, only conditional compilation will be -# performed. Macro expansion can be done in a controlled way by setting -# EXPAND_ONLY_PREDEF to YES. -# The default value is: NO. -# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then -# the macro expansion is limited to the macros specified with the PREDEFINED and -# EXPAND_AS_DEFINED tags. -# The default value is: NO. -# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES, the include files in the -# INCLUDE_PATH will be searched if a #include is found. -# The default value is: YES. -# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by the -# preprocessor. -# This tag requires that the tag SEARCH_INCLUDES is set to YES. - -INCLUDE_PATH = ../include - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will be -# used. -# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that are -# defined before the preprocessor is started (similar to the -D option of e.g. -# gcc). The argument of the tag is a list of macros of the form: name or -# name=definition (no spaces). If the definition and the "=" are omitted, "=1" -# is assumed. To prevent a macro definition from being undefined via #undef or -# recursively expanded use the := operator instead of the = operator. -# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this -# tag can be used to specify a list of macro names that should be expanded. The -# macro definition that is found in the sources will be used. Use the PREDEFINED -# tag if you want to use a different macro definition that overrules the -# definition found in the source code. -# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will -# remove all references to function-like macros that are alone on a line, have -# an all uppercase name, and do not end with a semicolon. Such function macros -# are typically used for boiler-plate code, and will confuse the parser if not -# removed. -# The default value is: YES. -# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration options related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES tag can be used to specify one or more tag files. For each tag -# file the location of the external documentation should be added. The format of -# a tag file without this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where loc1 and loc2 can be relative or absolute paths or URLs. See the -# section "Linking to external documentation" for more information about the use -# of tag files. -# Note: Each tag file must have a unique name (where the name does NOT include -# the path). If a tag file is not located in the directory in which doxygen is -# run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create a -# tag file that is based on the input files it reads. See section "Linking to -# external documentation" for more information about the usage of tag files. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES, all external class will be listed in -# the class index. If set to NO, only the inherited external classes will be -# listed. -# The default value is: NO. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will be -# listed. -# The default value is: YES. - -EXTERNAL_GROUPS = YES - -# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in -# the related pages index. If set to NO, only the current project's pages will -# be listed. -# The default value is: YES. - -EXTERNAL_PAGES = YES - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# You can include diagrams made with dia in doxygen documentation. Doxygen will -# then run dia to produce the diagram and insert it in the documentation. The -# DIA_PATH tag allows you to specify the directory where the dia binary resides. -# If left empty dia is assumed to be found in the default search path. - -DIA_PATH = - -# If set to YES the inheritance and collaboration graphs will hide inheritance -# and usage relations if the target is undocumented or is not a class. -# The default value is: YES. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz (see: -# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent -# Bell Labs. The other options in this section have no effect if this option is -# set to NO -# The default value is: NO. - -HAVE_DOT = YES - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed -# to run in parallel. When set to 0 doxygen will base this on the number of -# processors available in the system. You can set it explicitly to a value -# larger than 0 to get control over the balance between CPU load and processing -# speed. -# Minimum value: 0, maximum value: 32, default value: 0. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_NUM_THREADS = 0 - -# When you want a differently looking font in the dot files that doxygen -# generates you can specify the font name using DOT_FONTNAME. You need to make -# sure dot is able to find the font, which can be done by putting it in a -# standard location or by setting the DOTFONTPATH environment variable or by -# setting DOT_FONTPATH to the directory containing the font. -# The default value is: Helvetica. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_FONTNAME = Helvetica - -# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of -# dot graphs. -# Minimum value: 4, maximum value: 24, default value: 10. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the default font as specified with -# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set -# the path where dot can find it using this tag. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_FONTPATH = - -# If the CLASS_GRAPH tag is set to YES (or GRAPH) then doxygen will generate a -# graph for each documented class showing the direct and indirect inheritance -# relations. In case HAVE_DOT is set as well dot will be used to draw the graph, -# otherwise the built-in generator will be used. If the CLASS_GRAPH tag is set -# to TEXT the direct and indirect inheritance relations will be shown as texts / -# links. -# Possible values are: NO, YES, TEXT and GRAPH. -# The default value is: YES. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a -# graph for each documented class showing the direct and indirect implementation -# dependencies (inheritance, containment, and class references variables) of the -# class with other documented classes. -# The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for -# groups, showing the direct groups dependencies. -# The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -UML_LOOK = YES - -# If the UML_LOOK tag is enabled, the fields and methods are shown inside the -# class node. If there are many fields or methods and many nodes the graph may -# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the -# number of items for each type to make the size more manageable. Set this to 0 -# for no limit. Note that the threshold may be exceeded by 50% before the limit -# is enforced. So when you set the threshold to 10, up to 15 fields may appear, -# but if the number exceeds 15, the total amount of fields shown is limited to -# 10. -# Minimum value: 0, maximum value: 100, default value: 10. -# This tag requires that the tag UML_LOOK is set to YES. - -UML_LIMIT_NUM_FIELDS = 10 - -# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and -# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS -# tag is set to YES, doxygen will add type and arguments for attributes and -# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen -# will not generate fields with class member information in the UML graphs. The -# class diagrams will look similar to the default class diagrams but using UML -# notation for the relationships. -# Possible values are: NO, YES and NONE. -# The default value is: NO. -# This tag requires that the tag UML_LOOK is set to YES. - -DOT_UML_DETAILS = NO - -# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters -# to display on a single line. If the actual line length exceeds this threshold -# significantly it will wrapped across multiple lines. Some heuristics are apply -# to avoid ugly line breaks. -# Minimum value: 0, maximum value: 1000, default value: 17. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_WRAP_THRESHOLD = 17 - -# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and -# collaboration graphs will show the relations between templates and their -# instances. -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -TEMPLATE_RELATIONS = NO - -# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to -# YES then doxygen will generate a graph for each documented file showing the -# direct and indirect include dependencies of the file with other documented -# files. -# The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. - -INCLUDE_GRAPH = YES - -# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are -# set to YES then doxygen will generate a graph for each documented file showing -# the direct and indirect include dependencies of the file with other documented -# files. -# The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH tag is set to YES then doxygen will generate a call -# dependency graph for every global function or class method. -# -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. Disabling a call graph can be -# accomplished by means of the command \hidecallgraph. -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -CALL_GRAPH = YES - -# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller -# dependency graph for every global function or class method. -# -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable caller graphs for selected -# functions only using the \callergraph command. Disabling a caller graph can be -# accomplished by means of the command \hidecallergraph. -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -CALLER_GRAPH = YES - -# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical -# hierarchy of all classes instead of a textual one. -# The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the -# dependencies a directory has on other directories in a graphical way. The -# dependency relations are determined by the #include relations between the -# files in the directories. -# The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. - -DIRECTORY_GRAPH = YES - -# The DIR_GRAPH_MAX_DEPTH tag can be used to limit the maximum number of levels -# of child directories generated in directory dependency graphs by dot. -# Minimum value: 1, maximum value: 25, default value: 1. -# This tag requires that the tag DIRECTORY_GRAPH is set to YES. - -DIR_GRAPH_MAX_DEPTH = 1 - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. For an explanation of the image formats see the section -# output formats in the documentation of the dot tool (Graphviz (see: -# http://www.graphviz.org/)). -# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order -# to make the SVG files visible in IE 9+ (other browsers do not have this -# requirement). -# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo, -# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and -# png:gdiplus:gdiplus. -# The default value is: png. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_IMAGE_FORMAT = svg - -# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to -# enable generation of interactive SVG images that allow zooming and panning. -# -# Note that this requires a modern browser other than Internet Explorer. Tested -# and working are Firefox, Chrome, Safari, and Opera. -# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make -# the SVG files visible. Older versions of IE do not have SVG support. -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -INTERACTIVE_SVG = YES - -# The DOT_PATH tag can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the \dotfile -# command). -# This tag requires that the tag HAVE_DOT is set to YES. - -DOTFILE_DIRS = - -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the \mscfile -# command). - -MSCFILE_DIRS = - -# The DIAFILE_DIRS tag can be used to specify one or more directories that -# contain dia files that are included in the documentation (see the \diafile -# command). - -DIAFILE_DIRS = - -# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the -# path where java can find the plantuml.jar file or to the filename of jar file -# to be used. If left blank, it is assumed PlantUML is not used or called during -# a preprocessing step. Doxygen will generate a warning when it encounters a -# \startuml command in this case and will not generate output for the diagram. - -PLANTUML_JAR_PATH = - -# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a -# configuration file for plantuml. - -PLANTUML_CFG_FILE = - -# When using plantuml, the specified paths are searched for files specified by -# the !include statement in a plantuml block. - -PLANTUML_INCLUDE_PATH = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes -# that will be shown in the graph. If the number of nodes in a graph becomes -# larger than this value, doxygen will truncate the graph, which is visualized -# by representing a node as a red box. Note that doxygen if the number of direct -# children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that -# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. -# Minimum value: 0, maximum value: 10000, default value: 50. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs -# generated by dot. A depth value of 3 means that only nodes reachable from the -# root by following a path via at most 3 edges will be shown. Nodes that lay -# further from the root node will be omitted. Note that setting this option to 1 -# or 2 may greatly reduce the computation time needed for large code bases. Also -# note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. -# Minimum value: 0, maximum value: 1000, default value: 0. -# This tag requires that the tag HAVE_DOT is set to YES. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not seem -# to support this out of the box. -# -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_TRANSPARENT = YES - -# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) support -# this, this feature is disabled by default. -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_MULTI_TARGETS = YES - -# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page -# explaining the meaning of the various boxes and arrows in the dot generated -# graphs. -# Note: This tag requires that UML_LOOK isn't set, i.e. the doxygen internal -# graphical representation for inheritance and collaboration diagrams is used. -# The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate -# files that are used to generate the various graphs. -# -# Note: This setting is not only used for dot files but also for msc temporary -# files. -# The default value is: YES. - -DOT_CLEANUP = YES diff --git a/doc/doxygen/Doxyfile.in b/doc/doxygen/Doxyfile.in index 08f1e393dfc96d96f6300a1754b7ab66993be9ee..bd30e4c7447f508b8b932e2e15df9319ee41eee7 100644 --- a/doc/doxygen/Doxyfile.in +++ b/doc/doxygen/Doxyfile.in @@ -1,4 +1,4 @@ -# Doxyfile 1.9.3 +# Doxyfile 1.9.5 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -12,6 +12,16 @@ # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). +# +# Note: +# +# Use doxygen to compare the used configuration file with the template +# configuration file: +# doxygen -x [configFile] +# Use doxygen to compare the used configuration file with the template +# configuration file without replacing the environment variables or CMake type +# replacement variables: +# doxygen -x_noenv [configFile] #--------------------------------------------------------------------------- # Project related configuration options @@ -32,7 +42,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = "PLATO cmp_tool" +PROJECT_NAME = "cmp_tool" # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version @@ -44,32 +54,44 @@ PROJECT_NUMBER = @VERSION@ # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = "PLATO Compression/Decompression Tool" +PROJECT_BRIEF = "PLATO Compression Tool" # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = +PROJECT_LOGO = @DOXYDIR@/plato-logo-med.png # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = +OUTPUT_DIRECTORY = generated_documentation -# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 +# sub-directories (in 2 levels) under the output directory of each output format +# and will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes -# performance problems for the file system. +# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to +# control the number of sub-directories. # The default value is: NO. CREATE_SUBDIRS = NO +# Controls the number of sub-directories that will be created when +# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every +# level increment doubles the number of directories, resulting in 4096 +# directories at level 8 which is the default and also the maximum value. The +# sub-directories are organized in 2 levels, the first level always has a fixed +# numer of 16 directories. +# Minimum value: 0, maximum value: 8, default value: 8. +# This tag requires that the tag CREATE_SUBDIRS is set to YES. + +CREATE_SUBDIRS_LEVEL = 8 + # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII # characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode @@ -81,14 +103,14 @@ ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian, +# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English +# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek, +# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with +# English messages), Korean, Korean-en (Korean with English messages), Latvian, +# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, +# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, +# Swedish, Turkish, Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English @@ -244,7 +266,7 @@ SEPARATE_MEMBER_PAGES = YES # uses this value to replace tabs by spaces in code fragments. # Minimum value: 1, maximum value: 16, default value: 4. -TAB_SIZE = 4 +TAB_SIZE = 8 # This tag can be used to specify a number of aliases that act as commands in # the documentation. An alias has the form: @@ -452,7 +474,7 @@ TYPEDEF_HIDES_STRUCT = NO LOOKUP_CACHE_SIZE = 0 -# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use +# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use # during processing. When set to 0 doxygen will based this on the number of # cores available in the system. You can set it explicitly to a value larger # than 0 to get more control over the balance between CPU load and processing @@ -463,7 +485,7 @@ LOOKUP_CACHE_SIZE = 0 # DOT_NUM_THREADS setting. # Minimum value: 0, maximum value: 32, default value: 1. -NUM_PROC_THREADS = 1 +NUM_PROC_THREADS = 0 #--------------------------------------------------------------------------- # Build related configuration options @@ -577,14 +599,15 @@ INTERNAL_DOCS = NO # filesystem is case sensitive (i.e. it supports files in the same directory # whose names only differ in casing), the option must be set to YES to properly # deal with such files in case they appear in the input. For filesystems that -# are not case sensitive the option should be be set to NO to properly deal with +# are not case sensitive the option should be set to NO to properly deal with # output files written for symbols that only differ in casing, such as for two # classes, one named CLASS and the other named Class, and to also support # references to files without having to specify the exact matching casing. On # Windows (including Cygwin) and MacOS, users should typically set this option # to NO, whereas on Linux or other Unix flavors it should typically be set to # YES. -# The default value is: system dependent. +# Possible values are: SYSTEM, NO and YES. +# The default value is: SYSTEM. CASE_SENSE_NAMES = NO @@ -758,7 +781,7 @@ SHOW_NAMESPACES = YES # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. -FILE_VERSION_FILTER = "/bin/sh -c 'git log --pretty=\"format:%ci, author:%aN <%aE>, commit:%h\" -1 \"${1}\" || echo no git'" +FILE_VERSION_FILTER = git log --pretty='format:%ci, author: %aN <%aE>, commit: %h' -1 # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated @@ -772,7 +795,7 @@ FILE_VERSION_FILTER = "/bin/sh -c 'git log --pretty=\"format:%ci, author:%aN # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = @DOXYDIR@/DoxygenLayout.xml +LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib @@ -834,7 +857,7 @@ WARN_IF_INCOMPLETE_DOC = YES # WARN_IF_INCOMPLETE_DOC # The default value is: NO. -WARN_NO_PARAMDOC = NO +WARN_NO_PARAMDOC = YES # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when # a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS @@ -851,10 +874,21 @@ WARN_AS_ERROR = NO # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) +# See also: WARN_LINE_FORMAT # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" +# In the $text part of the WARN_FORMAT command it is possible that a reference +# to a more specific place is given. To make it easier to jump to this place +# (outside of doxygen) the user can define a custom "cut" / "paste" string. +# Example: +# WARN_LINE_FORMAT = "'vi $file +$line'" +# See also: WARN_FORMAT +# The default value is: at line $line of file $file. + +WARN_LINE_FORMAT = "at line $line of file $file" + # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard # error (stderr). In case the file specified cannot be opened for writing the @@ -874,17 +908,34 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = @SRCDIR@ +INPUT = @SRCDIR@/lib \ + @SRCDIR@/README.md \ + @SRCDIR@/INSTALL.md \ + @SRCDIR@/how_to_no_header.md \ + @SRCDIR@/include \ + @SRCDIR@/test \ + @SRCDIR@/cmp_tool.c # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv # documentation (see: # https://www.gnu.org/software/libiconv/) for the list of possible encodings. +# See also: INPUT_FILE_ENCODING # The default value is: UTF-8. INPUT_ENCODING = UTF-8 +# This tag can be used to specify the character encoding of the source files +# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify +# character encoding on a per file pattern basis. Doxygen will compare the file +# name with each pattern and apply the encoding instead of the default +# INPUT_ENCODING) if there is a match. The character encodings are a list of the +# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding +# "INPUT_ENCODING" for further information on supported encodings. + +INPUT_FILE_ENCODING = + # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and # *.h) to filter out the source-files in the directories. @@ -935,7 +986,7 @@ FILE_PATTERNS = *.c \ *.md \ *.mm \ *.dox \ - *.py \ + ##*.py \ *.pyw \ *.f90 \ *.f95 \ @@ -963,7 +1014,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = @BUILDDIR@ +EXCLUDE = #@BUILDDIR@ # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -990,7 +1041,7 @@ EXCLUDE_PATTERNS = # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* -EXCLUDE_SYMBOLS = +EXCLUDE_SYMBOLS = __attribute__ # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include @@ -1016,7 +1067,7 @@ EXAMPLE_RECURSIVE = NO # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = images #TODO +IMAGE_PATH = img docs/img # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -1033,6 +1084,11 @@ IMAGE_PATH = images #TODO # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. # +# Note that doxygen will use the data processed and written to standard output +# for further processing, therefore nothing else, like debug statements or used +# commands (so in case of a Windows batch file always use @echo OFF), should be +# written to standard output. +# # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. @@ -1072,7 +1128,16 @@ FILTER_SOURCE_PATTERNS = # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = README.md + +# The Fortran standard specifies that for fixed formatted Fortran code all +# characters from position 72 are to be considered as comment. A common +# extension is to allow longer lines before the automatic comment starts. The +# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can +# be processed before the automatic comment starts. +# Minimum value: 7, maximum value: 10000, default value: 72. + +FORTRAN_COMMENT_AFTER = 72 #--------------------------------------------------------------------------- # Configuration options related to source browsing @@ -1231,7 +1296,7 @@ HTML_HEADER = @DOXYDIR@/header.html # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = @DOXYDIR@/footer.html +HTML_FOOTER = # @DOXYDIR@/footer.html # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1256,7 +1321,9 @@ HTML_STYLESHEET = # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = @DOXYDIR@/customdoxygen.css +HTML_EXTRA_STYLESHEET = @DOXYDIR@/doxygen-awesome-css/doxygen-awesome.css \ + @DOXYDIR@/doxygen-awesome-css/doxygen-awesome-sidebar-only.css \ + @DOXYDIR@/doxygen-awesome-css/doxygen-awesome-sidebar-only-darkmode-toggle.css # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -1266,9 +1333,27 @@ HTML_EXTRA_STYLESHEET = @DOXYDIR@/customdoxygen.css # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = @DOXYDIR@/bootstrap.min.css \ - @DOXYDIR@/bootstrap.min.js \ - @DOXYDIR@/doxy-boot.js +HTML_EXTRA_FILES = @DOXYDIR@/doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js \ + @DOXYDIR@/doxygen-awesome-css/doxygen-awesome-fragment-copy-button.js \ + @DOXYDIR@/doxygen-awesome-css/doxygen-awesome-interactive-toc.js + + +# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output +# should be rendered with a dark or light theme. Default setting AUTO_LIGHT +# enables light output unless the user preference is dark output. Other options +# are DARK to always use dark mode, LIGHT to always use light mode, AUTO_DARK to +# default to dark mode unless the user prefers light mode, and TOGGLE to let the +# user toggle between dark and light mode via a button. +# Possible values are: LIGHT Always generate light output., DARK Always generate +# dark output., AUTO_LIGHT Automatically set the mode according to the user +# preference, use light mode if no preference is set (the default)., AUTO_DARK +# Automatically set the mode according to the user preference, use dark mode if +# no preference is set. and TOGGLE Allow to user to switch between light and +# dark mode via a button.. +# The default value is: AUTO_LIGHT. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE = AUTO_DARK # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to @@ -1279,7 +1364,7 @@ HTML_EXTRA_FILES = @DOXYDIR@/bootstrap.min.css \ # Minimum value: 0, maximum value: 359, default value: 220. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_HUE = 209 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors # in the HTML output. For a value of 0 the output will use gray-scales only. A @@ -1287,7 +1372,7 @@ HTML_COLORSTYLE_HUE = 220 # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_COLORSTYLE_SAT = 100 +HTML_COLORSTYLE_SAT = 255 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the # luminance component of the colors in the HTML output. Values below 100 @@ -1298,7 +1383,7 @@ HTML_COLORSTYLE_SAT = 100 # Minimum value: 40, maximum value: 240, default value: 80. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_COLORSTYLE_GAMMA = 80 +HTML_COLORSTYLE_GAMMA = 113 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this @@ -1307,7 +1392,7 @@ HTML_COLORSTYLE_GAMMA = 80 # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_TIMESTAMP = YES +HTML_TIMESTAMP = NO # If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML # documentation will contain a main index with vertical navigation menus that @@ -1551,7 +1636,7 @@ ECLIPSE_DOC_ID = org.doxygen.Project # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -DISABLE_INDEX = YES +DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag @@ -1568,7 +1653,7 @@ DISABLE_INDEX = YES # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -GENERATE_TREEVIEW = NO +GENERATE_TREEVIEW = YES # When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the # FULL_SIDEBAR option determines if the side bar is limited to only the treeview @@ -1580,7 +1665,7 @@ GENERATE_TREEVIEW = NO # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -FULL_SIDEBAR = NO +FULL_SIDEBAR = YES # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. @@ -1597,7 +1682,7 @@ ENUM_VALUES_PER_LINE = 4 # Minimum value: 0, maximum value: 1500, default value: 250. # This tag requires that the tag GENERATE_HTML is set to YES. -TREEVIEW_WIDTH = 250 +TREEVIEW_WIDTH = 300 # If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. @@ -1633,17 +1718,6 @@ HTML_FORMULA_FORMAT = png FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANSPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - # The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands # to create new LaTeX commands to be used in formulas as building blocks. See # the section "Including formulas" for details. @@ -1705,8 +1779,8 @@ MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/ # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example -# for MathJax version 2 (see https://docs.mathjax.org/en/v2.7-latest/tex.html -# #tex-and-latex-extensions): +# for MathJax version 2 (see +# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions): # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # For example for MathJax version 3 (see # http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): @@ -1743,7 +1817,7 @@ MATHJAX_CODEFILE = # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. -SEARCHENGINE = NO +SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be # implemented using a web server instead of a web client using JavaScript. There @@ -2234,10 +2308,11 @@ SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by the -# preprocessor. +# preprocessor. Note that the INCLUDE_PATH is not recursive, so the setting of +# RECURSIVE has no effect here. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = @SRCDIR@/include @BUILDDIR@/include +INCLUDE_PATH = @BUILDDIR@/include # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -2358,26 +2433,38 @@ HAVE_DOT = @HAVE_DOT@ DOT_NUM_THREADS = 0 -# When you want a differently looking font in the dot files that doxygen -# generates you can specify the font name using DOT_FONTNAME. You need to make -# sure dot is able to find the font, which can be done by putting it in a -# standard location or by setting the DOTFONTPATH environment variable or by -# setting DOT_FONTPATH to the directory containing the font. -# The default value is: Helvetica. +# DOT_COMMON_ATTR is common attributes for nodes, edges and labels of +# subgraphs. When you want a differently looking font in the dot files that +# doxygen generates you can specify fontname, fontcolor and fontsize attributes. +# For details please see <a href=https://graphviz.org/doc/info/attrs.html>Node, +# Edge and Graph Attributes specification</a> You need to make sure dot is able +# to find the font, which can be done by putting it in a standard location or by +# setting the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. Default graphviz fontsize is 14. +# The default value is: fontname=Helvetica,fontsize=10. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTNAME = Helvetica +DOT_COMMON_ATTR = "fontname=Helvetica,fontsize=10" -# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of -# dot graphs. -# Minimum value: 4, maximum value: 24, default value: 10. +# DOT_EDGE_ATTR is concatenated with DOT_COMMON_ATTR. For elegant style you can +# add 'arrowhead=open, arrowtail=open, arrowsize=0.5'. <a +# href=https://graphviz.org/doc/info/arrows.html>Complete documentation about +# arrows shapes.</a> +# The default value is: labelfontname=Helvetica,labelfontsize=10. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTSIZE = 10 +DOT_EDGE_ATTR = "labelfontname=Helvetica,labelfontsize=10" -# By default doxygen will tell dot to use the default font as specified with -# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set -# the path where dot can find it using this tag. +# DOT_NODE_ATTR is concatenated with DOT_COMMON_ATTR. For view without boxes +# around nodes set 'shape=plain' or 'shape=plaintext' <a +# href=https://www.graphviz.org/doc/info/shapes.html>Shapes specification</a> +# The default value is: shape=box,height=0.2,width=0.4. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_NODE_ATTR = "shape=box,height=0.2,width=0.4" + +# You can set the path where dot can find font specified with fontname in +# DOT_COMMON_ATTR and others dot attributes. # This tag requires that the tag HAVE_DOT is set to YES. DOT_FONTPATH = @@ -2403,7 +2490,8 @@ CLASS_GRAPH = YES COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for -# groups, showing the direct groups dependencies. +# groups, showing the direct groups dependencies. See also the chapter Grouping +# in the manual. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2619,18 +2707,6 @@ DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not seem -# to support this out of the box. -# -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_TRANSPARENT = YES - # Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) support diff --git a/doc/doxygen/DoxygenLayout.xml b/doc/doxygen/DoxygenLayout.xml deleted file mode 100644 index 7479687ef34ccb9d265a30c64f63b44943fceee6..0000000000000000000000000000000000000000 --- a/doc/doxygen/DoxygenLayout.xml +++ /dev/null @@ -1,194 +0,0 @@ -<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> diff --git a/doc/doxygen/bootstrap.min.css b/doc/doxygen/bootstrap.min.css deleted file mode 100644 index 4cf729e4342a51d8b300e8d43f2f78b0a6faf403..0000000000000000000000000000000000000000 --- a/doc/doxygen/bootstrap.min.css +++ /dev/null @@ -1,6 +0,0 @@ -/*! - * Bootstrap v3.3.6 (http://getbootstrap.com) - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:transparent;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=time].form-control,input[type=datetime-local].form-control,input[type=month].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px\9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{padding-right:15px;padding-left:15px;border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:rgba(0,0,0,0);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} -/*# sourceMappingURL=bootstrap.min.css.map */ \ No newline at end of file diff --git a/doc/doxygen/bootstrap.min.js b/doc/doxygen/bootstrap.min.js deleted file mode 100644 index e79c065134f2cfcf3e44a59cffcb5f090232f98f..0000000000000000000000000000000000000000 --- a/doc/doxygen/bootstrap.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * Bootstrap v3.3.6 (http://getbootstrap.com) - * Copyright 2011-2015 Twitter, Inc. - * Licensed under the MIT license - */ -if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>2)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.6",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.6",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.6",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.6",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",c).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){d.$element.one("mouseup.dismiss.bs.modal",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in"),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+e).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",a,b)};c.VERSION="3.3.6",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-m<o.top?"bottom":"right"==h&&k.right+l>o.width?"left":"left"==h&&k.left-l<o.left?"right":h,f.removeClass(n).addClass(h)}var p=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(p,h);var q=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",q).emulateTransitionEnd(c.TRANSITION_DURATION):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top+=g,b.left+=h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.6",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.6",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active"); -d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.6",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.6",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); \ No newline at end of file diff --git a/doc/doxygen/customdoxygen.css b/doc/doxygen/customdoxygen.css deleted file mode 100644 index 6a32ca7cc14ef237589954afbe62418891459d9e..0000000000000000000000000000000000000000 --- a/doc/doxygen/customdoxygen.css +++ /dev/null @@ -1,306 +0,0 @@ -/* -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; -} - diff --git a/doc/doxygen/doxy-boot.js b/doc/doxygen/doxy-boot.js deleted file mode 100644 index f045d16f2b2aa6bded9165c8ad19f1a04eb3c9da..0000000000000000000000000000000000000000 --- a/doc/doxygen/doxy-boot.js +++ /dev/null @@ -1,121 +0,0 @@ -$( 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()==" ") { - $(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(); - } - }); -}); diff --git a/doc/doxygen/doxygen-awesome-css b/doc/doxygen/doxygen-awesome-css new file mode 160000 index 0000000000000000000000000000000000000000..e829184be56fd0d6212f495b29782ffdd53ae04a --- /dev/null +++ b/doc/doxygen/doxygen-awesome-css @@ -0,0 +1 @@ +Subproject commit e829184be56fd0d6212f495b29782ffdd53ae04a diff --git a/doc/doxygen/footer.html b/doc/doxygen/footer.html deleted file mode 100644 index f2fa20497a366600145ea79809f6250cf08f2704..0000000000000000000000000000000000000000 --- a/doc/doxygen/footer.html +++ /dev/null @@ -1,26 +0,0 @@ -<!-- 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  <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> diff --git a/doc/doxygen/header.html b/doc/doxygen/header.html index d4b85eb86c9df8e6cc1f10c931e7e3626d0e4cf1..a1e867ee80f029a36844feb37e95ab8e40b80799 100644 --- a/doc/doxygen/header.html +++ b/doc/doxygen/header.html @@ -1,47 +1,82 @@ -<!-- HTML header for doxygen 1.8.8--> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <!-- For Mobile Devices --> - <meta name="viewport" content="width=device-width, initial-scale=1"> +<!-- HTML header for doxygen 1.9.5--> +<!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" lang="$langISO"> +<head> +<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="viewport" content="width=device-width, initial-scale=1"/> +<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME--> +<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME--> +<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^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 +$search +$mathjax +$darkmode +<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" /> +$extrastylesheet +</head> +<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--> - <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> - <meta name="generator" content="Doxygen $doxygenversion"/> +<div id="top"><!-- do not remove this div, it is closed by doxygen! --> - <script type="text/javascript" src="jquery.js"></script> - - <!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME--> - <!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME--> - <!--<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>--> - <script type="text/javascript" src="$relpath^dynsections.js"></script> - $treeview - $search - $mathjax - <link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" /> - - <link rel="stylesheet" href="$relpath^bootstrap.min.css"> - - $extrastylesheet - - <script src="$relpath^bootstrap.min.js"></script> - <script type="text/javascript" src="$relpath^doxy-boot.js"></script> - </head> - <body> - - <nav class="navbar navbar-default" role="navigation"> - <div class="container"> - <div class="navbar-header"> - <a class="navbar-brand"> - <img alt="Logo" align="left" style="margin-right: 1em;" src=$projectlogo/> - $projectname $projectnumber</a> - </div> - </div> - </nav> - <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;"> +<!--BEGIN TITLEAREA--> +<div id="titlearea"> +<table cellspacing="0" cellpadding="0"> + <tbody> + <tr id="projectrow"> + <!--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"> $projectnumber</span><!--END PROJECT_NUMBER--> + </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> +<!--END TITLEAREA--> <!-- end header part --> diff --git a/doc/doxygen/meson.build b/doc/doxygen/meson.build index f7facf3ce893be7c518ec203750ea43434a88f51..a375aae8d9543cfe83cb8ca244b4dad67a985a78 100644 --- a/doc/doxygen/meson.build +++ b/doc/doxygen/meson.build @@ -1,12 +1,17 @@ -doc_layout_files = files([ - 'DoxygenLayout.xml', - 'bootstrap.min.css', - 'customdoxygen.css', - 'bootstrap.min.js', - 'doxy-boot.js', +Doxyfile_template = files('Doxyfile.in') + +doc_layout_files = files( '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 @@ -25,7 +30,7 @@ doxygen = find_program('doxygen', required : false) if doxygen.found() doxy_file = configure_file( - input : 'Doxyfile.in', + input : Doxyfile_template, output : 'Doxyfile', configuration : cdata_doc, install : false, @@ -33,10 +38,12 @@ if doxygen.found() custom_target('doc', input : doxy_file, - output : 'html', - depend_files : [doc_layout_files, main, cmplib_sources], + output : 'generated_documentation', + depend_files : [doxy_file, doc_layout_files, main, cmplib_sources], # test files are missing command : [doxygen, '@INPUT@'], build_by_default : false, console : true, ) +else + warning('Documentation disabled without doxygen') endif diff --git a/doc/doxygen/plato-logo-med.png b/doc/doxygen/plato-logo-med.png new file mode 100644 index 0000000000000000000000000000000000000000..a0df95775ce7cf6bb153eec49083664591613e48 Binary files /dev/null and b/doc/doxygen/plato-logo-med.png differ diff --git a/how_to_no_header.md b/how_to_no_header.md index 3d0f8004ca96299be5f19225f66c7065534bd622..5300fc947a9e26027c74a808ef8e5a749e8f749b 100644 --- a/how_to_no_header.md +++ b/how_to_no_header.md @@ -2,7 +2,7 @@ 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 * Create a cfg directory diff --git a/include/byteorder.h b/include/byteorder.h index 42fa9b850bc7faed218e92790ee04d176265b97f..56bb7efb629adabb419829379fdfddb0453bbf32 100644 --- a/include/byteorder.h +++ b/include/byteorder.h @@ -1,6 +1,6 @@ /** * @file byteorder.h - * @author Armin Luntzer (armin.luntzer@univie.ac.at), + * @author Armin Luntzer (armin.luntzer@univie.ac.at) * @date 2015 * * @copyright GPLv2 @@ -13,8 +13,8 @@ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * This is a set of macros for consistent endianess conversion. They work - * for both little and big endian cpus. + * @brief This is a set of macros for consistent endianess conversion. They work + * for both little and big endian cpus. * * conversion of XX-bit integers (16- or 32-) between native CPU format * and little/big endian format: @@ -39,7 +39,11 @@ #include <stdint.h> - +#ifndef GCC_VERSION +#define GCC_VERSION (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) +#endif #ifdef __BIG_ENDIAN #undef __BIG_ENDIAN @@ -72,7 +76,7 @@ (((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \ (((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24))) -#define ___constant_swab64(x) ((uint64_t)( \ +#define ___constant_swab64(x) ((uint64_t)( \ (((uint64_t)(x) & (uint64_t)0x00000000000000ffULL) << 56) | \ (((uint64_t)(x) & (uint64_t)0x000000000000ff00ULL) << 40) | \ (((uint64_t)(x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \ diff --git a/include/cmp_data_types.h b/include/cmp_data_types.h index 41a39f7b7464a0704223408429fcec1b8eef0c78..693a953ca5f1305daf5f86f27bde6bce5c5df265 100644 --- a/include/cmp_data_types.h +++ b/include/cmp_data_types.h @@ -1,8 +1,8 @@ /** * @file cmp_data_types.h - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at), + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) * @date 2020 - * @brief definition of the different data types + * @brief definition of the different compression data types * * @copyright GPLv2 * This program is free software; you can redistribute it and/or modify it @@ -14,7 +14,7 @@ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * 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 * * Three data rates (for N-DPU): @@ -26,9 +26,9 @@ * exp_flags = selected exposure flags * fx = normal light flux * ncob = normal center of brightness - * efx = extended flux + * efx = extended light flux * 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 @@ -39,6 +39,10 @@ #include <compiler.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_SATURATED_IMAGETTE_BITS 16 /* TBC */ #define MAX_USED_FC_IMAGETTE_BITS 16 /* TBC */ @@ -82,7 +86,10 @@ #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 { uint8_t version; unsigned int s_exp_flags; @@ -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__ struct multi_entry_hdr { @@ -144,14 +145,23 @@ struct multi_entry_hdr { uint8_t entry[]; } __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) % 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 { - uint8_t exp_flags; /* selected exposure flags (2 flags + 6 spare bits) */ - uint32_t fx; /* normal light flux */ + uint8_t exp_flags; /**< selected exposure flags (2 flags + 6 spare bits) */ + uint32_t fx; /**< normal light flux */ } __attribute__((packed)); +/** + * @brief short cadence normal and extended light flux entry definition + */ + struct s_fx_efx { uint8_t exp_flags; uint32_t fx; @@ -159,6 +169,10 @@ struct s_fx_efx { } __attribute__((packed)); +/** + * @brief short cadence normal light flux, normal center of brightness entry definition + */ + struct s_fx_ncob { uint8_t exp_flags; uint32_t fx; @@ -167,6 +181,10 @@ struct s_fx_ncob { } __attribute__((packed)); +/** + * @brief short cadence normal and extended flux, normal and extended center of brightness entry definition + */ + struct s_fx_efx_ncob_ecob { uint8_t exp_flags; uint32_t fx; @@ -178,17 +196,29 @@ struct s_fx_efx_ncob_ecob { } __attribute__((packed)); +/** + * @brief fast cadence normal light flux entry definition + */ + struct f_fx { uint32_t fx; } __attribute__((packed)); +/** + * @brief fast cadence normal and extended light flux entry definition + */ + struct f_fx_efx { uint32_t fx; uint32_t efx; } __attribute__((packed)); +/** + * @brief fast cadence normal light flux, normal center of brightness entry definition + */ + struct f_fx_ncob { uint32_t fx; uint32_t ncob_x; @@ -196,6 +226,11 @@ struct f_fx_ncob { } __attribute__((packed)); +/** + * @brief fast cadence normal and extended flux, normal and extended center of + * brightness entry definition + */ + struct f_fx_efx_ncob_ecob { uint32_t fx; uint32_t ncob_x; @@ -206,6 +241,10 @@ struct f_fx_efx_ncob_ecob { } __attribute__((packed)); +/** + * @brief long cadence normal light flux entry definition + */ + __extension__ struct l_fx { uint32_t exp_flags:24; /* selected exposure flags (24 flags) */ @@ -214,6 +253,10 @@ struct l_fx { } __attribute__((packed)); +/** + * @brief long cadence normal and extended light flux entry definition + */ + __extension__ struct l_fx_efx { uint32_t exp_flags:24; /* selected exposure flags (24 flags) */ @@ -223,6 +266,10 @@ struct l_fx_efx { } __attribute__((packed)); +/** + * @brief long cadence normal light flux, normal center of brightness entry definition + */ + __extension__ struct l_fx_ncob { uint32_t exp_flags:24; /* selected exposure flags (24 flags) */ @@ -235,6 +282,11 @@ struct l_fx_ncob { } __attribute__((packed)); +/** + * @brief long cadence normal and extended flux, normal and extended center of + * brightness entry definition + */ + __extension__ struct l_fx_efx_ncob_ecob { uint32_t exp_flags:24; /* selected exposure flags (24 flags) */ @@ -250,12 +302,20 @@ struct l_fx_efx_ncob_ecob { } __attribute__((packed)); +/** + * @brief normal offset entry definition + */ + struct nc_offset { uint32_t mean; uint32_t variance; } __attribute__((packed)); +/** + * @brief normal background entry definition + */ + struct nc_background { uint32_t mean; uint32_t variance; @@ -263,6 +323,10 @@ struct nc_background { } __attribute__((packed)); +/** + * @brief smearing entry definition + */ + struct smearing { uint32_t mean; uint16_t variance_mean; @@ -270,9 +334,18 @@ struct smearing { } __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); -unsigned int cmp_cal_size_of_data(unsigned int samples, enum cmp_data_type data_type); -int cmp_input_size_to_samples(unsigned int size, enum cmp_data_type data_type); +uint32_t cmp_cal_size_of_data(uint32_t samples, 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, enum cmp_data_type data_type); diff --git a/include/cmp_debug.h b/include/cmp_debug.h index defc4e37da7d10a834cbe471fddff97cad498b8c..475c5a72a763c4240057292d2029b68f2bb8e54d 100644 --- a/include/cmp_debug.h +++ b/include/cmp_debug.h @@ -1,6 +1,6 @@ /** * @file cmp_debug.h - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at), + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) * @date 2020 * * @copyright GPLv2 diff --git a/include/cmp_entity.h b/include/cmp_entity.h index c56cef5dd37705ac618266443e0a329f01175308..dd1fa94d908c42365fd495cc478199c3a4487e27 100644 --- a/include/cmp_entity.h +++ b/include/cmp_entity.h @@ -1,7 +1,7 @@ /** * @file cmp_entity.h - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at), - * @date Mai, 2021 + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) + * @date May, 2021 * * @copyright GPLv2 * This program is free software; you can redistribute it and/or modify it @@ -19,8 +19,8 @@ * @note this code can also used on a little endian machine * * @warning: If you create an entity of one data product type and use get/set - * functions intended for another data product type, it will result in a - * corrupted entity. Do not do this. + * functions intended for another data product type, it will result in a + * corrupted entity or garbage data. Do not do this. */ @@ -51,73 +51,93 @@ #define CMP_TOOL_VERSION_ID_BIT 0x80000000U + +/** + * @brief PALTO CUC timestamp format + */ + __extension__ struct timestamp_cmp_ent { uint32_t coarse; uint16_t fine; } __attribute__((packed)); + +/** + * @brief imagette specific part of compression entity + */ + __extension__ struct imagette_header { - uint16_t spill_used; /* Spillover threshold used */ - uint8_t golomb_par_used; /* Golomb parameter used */ + uint16_t spill_used; /**< Spillover threshold used */ + uint8_t golomb_par_used; /**< Golomb parameter used */ union{ struct { uint8_t spare1; - uint8_t ima_cmp_dat[]; /* compressed data for imagette specific header */ + uint8_t ima_cmp_dat[]; /**< compressed data for imagette specific header */ } __attribute__((packed)); struct { - uint16_t ap1_spill_used; /* Adaptive Spillover threshold used 1 */ - uint8_t ap1_golomb_par_used; /* Adaptive Golomb parameter used 1 */ - uint16_t ap2_spill_used; /* Adaptive Spillover threshold used 2 */ - uint8_t ap2_golomb_par_used; /* Adaptive Golomb parameter used 2 */ + uint16_t ap1_spill_used; /**< Adaptive Spillover threshold used 1 */ + uint8_t ap1_golomb_par_used; /**< Adaptive Golomb parameter used 1 */ + uint16_t ap2_spill_used; /**< Adaptive Spillover threshold used 2 */ + uint8_t ap2_golomb_par_used; /**< Adaptive Golomb parameter used 2 */ uint8_t spare2; uint16_t spare3; - uint8_t ap_ima_cmp_data[]; /* compressed data for adaptive imagette specific header */ + uint8_t ap_ima_cmp_data[]; /**< compressed data for adaptive imagette specific header */ } __attribute__((packed)); }; } __attribute__((packed)); compile_time_assert(sizeof(struct imagette_header) == SPECIFIC_IMAGETTE_ADAPTIVE_HEADER_SIZE, AP_IMAGETTE_HEADER_T_SIZE_IS_NOT_CORRECT); + +/** + * @brief non-imagette specific part of compression entity + */ + __extension__ struct non_imagette_header { - uint32_t spill_1_used:24; /* spillover threshold 1 used */ - uint16_t cmp_par_1_used; /* compression parameter 1 used */ - uint32_t spill_2_used:24; /* spillover threshold 2 used */ - uint16_t cmp_par_2_used; /* compression parameter 2 used */ - uint32_t spill_3_used:24; /* spillover threshold 3 used */ - uint16_t cmp_par_3_used; /* compression parameter 3 used */ - uint32_t spill_4_used:24; /* spillover threshold 4 used */ - uint16_t cmp_par_4_used; /* compression parameter 4 used */ - uint32_t spill_5_used:24; /* spillover threshold 5 used */ - uint16_t cmp_par_5_used; /* compression parameter 5 used */ - uint32_t spill_6_used:24; /* spillover threshold 6 used */ - uint16_t cmp_par_6_used; /* compression parameter 6 used */ + uint32_t spill_1_used:24; /**< spillover threshold 1 used */ + uint16_t cmp_par_1_used; /**< compression parameter 1 used */ + uint32_t spill_2_used:24; /**< spillover threshold 2 used */ + uint16_t cmp_par_2_used; /**< compression parameter 2 used */ + uint32_t spill_3_used:24; /**< spillover threshold 3 used */ + uint16_t cmp_par_3_used; /**< compression parameter 3 used */ + uint32_t spill_4_used:24; /**< spillover threshold 4 used */ + uint16_t cmp_par_4_used; /**< compression parameter 4 used */ + uint32_t spill_5_used:24; /**< spillover threshold 5 used */ + uint16_t cmp_par_5_used; /**< compression parameter 5 used */ + uint32_t spill_6_used:24; /**< spillover threshold 6 used */ + uint16_t cmp_par_6_used; /**< compression parameter 6 used */ uint16_t spare; uint8_t cmp_data[]; } __attribute__((packed)); compile_time_assert(sizeof(struct non_imagette_header) == SPECIFIC_NON_IMAGETTE_HEADER_SIZE, NON_IMAGETTE_HEADER_T_SIZE_IS_NOT_CORRECT); + +/** + * @brief definition of the compression entity format + */ + __extension__ struct cmp_entity { - uint32_t version_id; /* ICU ASW/cmp_tool Version ID */ - uint32_t cmp_ent_size:24; /* Compression Entity Size */ - uint32_t original_size:24; /* Original Data Size */ + uint32_t version_id; /**< ICU ASW/cmp_tool Version ID */ + uint32_t cmp_ent_size:24; /**< Compression Entity Size */ + uint32_t original_size:24; /**< Original Data Size */ union { - uint64_t start_timestamp:48; /* Compression Start Timestamp */ + uint64_t start_timestamp:48; /**< Compression Start Timestamp */ struct timestamp_cmp_ent start_time; } __attribute__((packed)); union { - uint64_t end_timestamp:48; /* Compression End Timestamp */ + uint64_t end_timestamp:48; /**< Compression End Timestamp */ struct timestamp_cmp_ent end_time; } __attribute__((packed)); - uint16_t data_type; /* Data Product Type */ - uint8_t cmp_mode_used; /* used Compression Mode */ - uint8_t model_value_used; /* used Model Updating Weighing Value */ - uint16_t model_id; /* Model ID */ - uint8_t model_counter; /* Model Counter */ + uint16_t data_type; /**< Data Product Type */ + uint8_t cmp_mode_used; /**< used Compression Mode */ + uint8_t model_value_used; /**< used Model Updating Weighing Value */ + uint16_t model_id; /**< Model ID */ + uint8_t model_counter; /**< Model Counter */ uint8_t max_used_bits_version; - uint16_t lossy_cmp_par_used; /* used Lossy Compression Parameters */ + uint16_t lossy_cmp_par_used; /**< used Lossy Compression Parameters */ union { /* specific Compression Entity Header for the different Data Product Types */ struct imagette_header ima; struct non_imagette_header non_ima; @@ -127,7 +147,8 @@ compile_time_assert(sizeof(struct cmp_entity) == NON_IMAGETTE_HEADER_SIZE, CMP_E -/* create a compression entity by setting the size of the compression entity and +/* + * create a compression entity by setting the size of the compression entity and * the data product type in the entity header */ uint32_t cmp_ent_create(struct cmp_entity *ent, enum cmp_data_type data_type, @@ -141,13 +162,15 @@ size_t cmp_ent_build(struct cmp_entity *ent, uint32_t version_id, /* read in a compression entity header */ int cmp_ent_read_header(struct cmp_entity *ent, struct cmp_cfg *cfg); -/* write the compression parameters from a compression configuration into the +/* + * write the compression parameters from a compression configuration into the * compression entity header */ int cmp_ent_write_cmp_pars(struct cmp_entity *ent, const struct cmp_cfg *cfg, int cmp_size_bits); -/* write the parameters from the RDCU decompression information structure in the +/* + * write the parameters from the RDCU decompression information structure in the * compression entity header */ int cmp_ent_write_rdcu_cmp_pars(struct cmp_entity *ent, const struct cmp_info *info, @@ -168,9 +191,9 @@ int cmp_ent_set_end_timestamp(struct cmp_entity *ent, uint64_t end_timestamp); int cmp_ent_set_coarse_end_time(struct cmp_entity *ent, uint32_t coarse_time); int cmp_ent_set_fine_end_time(struct cmp_entity *ent, uint16_t fine_time); -int cmp_ent_set_data_type(struct cmp_entity *ent, - enum cmp_data_type data_type, int raw_mode); -int cmp_ent_set_cmp_mode(struct cmp_entity *ent, uint32_t cmp_mode_used); +int cmp_ent_set_data_type(struct cmp_entity *ent, enum cmp_data_type data_type, + int raw_mode); +int cmp_ent_set_cmp_mode(struct cmp_entity *ent, enum cmp_mode cmp_mode_used); int cmp_ent_set_model_value(struct cmp_entity *ent, uint32_t model_value_used); int cmp_ent_set_model_id(struct cmp_entity *ent, uint32_t model_id); int cmp_ent_set_model_counter(struct cmp_entity *ent, uint32_t model_counter); @@ -178,14 +201,16 @@ int cmp_ent_set_max_used_bits_version(struct cmp_entity *ent, uint8_t max_used_b int cmp_ent_set_lossy_cmp_par(struct cmp_entity *ent, uint32_t lossy_cmp_par_used); -/* set functions for specific entity header for imagette and adaptive imagette +/* + * set functions for specific entity header for imagette and adaptive imagette * data product types */ int cmp_ent_set_ima_spill(struct cmp_entity *ent, uint32_t spill_used); int cmp_ent_set_ima_golomb_par(struct cmp_entity *ent, uint32_t golomb_par_used); -/* set functions for specific entity header for adaptive imagette data product +/* + * set functions for specific entity header for adaptive imagette data product * types */ int cmp_ent_set_ima_ap1_spill(struct cmp_entity *ent, uint32_t ap1_spill_used); @@ -232,7 +257,7 @@ uint16_t cmp_ent_get_fine_end_time(struct cmp_entity *ent); enum cmp_data_type cmp_ent_get_data_type(struct cmp_entity *ent); int cmp_ent_get_data_type_raw_bit(struct cmp_entity *ent); uint8_t cmp_ent_get_cmp_mode(struct cmp_entity *ent); -uint8_t cmp_ent_get_model_value_used(struct cmp_entity *ent); +uint8_t cmp_ent_get_model_value(struct cmp_entity *ent); uint16_t cmp_ent_get_model_id(struct cmp_entity *ent); uint8_t cmp_ent_get_model_counter(struct cmp_entity *ent); @@ -240,14 +265,16 @@ uint8_t cmp_ent_get_max_used_bits_version(struct cmp_entity *ent); uint16_t cmp_ent_get_lossy_cmp_par(struct cmp_entity *ent); -/* get functions for specific entity header for imagette and adaptive imagette +/* + * get functions for specific entity header for imagette and adaptive imagette * data product types */ uint16_t cmp_ent_get_ima_spill(struct cmp_entity *ent); uint8_t cmp_ent_get_ima_golomb_par(struct cmp_entity *ent); -/* get functions for specific entity header for adaptive imagette data product +/* + * get functions for specific entity header for adaptive imagette data product * types */ uint16_t cmp_ent_get_ima_ap1_spill(struct cmp_entity *ent); @@ -280,8 +307,8 @@ uint16_t cmp_ent_get_non_ima_cmp_par6(struct cmp_entity *ent); /* get function for the compressed data buffer in the entity */ void *cmp_ent_get_data_buf(struct cmp_entity *ent); uint32_t cmp_ent_get_cmp_data_size(struct cmp_entity *ent); -ssize_t cmp_ent_get_cmp_data(struct cmp_entity *ent, uint32_t *data_buf, - size_t data_buf_size); +int32_t cmp_ent_get_cmp_data(struct cmp_entity *ent, uint32_t *data_buf, + uint32_t data_buf_size); /* calculate the size of the compression entity header */ uint32_t cmp_ent_cal_hdr_size(enum cmp_data_type data_type, int raw_mode); @@ -291,7 +318,7 @@ uint32_t cmp_ent_cal_hdr_size(enum cmp_data_type data_type, int raw_mode); # if __has_include(<time.h>) # include <time.h> /* create a timestamp for the compression header */ -extern const struct tm EPOCH_DATE; +extern const struct tm PLATO_EPOCH_DATE; uint64_t cmp_ent_create_timestamp(const struct timespec *ts); # endif #endif diff --git a/include/cmp_guess.h b/include/cmp_guess.h index 4b26e9cae965aa0aceea4e12fce0cf0549607939..efca334022833735b6c65c4bf96506184474dc17 100644 --- a/include/cmp_guess.h +++ b/include/cmp_guess.h @@ -1,6 +1,6 @@ /** * @file cmp_guess.h - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at), + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) * @date 2020 * * @copyright GPLv2 diff --git a/include/cmp_icu.h b/include/cmp_icu.h index 743e7d1014b93b162f8d216da25435047e97069a..4cba66f3e797fae235b10711752b1ca4870ebd77 100644 --- a/include/cmp_icu.h +++ b/include/cmp_icu.h @@ -1,6 +1,6 @@ /** * @file cmp_icu.h - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at), + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) * @date 2020 * * @copyright GPLv2 diff --git a/include/cmp_io.h b/include/cmp_io.h index 873bf91652f6c03fa049d9db16b6642eca63640c..ec5a77af818683fc4b7d5871e0924a8b86d50983 100644 --- a/include/cmp_io.h +++ b/include/cmp_io.h @@ -1,7 +1,7 @@ /** * @file cmp_io.h + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) * @author Johannes Seelig (johannes.seelig@univie.ac.at) - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at), * @date 2020 * * @copyright GPLv2 @@ -13,6 +13,8 @@ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. + * + * @brief compression tool input/output library header file */ #include <string.h> @@ -28,8 +30,8 @@ void print_help(const char *program_name); -int read_cmp_cfg(const char *file_name, struct cmp_cfg *cfg, int verbose_en); -int read_cmp_info(const char *file_name, struct cmp_info *info, int verbose_en); +int cmp_cfg_read(const char *file_name, struct cmp_cfg *cfg, int verbose_en); +int cmp_info_read(const char *file_name, struct cmp_info *info, int verbose_en); ssize_t read_file8(const char *file_name, uint8_t *buf, uint32_t buf_size, int verbose_en); @@ -46,14 +48,12 @@ int write_cmp_data_file(const void *buf, uint32_t buf_size, const char *output_prefix, const char *name_extension, int verbose); int write_input_data_to_file(void *data, uint32_t data_size, enum cmp_data_type data_type, const char *output_prefix, const char *name_extension, int verbose); -int write_info(const struct cmp_info *info, const char *output_prefix, - int rdcu_cfg); -int write_cfg(const struct cmp_cfg *cfg, const char *output_prefix, int rdcu_cfg, - int verbose); -void print_cfg(const struct cmp_cfg *cfg, int rdcu_cfg); +int cmp_info_to_file(const struct cmp_info *info, const char *output_prefix, int rdcu_cfg); +int cmp_cfg_fo_file(const struct cmp_cfg *cfg, const char *output_prefix, int verbose); +void cmp_cfg_print(const struct cmp_cfg *cfg); int atoui32(const char *dep_str, const char *val_str, uint32_t *red_val); -int cmp_mode_parse(const char *cmp_mode_str, uint32_t *cmp_mode); +int cmp_mode_parse(const char *cmp_mode_str, enum cmp_mode *cmp_mode); enum cmp_data_type string2data_type(const char *data_type_str); const char *data_type2string(enum cmp_data_type data_type); diff --git a/include/cmp_rdcu.h b/include/cmp_rdcu.h index 93da3d06a62f51cac7eee52a4c665d4fdc964b0f..d269db16c62483e6bfbdc16638f7925b0fa0c618 100644 --- a/include/cmp_rdcu.h +++ b/include/cmp_rdcu.h @@ -1,6 +1,6 @@ /** * @file cmp_rdcu.h - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at), + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) * @date 2019 * * @copyright GPLv2 @@ -22,6 +22,7 @@ #define _CMP_RDCU_H_ #include <cmp_support.h> +#include <cmp_rdcu_cfg.h> /* Compression Error Register bits definition, see RDCU-FRS-FN-0952 */ @@ -35,18 +36,6 @@ #define SLAVE_BUSY_ERR_BIT 0x07 /* The bus master has received the "slave busy" status (only HW compression) */ -struct cmp_cfg rdcu_cfg_create(enum cmp_data_type data_type, enum cmp_mode cmp_mode, - uint32_t model_value, uint32_t lossy_par); -int rdcu_cfg_buffers(struct cmp_cfg *cfg, uint16_t *data_to_compress, - uint32_t data_samples, uint16_t *model_of_data, - uint32_t rdcu_data_adr, uint32_t rdcu_model_adr, - uint32_t rdcu_new_model_adr, uint32_t rdcu_buffer_adr, - uint32_t rdcu_buffer_lenght); -int rdcu_cfg_imagette(struct cmp_cfg *cfg, - uint32_t golomb_par, uint32_t spillover_par, - uint32_t ap1_golomb_par, uint32_t ap1_spillover_par, - uint32_t ap2_golomb_par, uint32_t ap2_spillover_par); - int rdcu_compress_data(const struct cmp_cfg *cfg); int rdcu_read_cmp_status(struct cmp_status *status); @@ -62,6 +51,4 @@ int rdcu_interrupt_compression(void); void rdcu_enable_interrput_signal(void); void rdcu_disable_interrput_signal(void); -int rdcu_cmp_cfg_is_invalid(const struct cmp_cfg *cfg); - #endif /* _CMP_RDCU_H_ */ diff --git a/include/cmp_rdcu_cfg.h b/include/cmp_rdcu_cfg.h new file mode 100644 index 0000000000000000000000000000000000000000..c8ef639971aeb243851912731ea4dab05b579ff4 --- /dev/null +++ b/include/cmp_rdcu_cfg.h @@ -0,0 +1,42 @@ +/** + * @file cmp_rdcu_cfg.h + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) + * @date 2020 + * + * @copyright GPLv2 + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * @brief hardware compressor configuration library + */ + + +#ifndef _CMP_RDCU_CFG_H_ +#define _CMP_RDCU_CFG_H_ + +#include <cmp_support.h> + + +struct cmp_cfg rdcu_cfg_create(enum cmp_data_type data_type, enum cmp_mode cmp_mode, + uint32_t model_value, uint32_t lossy_par); + +int rdcu_cfg_buffers(struct cmp_cfg *cfg, uint16_t *data_to_compress, + uint32_t data_samples, uint16_t *model_of_data, + uint32_t rdcu_data_adr, uint32_t rdcu_model_adr, + uint32_t rdcu_new_model_adr, uint32_t rdcu_buffer_adr, + uint32_t rdcu_buffer_lenght); + +int rdcu_cfg_imagette(struct cmp_cfg *cfg, + uint32_t golomb_par, uint32_t spillover_par, + uint32_t ap1_golomb_par, uint32_t ap1_spillover_par, + uint32_t ap2_golomb_par, uint32_t ap2_spillover_par); + +int rdcu_cmp_cfg_is_invalid(const struct cmp_cfg *cfg); + +#endif /* _CMP_RDCU_CFG_H_ */ diff --git a/include/cmp_rdcu_extended.h b/include/cmp_rdcu_extended.h deleted file mode 100644 index 7ab229b5fd1df7519651916d55f1192cae877788..0000000000000000000000000000000000000000 --- a/include/cmp_rdcu_extended.h +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @file cmp_rdcu_extended.h - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at), - * @date 2021 - * - * @copyright GPLv2 - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - - -#ifndef _CMP_RDCU_EXTENDED_H_ -#define _CMP_RDCU_EXTENDED_H_ - -#include <cmp_rdcu.h> - -int rdcu_start_compression(void); - -int rdcu_set_compression_register(const struct cmp_cfg *cfg); - -int rdcu_compress_data_parallel(const struct cmp_cfg *cfg, - const struct cmp_info *last_info); - -#endif /* _CMP_RDCU_EXTENDED_H_ */ diff --git a/include/cmp_support.h b/include/cmp_support.h index be598aaff62471c10e5aa595a8c3725e48432a74..105a9da9d4e0dc200991b47e085b76d805caaefe 100644 --- a/include/cmp_support.h +++ b/include/cmp_support.h @@ -1,6 +1,6 @@ /** * @file cmp_support.h - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at), + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) * @date 2018 * * @copyright GPLv2 @@ -34,9 +34,8 @@ #define CMP_LOSSLESS 0 #define CMP_PAR_UNUNSED 0 - -#define MAX_MODEL_VALUE \ - 16U /* the maximal model values used in the update equation for the new model */ +/* the maximal model values used in the update equation for the new model */ +#define MAX_MODEL_VALUE 16U /* valid compression parameter ranges for RDCU/ICU imagette compression according to PLATO-UVIE-PL-UM-0001 */ #define MAX_RDCU_CMP_MODE 4U @@ -46,10 +45,10 @@ #define MAX_RDCU_ROUND 2U /* for maximum spill value look at cmp_rdcu_max_spill function */ -/* valid compression parameter ranges for ICU compression */ -#define MIN_ICU_GOLOMB_PAR 1U -#define MAX_ICU_GOLOMB_PAR UINT16_MAX /* the compression entity dos not allow larger values */ -#define MIN_ICU_SPILL 2U +/* valid compression parameter ranges for ICU non-imagette compression */ +#define MIN_NON_IMA_GOLOMB_PAR 1U +#define MAX_NON_IMA_GOLOMB_PAR UINT16_MAX /* the compression entity dos not allow larger values */ +#define MIN_NON_IMA_SPILL 2U /* for maximum spill value look at cmp_icu_max_spill function */ #define MAX_ICU_ROUND 3U #define MAX_STUFF_CMP_PAR 32U @@ -91,10 +90,18 @@ #define CMP_DEF_IMA_DIFF_RDCU_UP_MODEL_ADR 0x000000 /* not needed for 1d-differencing cmp_mode */ #define CMP_DEF_IMA_DIFF_RDCU_BUFFER_ADR 0x600000 -enum {ICU_CHECK, RDCU_CHECK}; /* option for the cmp_cfg_imagette_is_invalid() function */ + +/** + * @brief options for configuration check functions + */ + +enum check_opt {ICU_CHECK, RDCU_CHECK}; -/* defined compression data product types */ +/** + * @brief defined compression data product types + */ + enum cmp_data_type { DATA_TYPE_UNKNOWN, DATA_TYPE_IMAGETTE, @@ -123,7 +130,10 @@ enum cmp_data_type { }; -/* defined compression mode */ +/** + * @brief defined compression mode + */ + enum cmp_mode { CMP_MODE_RAW, CMP_MODE_MODEL_ZERO, @@ -136,90 +146,93 @@ enum cmp_mode { /** * @brief The cmp_cfg structure can contain the complete configuration of the HW as - * well as the SW compressor. + * well as the SW compressor. * @note the icu_output_buf will not be used for HW compression * @note the rdcu_***_adr parameters are ignored for SW compression */ struct cmp_cfg { - void *input_buf; /* Pointer to the data to compress buffer */ - void *model_buf; /* Pointer to the model buffer */ - void *icu_new_model_buf; /* Pointer to the updated model buffer (not used for RDCU compression )*/ - uint32_t *icu_output_buf; /* Pointer to the compressed data buffer (not used for RDCU compression) */ - uint32_t samples; /* Number of samples to compress, length of the data and model buffer + void *input_buf; /**< Pointer to the data to compress buffer */ + void *model_buf; /**< Pointer to the model buffer */ + void *icu_new_model_buf; /**< Pointer to the updated model buffer (not used for RDCU compression )*/ + uint32_t *icu_output_buf; /**< Pointer to the compressed data buffer (not used for RDCU compression) */ + uint32_t samples; /**< Number of samples to compress, length of the data and model buffer * (including the multi entity header by non-imagette data) */ - uint32_t buffer_length; /* Length of the compressed data buffer in number of samples */ - uint32_t rdcu_data_adr; /* RDCU data to compress start address, the first data address in the RDCU SRAM; HW only */ - uint32_t rdcu_model_adr; /* RDCU model start address, the first model address in the RDCU SRAM */ - uint32_t rdcu_new_model_adr;/* RDCU updated model start address, the address in the RDCU SRAM where the updated model is stored */ - uint32_t rdcu_buffer_adr; /* RDCU compressed data start address, the first output data address in the RDCU SRAM */ - enum cmp_data_type data_type; /* Compression Data Product Types */ - enum cmp_mode cmp_mode; /* 0: raw mode + uint32_t buffer_length; /**< Length of the compressed data buffer in number of samples */ + uint32_t rdcu_data_adr; /**< RDCU data to compress start address, the first data address in the RDCU SRAM; HW only */ + uint32_t rdcu_model_adr; /**< RDCU model start address, the first model address in the RDCU SRAM */ + uint32_t rdcu_new_model_adr;/**< RDCU updated model start address, the address in the RDCU SRAM where the updated model is stored */ + uint32_t rdcu_buffer_adr; /**< RDCU compressed data start address, the first output data address in the RDCU SRAM */ + enum cmp_data_type data_type; /**< Compression Data Product Types */ + enum cmp_mode cmp_mode; /**< 0: raw mode * 1: model mode with zero escape symbol mechanism * 2: 1d differencing mode without input model with zero escape symbol mechanism * 3: model mode with multi escape symbol mechanism * 4: 1d differencing mode without input model multi escape symbol mechanism */ - uint32_t model_value; /* Model weighting parameter */ - uint32_t round; /* lossy compression parameter */ - uint32_t golomb_par; /* Golomb parameter for imagette data compression */ - uint32_t spill; /* Spillover threshold parameter for imagette compression */ - uint32_t ap1_golomb_par; /* Adaptive 1 spillover threshold for imagette data; HW only */ - uint32_t ap1_spill; /* Adaptive 1 Golomb parameter for imagette data; HW only */ - uint32_t ap2_golomb_par; /* Adaptive 2 spillover threshold for imagette data; HW only */ - uint32_t ap2_spill; /* Adaptive 2 Golomb parameter; HW only */ - uint32_t cmp_par_exp_flags; /* Compression parameter for exposure flags compression */ - uint32_t spill_exp_flags; /* Spillover threshold parameter for exposure flags compression */ - uint32_t cmp_par_fx; /* Compression parameter for normal flux compression */ - uint32_t spill_fx; /* Spillover threshold parameter for normal flux compression */ - uint32_t cmp_par_ncob; /* Compression parameter for normal center of brightness compression */ - uint32_t spill_ncob; /* Spillover threshold parameter for normal center of brightness compression */ - uint32_t cmp_par_efx; /* Compression parameter for extended flux compression */ - uint32_t spill_efx; /* Spillover threshold parameter for extended flux compression */ - uint32_t cmp_par_ecob; /* Compression parameter for executed center of brightness compression */ - uint32_t spill_ecob; /* Spillover threshold parameter for executed center of brightness compression */ - uint32_t cmp_par_fx_cob_variance; /* Compression parameter for flux/COB variance compression */ - uint32_t spill_fx_cob_variance; /* Spillover threshold parameter for flux/COB variance compression */ - uint32_t cmp_par_mean; /* Compression parameter for auxiliary science mean compression */ - uint32_t spill_mean; /* Spillover threshold parameter for auxiliary science mean compression */ - uint32_t cmp_par_variance; /* Compression parameter for auxiliary science variance compression */ - uint32_t spill_variance; /* Spillover threshold parameter for auxiliary science variance compression */ - uint32_t cmp_par_pixels_error; /* Compression parameter for auxiliary science outlier pixels number compression */ - uint32_t spill_pixels_error; /* Spillover threshold parameter for auxiliary science outlier pixels number compression */ + uint32_t model_value; /**< Model weighting parameter */ + uint32_t round; /**< lossy compression parameter */ + uint32_t golomb_par; /**< Golomb parameter for imagette data compression */ + uint32_t spill; /**< Spillover threshold parameter for imagette compression */ + uint32_t ap1_golomb_par; /**< Adaptive 1 spillover threshold for imagette data; HW only */ + uint32_t ap1_spill; /**< Adaptive 1 Golomb parameter for imagette data; HW only */ + uint32_t ap2_golomb_par; /**< Adaptive 2 spillover threshold for imagette data; HW only */ + uint32_t ap2_spill; /**< Adaptive 2 Golomb parameter; HW only */ + uint32_t cmp_par_exp_flags; /**< Compression parameter for exposure flags compression */ + uint32_t spill_exp_flags; /**< Spillover threshold parameter for exposure flags compression */ + uint32_t cmp_par_fx; /**< Compression parameter for normal flux compression */ + uint32_t spill_fx; /**< Spillover threshold parameter for normal flux compression */ + uint32_t cmp_par_ncob; /**< Compression parameter for normal center of brightness compression */ + uint32_t spill_ncob; /**< Spillover threshold parameter for normal center of brightness compression */ + uint32_t cmp_par_efx; /**< Compression parameter for extended flux compression */ + uint32_t spill_efx; /**< Spillover threshold parameter for extended flux compression */ + uint32_t cmp_par_ecob; /**< Compression parameter for executed center of brightness compression */ + uint32_t spill_ecob; /**< Spillover threshold parameter for executed center of brightness compression */ + uint32_t cmp_par_fx_cob_variance; /**< Compression parameter for flux/COB variance compression */ + uint32_t spill_fx_cob_variance; /**< Spillover threshold parameter for flux/COB variance compression */ + uint32_t cmp_par_mean; /**< Compression parameter for auxiliary science mean compression */ + uint32_t spill_mean; /**< Spillover threshold parameter for auxiliary science mean compression */ + uint32_t cmp_par_variance; /**< Compression parameter for auxiliary science variance compression */ + uint32_t spill_variance; /**< Spillover threshold parameter for auxiliary science variance compression */ + uint32_t cmp_par_pixels_error; /**< Compression parameter for auxiliary science outlier pixels number compression */ + uint32_t spill_pixels_error; /**< Spillover threshold parameter for auxiliary science outlier pixels number compression */ }; -/* The cmp_status structure can contain the information of the compressor status - * register from the RDCU, see RDCU-FRS-FN-0632. +/** + * @brief The cmp_status structure can contain the information of the compressor + * status register from the RDCU + * @see RDCU-FRS-FN-0632 */ struct cmp_status { - uint8_t cmp_ready; /* Data Compressor Ready; 0: Compressor is busy 1: Compressor is ready */ - uint8_t cmp_active; /* Data Compressor Active; 0: Compressor is on hold; 1: Compressor is active */ - uint8_t data_valid; /* Compressor Data Valid; 0: Data is invalid; 1: Data is valid */ - uint8_t cmp_interrupted; /* Data Compressor Interrupted; HW only; 0: No compressor interruption; 1: Compressor was interrupted */ - uint8_t rdcu_interrupt_en; /* RDCU Interrupt Enable; HW only; 0: Interrupt is disabled; 1: Interrupt is enabled */ + uint8_t cmp_ready; /**< Data Compressor Ready; 0: Compressor is busy 1: Compressor is ready */ + uint8_t cmp_active; /**< Data Compressor Active; 0: Compressor is on hold; 1: Compressor is active */ + uint8_t data_valid; /**< Compressor Data Valid; 0: Data is invalid; 1: Data is valid */ + uint8_t cmp_interrupted; /**< Data Compressor Interrupted; HW only; 0: No compressor interruption; 1: Compressor was interrupted */ + uint8_t rdcu_interrupt_en; /**< RDCU Interrupt Enable; HW only; 0: Interrupt is disabled; 1: Interrupt is enabled */ }; -/* The cmp_info structure can contain the information and metadata of an - * executed RDCU compression. +/** + * @brief The cmp_info structure contain the information and metadata of an + * executed RDCU compression. */ struct cmp_info { - uint32_t cmp_mode_used; /* Compression mode used */ - uint32_t spill_used; /* Spillover threshold used */ - uint32_t golomb_par_used; /* Golomb parameter used */ - uint32_t samples_used; /* Number of samples (16 bit value) to be stored */ - uint32_t cmp_size; /* Compressed data size; measured in bits */ - uint32_t ap1_cmp_size; /* Adaptive compressed data size 1; measured in bits */ - uint32_t ap2_cmp_size; /* Adaptive compressed data size 2; measured in bits */ - uint32_t rdcu_new_model_adr_used; /* Updated model start address used */ - uint32_t rdcu_cmp_adr_used; /* Compressed data start address */ - uint8_t model_value_used; /* Model weighting parameter used */ - uint8_t round_used; /* Number of noise bits to be rounded used */ - uint16_t cmp_err; /* Compressor errors + uint32_t cmp_mode_used; /**< Compression mode used */ + uint32_t spill_used; /**< Spillover threshold used */ + uint32_t golomb_par_used; /**< Golomb parameter used */ + uint32_t samples_used; /**< Number of samples (16 bit value) to be stored */ + uint32_t cmp_size; /**< Compressed data size; measured in bits */ + uint32_t ap1_cmp_size; /**< Adaptive compressed data size 1; measured in bits */ + uint32_t ap2_cmp_size; /**< Adaptive compressed data size 2; measured in bits */ + uint32_t rdcu_new_model_adr_used; /**< Updated model start address used */ + uint32_t rdcu_cmp_adr_used; /**< Compressed data start address */ + uint8_t model_value_used; /**< Model weighting parameter used */ + uint8_t round_used; /**< Number of noise bits to be rounded used */ + uint16_t cmp_err; /**< Compressor errors * [bit 0] small_buffer_err; The length for the compressed data buffer is too small * [bit 1] cmp_mode_err; The cmp_mode parameter is not set correctly * [bit 2] model_value_err; The model_value parameter is not set correctly @@ -234,30 +247,45 @@ struct cmp_info { }; +/** + * @brief structure containing flux/COB compression parameters pairs for the + * cmp_cfg_fx_cob_get_need_pars() function + */ + +struct fx_cob_par { + uint8_t exp_flags; + uint8_t fx; + uint8_t ncob; + uint8_t efx; + uint8_t ecob; + uint8_t fx_cob_variance; +}; + + int is_a_pow_of_2(unsigned int v); int ilog_2(uint32_t x); unsigned int cmp_bit_to_4byte(unsigned int cmp_size_bit); -int cmp_cfg_is_invalid(const struct cmp_cfg *cfg); -int cmp_cfg_icu_gen_par_is_invalid(const struct cmp_cfg *cfg); +int cmp_cfg_icu_is_invalid(const struct cmp_cfg *cfg); +int cmp_cfg_gen_par_is_invalid(const struct cmp_cfg *cfg, enum check_opt opt); int cmp_cfg_icu_buffers_is_invalid(const struct cmp_cfg *cfg); -int cmp_cfg_imagette_is_invalid(const struct cmp_cfg *cfg, int rdcu_check); +int cmp_cfg_imagette_is_invalid(const struct cmp_cfg *cfg, enum check_opt opt); int cmp_cfg_fx_cob_is_invalid(const struct cmp_cfg *cfg); int cmp_cfg_aux_is_invalid(const struct cmp_cfg *cfg); uint32_t cmp_ima_max_spill(unsigned int golomb_par); uint32_t cmp_icu_max_spill(unsigned int cmp_par); -int cmp_data_type_valid(enum cmp_data_type data_type); +int cmp_data_type_is_invalid(enum cmp_data_type data_type); int rdcu_supported_data_type_is_used(enum cmp_data_type data_type); int cmp_imagette_data_type_is_used(enum cmp_data_type data_type); int cmp_ap_imagette_data_type_is_used(enum cmp_data_type data_type); int cmp_fx_cob_data_type_is_used(enum cmp_data_type data_type); +int cmp_cfg_fx_cob_get_need_pars(enum cmp_data_type data_type, struct fx_cob_par *par); int cmp_aux_data_type_is_used(enum cmp_data_type data_type); int cmp_mode_is_supported(enum cmp_mode cmp_mode); int model_mode_is_used(enum cmp_mode cmp_mode); -int diff_mode_is_used(enum cmp_mode cmp_mode); int raw_mode_is_used(enum cmp_mode cmp_mode); int rdcu_supported_cmp_mode_is_used(enum cmp_mode cmp_mode); int zero_escape_mech_is_used(enum cmp_mode cmp_mode); @@ -269,7 +297,6 @@ unsigned int cmp_up_model(unsigned int data, unsigned int model, unsigned int model_value, unsigned int round); -void print_cmp_cfg(const struct cmp_cfg *cfg); void print_cmp_info(const struct cmp_info *info); #endif /* CMP_SUPPORT_H */ diff --git a/include/compiler.h b/include/compiler.h index 7bf73afa39daf2f0de032d92479217142f525715..006170035f692eeb5bc6ddc0f1f0f506850bc25c 100644 --- a/include/compiler.h +++ b/include/compiler.h @@ -1,6 +1,6 @@ /** * @file compiler.h - * @author Armin Luntzer (armin.luntzer@univie.ac.at), + * @author Armin Luntzer (armin.luntzer@univie.ac.at) * @date 2015 * * @copyright GPLv2 diff --git a/include/decmp.h b/include/decmp.h index 826eb89804f8d5388e9aee8a77b05f405da6ae7c..c09da34a72f1d1e3001c7ffce786ff4cd57bc8b8 100644 --- a/include/decmp.h +++ b/include/decmp.h @@ -1,6 +1,6 @@ /** * @file decmp.h - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at), + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) * @date 2020 * * @copyright GPLv2 diff --git a/include/my_inttypes.h b/include/my_inttypes.h new file mode 100644 index 0000000000000000000000000000000000000000..3d7f91151b67dd594f79df354a22763d1e3b722f --- /dev/null +++ b/include/my_inttypes.h @@ -0,0 +1,55 @@ +/** + * @file my_inttypes.h + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) + * @date 2021 + * + * @copyright GPLv2 + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * @brief This is a simple inttypes.h implementation for the sparc platform, + * since the sparc-elf-gcc toolchain does not provide one. + * @warning Does not fully implement the standard. + */ + + +#ifndef _MY_INTTYPES_H +#define _MY_INTTYPES_H + +#ifndef __sparc__ +# include <inttypes.h> +#else + +#ifndef PRId32 +# define PRId32 "ld" +#endif /*PRId32*/ + +#ifndef PRIi32 +# define PRIi32 "li" +#endif /*PRIi32*/ + +#ifndef PRIo32 +# define PRIo32 "lo" +#endif /*PRIo32*/ + +#ifndef PRIu32 +# define PRIu32 "lu" +#endif /* PRIu32 */ + +#ifndef PRIx32 +# define PRIx32 "lx" +#endif /*PRIx32*/ + +#ifndef PRIX32 +# define PRIX32 "lX" +#endif /*PRIX32*/ + +#endif /* __sparc__ */ + +#endif /* _MY_INTTYPES_H */ diff --git a/include/rdcu_cmd.h b/include/rdcu_cmd.h index 0e4b8f411a0724a4ced61fe7e5a8e83f107aa9be..d1244727f5e76cf006af9a532448baf479a0e76e 100644 --- a/include/rdcu_cmd.h +++ b/include/rdcu_cmd.h @@ -1,6 +1,6 @@ /** * @file rdcu_cmd.h - * @author Armin Luntzer (armin.luntzer@univie.ac.at), + * @author Armin Luntzer (armin.luntzer@univie.ac.at) * @date 2018 * * @copyright GPLv2 @@ -13,6 +13,7 @@ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * + * @brief RMAP RDCU RMAP command library header file * @see FPGA Requirement Specification PLATO-IWF-PL-RS-005 Issue 0.6 */ #ifndef _RDCU_CMD_H_ diff --git a/include/rdcu_ctrl.h b/include/rdcu_ctrl.h index ac3f03f9b0788e3f63977b017beaf946c803378c..6b73f4bc9f4dc3a205cc1a7fdc5a665804135626 100644 --- a/include/rdcu_ctrl.h +++ b/include/rdcu_ctrl.h @@ -1,6 +1,6 @@ /** * @file rdcu_ctrl.h - * @author Armin Luntzer (armin.luntzer@univie.ac.at), + * @author Armin Luntzer (armin.luntzer@univie.ac.at) * @date 2018 * * @copyright GPLv2 @@ -13,14 +13,21 @@ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * + * @brief RMAP RDCU control library header file * @see FPGA Requirement Specification PLATO-IWF-PL-RS-005 Issue 0.6 */ + + #ifndef _RDCU_CTRL_H_ #define _RDCU_CTRL_H_ #include <stdint.h> +/** + * @brief local mirror of the RDCU registers + */ + struct rdcu_mirror { /* RDCU registers */ uint32_t fpga_version; /* RDCU-FRS-FN-0522 */ diff --git a/include/rdcu_pkt_to_file.h b/include/rdcu_pkt_to_file.h index b0f055880bcfbe25ccdc76aa0eb5c29507553516..a5364401ab73ce5b6b9d71036c580990f701ee5e 100644 --- a/include/rdcu_pkt_to_file.h +++ b/include/rdcu_pkt_to_file.h @@ -1,6 +1,6 @@ /** * @file rdcu_pkt_to_file.h - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at), + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) * @date 2020 * * @copyright GPLv2 @@ -13,6 +13,7 @@ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * + * @brief RDCU packets to file library header file */ #ifndef _RDCU_PKT_TO_FILE_H_ diff --git a/include/rdcu_rmap.h b/include/rdcu_rmap.h index b6ce5689137c7992d5ad07d77669595d52b8b992..b0cdc84fd1692d3d179563e9ccf03095db35b4de 100644 --- a/include/rdcu_rmap.h +++ b/include/rdcu_rmap.h @@ -1,6 +1,6 @@ /** * @file rdcu_rmap.h - * @author Armin Luntzer (armin.luntzer@univie.ac.at), + * @author Armin Luntzer (armin.luntzer@univie.ac.at) * @date 2018 * * @copyright GPLv2 @@ -13,6 +13,7 @@ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * + * @brief RMAP RDCU link interface header file */ #ifndef _RDCU_RMAP_H_ diff --git a/include/rmap.h b/include/rmap.h index c5815750e7f5e99eb219ea0efe391ce0e92fd1a0..3752dbada946d70462586fa04322adce06471f07 100644 --- a/include/rmap.h +++ b/include/rmap.h @@ -1,6 +1,6 @@ /** * @file rmap.h - * @author Armin Luntzer (armin.luntzer@univie.ac.at), + * @author Armin Luntzer (armin.luntzer@univie.ac.at) * @date 2018 * * @copyright GPLv2 @@ -134,6 +134,9 @@ #define RMAP_MAX_DATA_LEN 0xFFFFFFUL +/** + * @brief RMAP header instruction field definition + */ __extension__ struct rmap_instruction { @@ -156,32 +159,32 @@ compile_time_assert(sizeof(struct rmap_instruction) == sizeof(uint8_t), RMAP_INS /** - * This structure holds the relevant contents of an RMAP packet. + * @brief This structure holds the relevant contents of an RMAP packet. * * @note this is NOT an actual RMAP packet! */ __extension__ struct rmap_pkt { - uint8_t *path; /* path to SpW target */ - uint8_t path_len; /* entries in the path */ - uint8_t dst; /* target logical address */ - uint8_t proto_id; /* protoco id (0x1 = RMAP */ + uint8_t *path; /**< path to SpW target */ + uint8_t path_len; /**< entries in the path */ + uint8_t dst; /**< target logical address */ + uint8_t proto_id; /**< protocol id (0x1 = RMAP */ union { struct rmap_instruction ri; uint8_t instruction; }; union { - uint8_t key; /* command authorisation key */ - uint8_t status; /* reply error/status codes */ + uint8_t key; /**< command authorisation key */ + uint8_t status; /**< reply error/status codes */ }; - uint8_t src; /* initiator logical address */ - uint8_t *rpath; /* reply path */ - uint8_t rpath_len; /* entries in the reply path */ - uint16_t tr_id; /* transaction identifier */ - uint32_t addr; /* (first) data address */ + uint8_t src; /**< initiator logical address */ + uint8_t *rpath; /**< reply path */ + uint8_t rpath_len; /**< entries in the reply path */ + uint16_t tr_id; /**< transaction identifier */ + uint32_t addr; /**< (first) data address */ uint8_t *data; - uint32_t data_len; /* lenght of data in bytes */ + uint32_t data_len; /**< length of data in bytes */ uint8_t hdr_crc; uint8_t data_crc; }; diff --git a/lib/cmp_data_types.c b/lib/cmp_data_types.c index ed7d5e678f6393e9e55a35abd34d911c6453fd51..373dd51b1d554a8e2fdf6b94161c91578ac5aa1f 100644 --- a/lib/cmp_data_types.c +++ b/lib/cmp_data_types.c @@ -18,10 +18,10 @@ #include <stdint.h> -#include <stdio.h> #include <limits.h> +#include <cmp_support.h> #include <cmp_data_types.h> #include <cmp_debug.h> #include <byteorder.h> @@ -67,10 +67,10 @@ struct cmp_max_used_bits max_used_bits = { /** - * @brief sets the maximum length of the different data products types + * @brief sets the maximum length of the different data product types * * @param set_max_used_bits pointer to a structure with the maximum length - * of the different data products types in bits + * of the different data product types in bits */ void cmp_set_max_used_bits(const struct cmp_max_used_bits *set_max_used_bits) @@ -81,10 +81,10 @@ void cmp_set_max_used_bits(const struct cmp_max_used_bits *set_max_used_bits) /** - * @brief get the maximum length of the different data products types + * @brief get the maximum length of the different data product types * * @returns a structure with the used maximum length of the different data - * products types in bits + * product types in bits */ struct cmp_max_used_bits cmp_get_max_used_bits(void) @@ -194,7 +194,7 @@ size_t size_of_a_sample(enum cmp_data_type data_type) * @returns the size in bytes to store the data sample; zero on failure */ -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) { size_t s = size_of_a_sample(data_type); uint64_t x; /* use 64 bit to catch overflow */ @@ -224,7 +224,7 @@ unsigned int cmp_cal_size_of_data(unsigned int samples, enum cmp_data_type data_ * @returns the number samples for the given compression mode; negative on error */ -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) { uint32_t samples_size = size_of_a_sample(data_type); @@ -462,7 +462,7 @@ static void be_to_cpus_f_fx_efx_ncob_ecob(struct f_fx_efx_ncob_ecob *a, int samp int cmp_input_big_to_cpu_endianness(void *data, uint32_t data_size_byte, enum cmp_data_type data_type) { - int samples = cmp_input_size_to_samples(data_size_byte, data_type); + int32_t samples = cmp_input_size_to_samples(data_size_byte, data_type); if (!data) /* nothing to do */ return 0; @@ -533,10 +533,12 @@ int cmp_input_big_to_cpu_endianness(void *data, uint32_t data_size_byte, /* TODO: implement F_CAM conversion */ case DATA_TYPE_F_CAM_OFFSET: case DATA_TYPE_F_CAM_BACKGROUND: + /* LCOV_EXCL_START */ case DATA_TYPE_UNKNOWN: default: debug_print("Error: Can not swap endianness for this compression data type.\n"); return -1; + /* LCOV_EXCL_STOP */ } return 0; diff --git a/lib/cmp_entity.c b/lib/cmp_entity.c index daa1e11917a0565378ec00738c7787b7ae3c152e..64052c14b554bdbe0119a5eada0ad56b1976290d 100644 --- a/lib/cmp_entity.c +++ b/lib/cmp_entity.c @@ -1,6 +1,6 @@ /** * @file cmp_entity.c - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at), + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) * @date May 2021 * * @copyright GPLv2 @@ -21,12 +21,12 @@ #include <stdint.h> #include <stdio.h> #include <string.h> -#include <limits.h> #if defined __has_include # if __has_include(<time.h>) # include <time.h> # include <stdlib.h> # define HAS_TIME_H 1 +# define my_timercmp(s, t, op) (((s)->tv_sec == (t)->tv_sec) ? ((s)->tv_nsec op (t)->tv_nsec) : ((s)->tv_sec op (t)->tv_sec)) # endif #endif @@ -35,23 +35,24 @@ #include <cmp_support.h> #include <cmp_data_types.h> #include <cmp_entity.h> +#include <my_inttypes.h> #ifdef HAS_TIME_H /* Used as epoch Wed Jan 1 00:00:00 2020 */ # if defined(_WIN32) || defined(_WIN64) -const struct tm EPOCH_DATE = { 0, 0, 0, 1, 0, 120, 0, 0, 0 }; +const struct tm PLATO_EPOCH_DATE = { 0, 0, 0, 1, 0, 120, 0, 0, 0 }; # else -const struct tm EPOCH_DATE = { 0, 0, 0, 1, 0, 120, 0, 0, 0, 0, NULL }; +const struct tm PLATO_EPOCH_DATE = { 0, 0, 0, 1, 0, 120, 0, 0, 0, 0, NULL }; # endif /* _WIN */ #endif /* time.h */ /** - * @brief calculate the size of the compression entity header based on the data - * product type + * @brief calculate the size of the compression entity header based on a + * compression data product type * - * @param data_type compression entity data product type + * @param data_type compression data product type * @param raw_mode_flag set this flag if the raw compression mode (CMP_MODE_RAW) is used * * @returns size of the compression entity header in bytes, 0 on unknown data @@ -63,7 +64,7 @@ uint32_t cmp_ent_cal_hdr_size(enum cmp_data_type data_type, int raw_mode_flag) uint32_t size = 0; if (raw_mode_flag) { - if (cmp_data_type_valid(data_type)) + if (!cmp_data_type_is_invalid(data_type)) /* for raw data we do not need a specific header */ size = GENERIC_HEADER_SIZE; } else { @@ -109,7 +110,7 @@ uint32_t cmp_ent_cal_hdr_size(enum cmp_data_type data_type, int raw_mode_flag) /** * @brief set ICU ASW Version ID in the compression entity header * - * @param ent pointer to a compression entity + * @param ent pointer to a compression entity * @param version_id the applications software version identifier * * @returns 0 on success, otherwise error @@ -132,7 +133,7 @@ int cmp_ent_set_version_id(struct cmp_entity *ent, uint32_t version_id) * @param ent pointer to a compression entity * @param cmp_ent_size the compression entity size measured in bytes * - * @note maximum size is 2^24-1 + * @note maximum size is CMP_ENTITY_MAX_SIZE * * @returns 0 on success, otherwise error */ @@ -322,28 +323,27 @@ int cmp_ent_set_fine_end_time(struct cmp_entity *ent, uint16_t fine_time) /** - * @brief set the data product type in the compression entity header + * @brief set the compression data product type in the compression entity header * * @param ent pointer to a compression entity - * @param data_type compression entity data product type + * @param data_type compression data product type * @param raw_mode_flag set this flag if the raw compression mode (CMP_MODE_RAW) is used * * @returns 0 on success, otherwise error */ -int cmp_ent_set_data_type(struct cmp_entity *ent, - enum cmp_data_type data_type, +int cmp_ent_set_data_type(struct cmp_entity *ent, enum cmp_data_type data_type, int raw_mode_flag) { if (!ent) return -1; + if (data_type > 0x7FF) + return -1; + if (raw_mode_flag) data_type |= 1U << RAW_BIT_DATA_TYPE_POS; - if (data_type > UINT16_MAX) - return -1; - ent->data_type = cpu_to_be16(data_type); return 0; @@ -359,7 +359,7 @@ int cmp_ent_set_data_type(struct cmp_entity *ent, * @returns 0 on success, otherwise error */ -int cmp_ent_set_cmp_mode(struct cmp_entity *ent, uint32_t cmp_mode_used) +int cmp_ent_set_cmp_mode(struct cmp_entity *ent, enum cmp_mode cmp_mode_used) { if (!ent) return -1; @@ -374,10 +374,10 @@ int cmp_ent_set_cmp_mode(struct cmp_entity *ent, uint32_t cmp_mode_used) /** - * @brief set the used model value in the compression entity header + * @brief set the used model weighing value in the compression entity header * * @param ent pointer to a compression entity - * @param model_value_used used model weighting value parameter + * @param model_value_used used model weighing value parameter * * @returns 0 on success, otherwise error */ @@ -443,11 +443,11 @@ int cmp_ent_set_model_counter(struct cmp_entity *ent, uint32_t model_counter) /** - * @brief set version identifier for the max. used bits registry in the + * @brief set version identifier for the maximum used bits registry in the * compression entity header * * @param ent pointer to a compression entity - * @param max_used_bits_version the identifier for the max. used bits registry + * @param max_used_bits_version the identifier for the maximum used bits registry * * @returns 0 on success, otherwise error */ @@ -468,7 +468,7 @@ int cmp_ent_set_max_used_bits_version(struct cmp_entity *ent, uint8_t max_used_b * header * * @param ent pointer to a compression entity - * @param lossy_cmp_par_used used lossy compression parameter + * @param lossy_cmp_par_used used lossy compression parameter/round parameter * * @returns 0 on success, otherwise error */ @@ -481,7 +481,7 @@ int cmp_ent_set_lossy_cmp_par(struct cmp_entity *ent, uint32_t lossy_cmp_par_use if (lossy_cmp_par_used > UINT16_MAX) return -1; - ent->lossy_cmp_par_used = cpu_to_be16((uint16_t)lossy_cmp_par_used); + ent->lossy_cmp_par_used = cpu_to_be16(lossy_cmp_par_used); return 0; } @@ -1082,7 +1082,7 @@ uint64_t cmp_ent_get_end_timestamp(struct cmp_entity *ent) return 0; #ifdef __LITTLE_ENDIAN - return be64_to_cpu(ent->end_timestamp << 16); + return be64_to_cpu(ent->end_timestamp) >> 16; #else return ent->end_timestamp; #endif /* __LITTLE_ENDIAN */ @@ -1142,7 +1142,7 @@ enum cmp_data_type cmp_ent_get_data_type(struct cmp_entity *ent) data_type = be16_to_cpu(ent->data_type); data_type &= (1U << RAW_BIT_DATA_TYPE_POS)-1; /* remove uncompressed data flag */ - if (!cmp_data_type_valid(data_type)) + if (cmp_data_type_is_invalid(data_type)) data_type = DATA_TYPE_UNKNOWN; return data_type; @@ -1171,7 +1171,7 @@ int cmp_ent_get_data_type_raw_bit(struct cmp_entity *ent) * * @param ent pointer to a compression entity * - * @returns the used compression on success, 0 on error + * @returns the used compression mode on success, 0 on error */ uint8_t cmp_ent_get_cmp_mode(struct cmp_entity *ent) @@ -1191,7 +1191,7 @@ uint8_t cmp_ent_get_cmp_mode(struct cmp_entity *ent) * @returns the used model value used on success, 0 on error */ -uint8_t cmp_ent_get_model_value_used(struct cmp_entity *ent) +uint8_t cmp_ent_get_model_value(struct cmp_entity *ent) { if (!ent) return 0; @@ -1236,16 +1236,16 @@ uint8_t cmp_ent_get_model_counter(struct cmp_entity *ent) /** - * @brief get the version identifier for the max. used bits registry from the + * @brief get the version identifier for the maximum used bits registry from the * compression entity header * * @param ent pointer to a compression entity * - * @returns the version identifier for the max. used bits registry on success, + * @returns the version identifier for the maximum used bits registry on success, * 0 on error */ -uint8_t cmp_ent_get_max_use_bits_version(struct cmp_entity *ent) +uint8_t cmp_ent_get_max_used_bits_version(struct cmp_entity *ent) { if (!ent) return 0; @@ -1259,7 +1259,7 @@ uint8_t cmp_ent_get_max_use_bits_version(struct cmp_entity *ent) * * @param ent pointer to a compression entity * - * @returns the used lossy compression parameter on success, 0 on error + * @returns the used lossy compression/round parameter on success, 0 on error */ uint16_t cmp_ent_get_lossy_cmp_par(struct cmp_entity *ent) @@ -1639,7 +1639,7 @@ void *cmp_ent_get_data_buf(struct cmp_entity *ent) return NULL; data_type = cmp_ent_get_data_type(ent); - if (!cmp_data_type_valid(data_type)) { + if (data_type == DATA_TYPE_UNKNOWN) { debug_print("Error: Compression data type not supported.\n"); return NULL; } @@ -1647,7 +1647,6 @@ void *cmp_ent_get_data_buf(struct cmp_entity *ent) if (cmp_ent_get_data_type_raw_bit(ent)) return (uint8_t *)ent + GENERIC_HEADER_SIZE; - switch (data_type) { case DATA_TYPE_IMAGETTE: case DATA_TYPE_SAT_IMAGETTE: @@ -1675,12 +1674,12 @@ void *cmp_ent_get_data_buf(struct cmp_entity *ent) case DATA_TYPE_F_CAM_OFFSET: case DATA_TYPE_F_CAM_BACKGROUND: return ent->non_ima.cmp_data; + /* LCOV_EXCL_START */ case DATA_TYPE_UNKNOWN: default: return NULL; + /* LCOV_EXCL_STOP */ } - - return NULL; } @@ -1688,39 +1687,39 @@ void *cmp_ent_get_data_buf(struct cmp_entity *ent) * @brief copy the data from a compression entity to a buffer * * @param ent pointer to the compression entity containing the compressed data - * @param data_buf pointer where the destination data buffer where the - * compressed data is copied to (can be NULL) + * @param data_buf pointer to the destination data buffer to which the + * compressed data are copied (can be NULL) * @param data_buf_size size of the destination data buffer * - * @returns the size in bytes to store the compressed data; -1 on error + * @returns the size in bytes to store the compressed data; negative on error * * @note the destination and source buffer can overlap - * @note converts the data to the correct endianness + * @note converts the data to the system endianness */ -ssize_t cmp_ent_get_cmp_data(struct cmp_entity *ent, uint32_t *data_buf, - size_t data_buf_size) +int32_t cmp_ent_get_cmp_data(struct cmp_entity *ent, uint32_t *data_buf, + uint32_t data_buf_size) { uint32_t *cmp_ent_data_adr; - size_t cmp_size_byte; + uint32_t cmp_size_byte; if (!ent) return -1; cmp_ent_data_adr = cmp_ent_get_data_buf(ent); if (!cmp_ent_data_adr) { - fprintf(stderr, "Error: Compression data type is not supported.\n"); + debug_print("Error: Compression data type is not supported.\n"); return -1; } cmp_size_byte = cmp_ent_get_cmp_data_size(ent); if (cmp_size_byte & 0x3) { - fprintf(stderr, "Error: The compressed data are not correct formatted. Expected multiple of 4 hex words.\n"); + debug_print("Error: The compressed data are not correct formatted. Expected multiple of 4 hex words.\n"); return -1; } if (data_buf) { - size_t i; + uint32_t i; uint32_t cmp_data_len_32; if (cmp_size_byte > data_buf_size) { @@ -1735,7 +1734,7 @@ ssize_t cmp_ent_get_cmp_data(struct cmp_entity *ent, uint32_t *data_buf, be32_to_cpus(&data_buf[i]); } - return cmp_size_byte; + return (int32_t)cmp_size_byte; } @@ -1781,7 +1780,7 @@ uint32_t cmp_ent_get_cmp_data_size(struct cmp_entity *ent) /** * @brief write the compression parameters from a compression configuration * into the compression entity header - * @note no compressed data are put into the entity and no change of the entity + * @note NO compressed data are put into the entity and NO change of the entity * size * * @param ent pointer to a compression entity @@ -1807,6 +1806,11 @@ int cmp_ent_write_cmp_pars(struct cmp_entity *ent, const struct cmp_cfg *cfg, return -1; } + if (cmp_ent_get_data_type_raw_bit(ent) != (cfg->cmp_mode == CMP_MODE_RAW)) { + debug_print("Error: The entity's raw data bit does not match up with the compression mode.\n"); + return -1; + } + ent_cmp_data_size = cmp_ent_get_cmp_data_size(ent); /* check if the entity can hold the compressed data */ @@ -1823,20 +1827,12 @@ int cmp_ent_write_cmp_pars(struct cmp_entity *ent, const struct cmp_cfg *cfg, return -1; if (cmp_ent_set_model_value(ent, cfg->model_value)) return -1; - if (cmp_ent_set_max_used_bits_version(ent, cmp_get_max_used_bits_version())) - return -1; + cmp_ent_set_max_used_bits_version(ent, cmp_get_max_used_bits_version()); if (cmp_ent_set_lossy_cmp_par(ent, cfg->round)) return -1; - if (cfg->cmp_mode == CMP_MODE_RAW) { - /* check the raw data bit */ - if (!cmp_ent_get_data_type_raw_bit(ent)) { - debug_print("Error: The entity's raw data bit is not set, but the configuration contains raw data.\n"); - return -1; - } - /* no specific header is used for raw data we are done */ + if (cfg->cmp_mode == CMP_MODE_RAW) /* no specific header is used for raw data we are done */ return 0; - } switch (cmp_ent_get_data_type(ent)) { case DATA_TYPE_IMAGETTE_ADAPTIVE: @@ -1877,20 +1873,14 @@ int cmp_ent_write_cmp_pars(struct cmp_entity *ent, const struct cmp_cfg *cfg, if (cmp_ent_set_non_ima_spill3(ent, cfg->spill_pixels_error)) return -1; - if (cmp_ent_set_non_ima_cmp_par4(ent, 0)) - return -1; - if (cmp_ent_set_non_ima_spill4(ent, 0)) - return -1; + cmp_ent_set_non_ima_cmp_par4(ent, 0); + cmp_ent_set_non_ima_spill4(ent, 0); - if (cmp_ent_set_non_ima_cmp_par5(ent, 0)) - return -1; - if (cmp_ent_set_non_ima_spill5(ent, 0)) - return -1; + cmp_ent_set_non_ima_cmp_par5(ent, 0); + cmp_ent_set_non_ima_spill5(ent, 0); - if (cmp_ent_set_non_ima_cmp_par6(ent, 0)) - return -1; - if (cmp_ent_set_non_ima_spill6(ent, 0)) - return -1; + cmp_ent_set_non_ima_cmp_par6(ent, 0); + cmp_ent_set_non_ima_spill6(ent, 0); break; case DATA_TYPE_S_FX: case DATA_TYPE_S_FX_EFX: @@ -1937,9 +1927,7 @@ int cmp_ent_write_cmp_pars(struct cmp_entity *ent, const struct cmp_cfg *cfg, break; case DATA_TYPE_F_CAM_OFFSET: case DATA_TYPE_F_CAM_BACKGROUND: - /* TODO: fix this*/ - return -1; - break; + /* TODO: implement this*/ case DATA_TYPE_UNKNOWN: default: return -1; @@ -1967,38 +1955,49 @@ int cmp_ent_write_rdcu_cmp_pars(struct cmp_entity *ent, const struct cmp_info *i const struct cmp_cfg *cfg) { uint32_t ent_cmp_data_size; - enum cmp_data_type data_type = cmp_ent_get_data_type(ent); + enum cmp_data_type data_type; - if (!info) + if (!ent) return -1; - ent_cmp_data_size = cmp_ent_get_cmp_data_size(ent); + if (!info) + return -1; - /* check if the entity can hold the compressed data */ - if (ent_cmp_data_size < cmp_bit_to_4byte(info->cmp_size)) { - debug_print("Error: The entity size is to small to hold the compressed data.\n"); - return -2; + if (info->cmp_err) { + debug_print("Error: The decompression information contains an compression error.\n"); + return -1; } + data_type = cmp_ent_get_data_type(ent); if (!rdcu_supported_data_type_is_used(data_type)) { debug_print("Error: The compression data type is not one of the types supported by the RDCU.\n"); return -1; } + if (cmp_ent_get_data_type_raw_bit(ent) != raw_mode_is_used(info->cmp_mode_used)) { + debug_print("Error: The entity's raw data bit does not match up with the compression mode.\n"); + return -1; + } + + /* check if the entity can hold the compressed data */ + ent_cmp_data_size = cmp_ent_get_cmp_data_size(ent); + if (ent_cmp_data_size < cmp_bit_to_4byte(info->cmp_size)) { + debug_print("Error: The entity size is to small to hold the compressed data.\n"); + return -2; + } + /* set compression parameter fields in the generic entity header */ if (cmp_ent_set_original_size(ent, cmp_cal_size_of_data(info->samples_used, DATA_TYPE_IMAGETTE))) return -1; if (cmp_ent_set_cmp_mode(ent, info->cmp_mode_used)) return -1; - if (cmp_ent_set_model_value(ent, info->model_value_used)) - return -1; - if (cmp_ent_set_lossy_cmp_par(ent, info->round_used)) - return -1; + cmp_ent_set_model_value(ent, info->model_value_used); + /* The RDCU data compressor does not have the maximum used bit feature, + * so the field is set to 0. */ + cmp_ent_set_max_used_bits_version(ent, 0); + + cmp_ent_set_lossy_cmp_par(ent, info->round_used); - if (cmp_ent_get_data_type_raw_bit(ent) != raw_mode_is_used(info->cmp_mode_used)) { - debug_print("Error: The raw bit is set in data product type filed, but no raw compression mode is used.\n"); - return -1; - } if (raw_mode_is_used(info->cmp_mode_used)) /* no specific header is used for raw data we are done */ return 0; @@ -2036,7 +2035,7 @@ int cmp_ent_write_rdcu_cmp_pars(struct cmp_entity *ent, const struct cmp_info *i * * @param ent pointer to a compression entity; if NULL, the function * returns the needed size - * @param data_type compression entity data product type + * @param data_type compression data product type * @param raw_mode_flag set this flag if the raw compression mode (CMP_MODE_RAW) is used * @param cmp_size_byte size of the compressed data in bytes (should be a multiple of 4) * @@ -2049,7 +2048,6 @@ int cmp_ent_write_rdcu_cmp_pars(struct cmp_entity *ent, const struct cmp_info *i uint32_t cmp_ent_create(struct cmp_entity *ent, enum cmp_data_type data_type, int raw_mode_flag, uint32_t cmp_size_byte) { - int err; uint32_t hdr_size = cmp_ent_cal_hdr_size(data_type, raw_mode_flag); uint32_t ent_size = hdr_size + cmp_size_byte; uint32_t ent_size_cpy = ent_size; @@ -2057,9 +2055,9 @@ uint32_t cmp_ent_create(struct cmp_entity *ent, enum cmp_data_type data_type, if (!hdr_size) return 0; + /* catch overflows */ if (cmp_size_byte > CMP_ENTITY_MAX_SIZE) return 0; - if (ent_size > CMP_ENTITY_MAX_SIZE) return 0; @@ -2073,13 +2071,8 @@ uint32_t cmp_ent_create(struct cmp_entity *ent, enum cmp_data_type data_type, memset(ent, 0, hdr_size); - err = cmp_ent_set_size(ent, ent_size_cpy); - if (err) - return 0; - - err = cmp_ent_set_data_type(ent, data_type, raw_mode_flag); - if (err) - return 0; + cmp_ent_set_size(ent, ent_size_cpy); + cmp_ent_set_data_type(ent, data_type, raw_mode_flag); return ent_size; } @@ -2123,16 +2116,13 @@ size_t cmp_ent_build(struct cmp_entity *ent, uint32_t version_id, return 0; if (ent) { - if (cmp_ent_set_version_id(ent, version_id)) - return 0; + cmp_ent_set_version_id(ent, version_id); if (cmp_ent_set_start_timestamp(ent, start_time)) return 0; if (cmp_ent_set_end_timestamp(ent, end_time)) return 0; - if (cmp_ent_set_model_id(ent, model_id)) - return 0; - if (cmp_ent_set_model_counter(ent, model_counter)) - return 0; + cmp_ent_set_model_id(ent, model_id); + cmp_ent_set_model_counter(ent, model_counter); if (cmp_ent_write_cmp_pars(ent, cfg, cmp_size_bits)) return 0; } @@ -2153,16 +2143,23 @@ size_t cmp_ent_build(struct cmp_entity *ent, uint32_t version_id, int cmp_ent_read_header(struct cmp_entity *ent, struct cmp_cfg *cfg) { - int samples; + int32_t samples; + + if (!cfg) + return -1; cfg->data_type = cmp_ent_get_data_type(ent); - if (!cmp_data_type_valid(cfg->data_type)) { + if (cmp_data_type_is_invalid(cfg->data_type)) { debug_print("Error: Compression data type not supported.\n"); return -1; } cfg->cmp_mode = cmp_ent_get_cmp_mode(ent); - cfg->model_value = cmp_ent_get_model_value_used(ent); + if (cmp_ent_get_data_type_raw_bit(ent) != (cfg->cmp_mode == CMP_MODE_RAW)) { + debug_print("Error: The entity's raw data bit does not match up with the compression mode.\n"); + return -1; + } + cfg->model_value = cmp_ent_get_model_value(ent); cfg->round = cmp_ent_get_lossy_cmp_par(ent); cfg->buffer_length = cmp_ent_get_cmp_data_size(ent); @@ -2173,15 +2170,15 @@ int cmp_ent_read_header(struct cmp_entity *ent, struct cmp_cfg *cfg) return -1; } - cfg->samples = samples; - - if (cmp_ent_get_data_type_raw_bit(ent) != raw_mode_is_used(cfg->cmp_mode)) { - debug_print("Error: The raw bit is set in data product type filed, but no raw compression mode is used.\n"); - return -1; - } + cfg->samples = (uint32_t)samples; cfg->icu_output_buf = cmp_ent_get_data_buf(ent); + + if (cfg->cmp_mode == CMP_MODE_RAW) + /* no specific header is used for raw data we are done */ + return 0; + switch (cfg->data_type) { case DATA_TYPE_IMAGETTE_ADAPTIVE: case DATA_TYPE_SAT_IMAGETTE_ADAPTIVE: @@ -2234,12 +2231,11 @@ int cmp_ent_read_header(struct cmp_entity *ent, struct cmp_cfg *cfg) break; case DATA_TYPE_F_CAM_OFFSET: case DATA_TYPE_F_CAM_BACKGROUND: - /* TODO: fix this*/ - return -1; - break; - case DATA_TYPE_UNKNOWN: /* fall through */ + /* LCOV_EXCL_START */ + case DATA_TYPE_UNKNOWN: default: return -1; + /* LCOV_EXCL_STOP */ } return 0; @@ -2255,9 +2251,11 @@ int cmp_ent_read_header(struct cmp_entity *ent, struct cmp_cfg *cfg) * is used as a portable alternative * @note The function is thread-unsafe * - * @param tm pointer to a tm object specifying local calendar time to convert + * @param tm pointer to a broken-down time representation, expressed in + * Coordinated Universal Time (UTC) * - * @returns time since epoch as a time_t object on success or -1 if time cannot be represented as a time_t object + * @returns time since epoch as a time_t object on success; or -1 if time cannot + * be represented as a time_t object * * @see http://www.catb.org/esr/time-programming/#_unix_time_and_utc_gmt_zulu */ @@ -2283,33 +2281,44 @@ static time_t my_timegm(struct tm *tm) unsetenv("TZ"); tzset(); return ret; -# endif +# endif /* _WIN32 || _WIN64 */ } +#endif /* HAS_TIME_H */ +#ifdef HAS_TIME_H /* * @brief Generate a timestamp for the compression header * - * @param ts pointer to an object of type struct timespec of the timestamp time, null for now + * @param ts pointer to an object of type struct timespec of the + * timestamp time, NULL for now * * @returns returns compression header timestamp or 0 on error */ uint64_t cmp_ent_create_timestamp(const struct timespec *ts) { - struct tm epoch_date = EPOCH_DATE; + struct tm epoch_date = PLATO_EPOCH_DATE; struct timespec epoch = { my_timegm(&epoch_date), 0 }; struct timespec now = { 0, 0 }; double seconds; uint64_t coarse, fine; + /* LCOV_EXCL_START */ + /* if time cannot be represented as a time_t object epoch.tv_sec = -1 */ if (epoch.tv_sec == -1) return 0; + /* LCOV_EXCL_STOP */ - if (ts) + if (ts) { + if (my_timercmp(ts, &epoch, <)) { + debug_print("Error: Time is before PLATO epoch.\n"); + return 0; + } now = *ts; - else + } else { clock_gettime(CLOCK_REALTIME, &now); + } seconds = ((double)now.tv_sec + 1.0e-9 * now.tv_nsec) - ((double)epoch.tv_sec + 1.0e-9 * epoch.tv_nsec); @@ -2317,9 +2326,9 @@ uint64_t cmp_ent_create_timestamp(const struct timespec *ts) coarse = (uint64_t)seconds; fine = (uint64_t)((seconds - coarse) * 256 * 256); - return coarse * 256 * 256 + fine; + return (coarse << 16) + fine; } -#endif +#endif /* HAS_TIME_H */ /** @@ -2335,11 +2344,11 @@ void cmp_ent_print_header(struct cmp_entity *ent) size_t i; for (i = 0; i < hdr_size; ++i) { - printf("%02X ", p[i]); + debug_print("%02X ", p[i]); if (i && !((i+1) % 32)) - printf("\n"); + debug_print("\n"); } - printf("\n"); + debug_print("\n"); } @@ -2359,11 +2368,11 @@ void cmp_ent_print_data(struct cmp_entity *ent) return; for (i = 0; i < data_size; ++i) { - printf("%02X ", p[i]); + debug_print("%02X ", p[i]); if (i && !((i+1) % 32)) - printf("\n"); + debug_print("\n"); } - printf("\n"); + debug_print("\n"); } @@ -2375,9 +2384,9 @@ void cmp_ent_print_data(struct cmp_entity *ent) void cmp_ent_print(struct cmp_entity *ent) { - printf("compression entity header:\n"); + debug_print("compression entity header:\n"); cmp_ent_print_header(ent); - printf("compressed data in the compressed entity:\n"); + debug_print("compressed data in the compressed entity:\n"); cmp_ent_print_data(ent); } @@ -2402,65 +2411,62 @@ static void cmp_ent_parse_generic_header(struct cmp_entity *ent) uint16_t major = (version_id & 0x7FFF0000U) >> 16U; uint16_t minor = version_id & 0xFFFFU; - printf("Compressed with cmp_tool version: %u.%02u\n", major, minor); + debug_print("Compressed with cmp_tool version: %u.%02u\n", major, minor); } else - printf("ICU ASW Version ID: %u\n", version_id); + debug_print("ICU ASW Version ID: %" PRIu32 "\n", version_id); cmp_ent_size = cmp_ent_get_size(ent); - printf("Compression Entity Size: %u byte\n", cmp_ent_size); + debug_print("Compression Entity Size: %" PRIu32 " byte\n", cmp_ent_size); original_size = cmp_ent_get_original_size(ent); - printf("Original Data Size: %u byte\n", original_size); + debug_print("Original Data Size: %" PRIu32 " byte\n", original_size); start_coarse_time = cmp_ent_get_coarse_start_time(ent); - printf("Compression Coarse Start Time: %u\n", start_coarse_time); + debug_print("Compression Coarse Start Time: %" PRIu32 "\n", start_coarse_time); start_fine_time = cmp_ent_get_fine_start_time(ent); - printf("Compression Fine Start Time: %d\n", start_fine_time); + debug_print("Compression Fine Start Time: %d\n", start_fine_time); end_coarse_time = cmp_ent_get_coarse_end_time(ent); - printf("Compression Coarse End Time: %u\n", end_coarse_time); + debug_print("Compression Coarse End Time: %" PRIu32 "\n", end_coarse_time); end_fine_time = cmp_ent_get_fine_end_time(ent); - printf("Compression Fine End Time: %d\n", end_fine_time); + debug_print("Compression Fine End Time: %d\n", end_fine_time); #ifdef HAS_TIME_H { - struct tm epoch_date = EPOCH_DATE; + struct tm epoch_date = PLATO_EPOCH_DATE; time_t time = my_timegm(&epoch_date) + start_coarse_time; - printf("Data were compressed on (local time): %s", ctime(&time)); + debug_print("Data were compressed on (local time): %s", ctime(&time)); } #endif - printf("The compression took %f second\n", end_coarse_time - start_coarse_time + debug_print("The compression took %f second\n", end_coarse_time - start_coarse_time + ((end_fine_time - start_fine_time)/256./256.)); data_type = cmp_ent_get_data_type(ent); - if (data_type != DATA_TYPE_UNKNOWN) - printf("Data Product Type: %d\n", data_type); - else - printf("Data Product Type: unknown!"); + debug_print("Data Product Type: %d\n", data_type); raw_bit = cmp_ent_get_data_type_raw_bit(ent); - printf("RAW bit in the Data Product Type is%s set\n", raw_bit ? "" : " not"); + debug_print("RAW bit in the Data Product Type is%s set\n", raw_bit ? "" : " not"); cmp_mode_used = cmp_ent_get_cmp_mode(ent); - printf("Used Compression Mode: %u\n", cmp_mode_used); + debug_print("Used Compression Mode: %" PRIu32 "\n", cmp_mode_used); - model_value_used = cmp_ent_get_model_value_used(ent); - printf("Used Model Updating Weighing Value: %u\n", model_value_used); + model_value_used = cmp_ent_get_model_value(ent); + debug_print("Used Model Updating Weighing Value: %" PRIu32 "\n", model_value_used); model_id = cmp_ent_get_model_id(ent); - printf("Model ID: %u\n", model_id); + debug_print("Model ID: %" PRIu32 "\n", model_id); model_counter = cmp_ent_get_model_counter(ent); - printf("Model Counter: %u\n", model_counter); + debug_print("Model Counter: %" PRIu32 "\n", model_counter); - max_used_bits_version = cmp_ent_get_max_use_bits_version(ent); - printf("Maximum Used Bits Registry Version: %u\n", max_used_bits_version); + max_used_bits_version = cmp_ent_get_max_used_bits_version(ent); + debug_print("Maximum Used Bits Registry Version: %" PRIu32 "\n", max_used_bits_version); lossy_cmp_par_used = cmp_ent_get_lossy_cmp_par(ent); - printf("Used Lossy Compression Parameters: %u\n", lossy_cmp_par_used); + debug_print("Used Lossy Compression Parameters: %" PRIu32 "\n", lossy_cmp_par_used); } @@ -2475,10 +2481,10 @@ static void cmp_ent_parese_imagette_header(struct cmp_entity *ent) uint32_t spill_used, golomb_par_used; spill_used = cmp_ent_get_ima_spill(ent); - printf("Used Spillover Threshold Parameter: %u\n", spill_used); + debug_print("Used Spillover Threshold Parameter: %" PRIu32 "\n", spill_used); golomb_par_used = cmp_ent_get_ima_golomb_par(ent); - printf("Used Golomb Parameter: %u\n", golomb_par_used); + debug_print("Used Golomb Parameter: %" PRIu32 "\n", golomb_par_used); } @@ -2494,22 +2500,22 @@ static void cmp_ent_parese_adaptive_imagette_header(struct cmp_entity *ent) ap1_golomb_par_used, ap2_spill_used, ap2_golomb_par_used; spill_used = cmp_ent_get_ima_spill(ent); - printf("Used Spillover Threshold Parameter: %u\n", spill_used); + debug_print("Used Spillover Threshold Parameter: %" PRIu32 "\n", spill_used); golomb_par_used = cmp_ent_get_ima_golomb_par(ent); - printf("Used Golomb Parameter: %u\n", golomb_par_used); + debug_print("Used Golomb Parameter: %" PRIu32 "\n", golomb_par_used); ap1_spill_used = cmp_ent_get_ima_ap1_spill(ent); - printf("Used Adaptive 1 Spillover Threshold Parameter: %u\n", ap1_spill_used); + debug_print("Used Adaptive 1 Spillover Threshold Parameter: %" PRIu32 "\n", ap1_spill_used); ap1_golomb_par_used = cmp_ent_get_ima_ap1_golomb_par(ent); - printf("Used Adaptive 1 Golomb Parameter: %u\n", ap1_golomb_par_used); + debug_print("Used Adaptive 1 Golomb Parameter: %" PRIu32 "\n", ap1_golomb_par_used); ap2_spill_used = cmp_ent_get_ima_ap2_spill(ent); - printf("Used Adaptive 2 Spillover Threshold Parameter: %u\n", ap2_spill_used); + debug_print("Used Adaptive 2 Spillover Threshold Parameter: %" PRIu32 "\n", ap2_spill_used); ap2_golomb_par_used = cmp_ent_get_ima_ap2_golomb_par(ent); - printf("Used Adaptive 2 Golomb Parameter: %u\n", ap2_golomb_par_used); + debug_print("Used Adaptive 2 Golomb Parameter: %" PRIu32 "\n", ap2_golomb_par_used); } @@ -2524,7 +2530,7 @@ static void cmp_ent_parese_specific_header(struct cmp_entity *ent) enum cmp_data_type data_type = cmp_ent_get_data_type(ent); if (cmp_ent_get_data_type_raw_bit(ent)) { - printf("Uncompressed data bit is set no specific header is used.\n"); + debug_print("Uncompressed data bit is set. No specific header is used.\n"); return; } @@ -2540,7 +2546,7 @@ static void cmp_ent_parese_specific_header(struct cmp_entity *ent) cmp_ent_parese_adaptive_imagette_header(ent); break; default: - printf("For this data product type no parse functions is implemented!\n"); + debug_print("For this data product type no parse functions is implemented!\n"); break; } } diff --git a/lib/cmp_guess.c b/lib/cmp_guess.c index 87aec6cd5824f7baa9cde955b9cb44f91fd6042f..8cdf7513e2a543533f52c1c5b6c8c33a59f17962 100644 --- a/lib/cmp_guess.c +++ b/lib/cmp_guess.c @@ -1,6 +1,6 @@ /** * @file cmp_guess.c - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at), + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) * @date 2021 * * @copyright GPLv2 @@ -21,11 +21,13 @@ #include <limits.h> #include <stdio.h> #include <stdlib.h> -#include <string.h> -#include "cmp_data_types.h" -#include "cmp_icu.h" -#include "cmp_guess.h" +#include <cmp_data_types.h> +#include <cmp_icu.h> +#include <cmp_guess.h> +#include <my_inttypes.h> + +#define CMP_GUESS_MAX_CAL_STEPS 20274 /* how often the model is updated before it is rested */ @@ -153,7 +155,6 @@ static uint32_t pre_cal_method(struct cmp_cfg *cfg) * configuration; 0 on error */ -#define CMP_GUESS_MAX_CAL_STEPS 20274 static uint32_t brute_force(struct cmp_cfg *cfg) { uint32_t g, s; @@ -190,7 +191,7 @@ static uint32_t brute_force(struct cmp_cfg *cfg) percent = n_cal_steps*100/max_cal_steps; if (percent > 5+last && percent < 100) { last = percent; - printf("%u%%... ", percent); + printf("%" PRIu32 "%%... ", percent); fflush(stdout); } } diff --git a/lib/cmp_icu.c b/lib/cmp_icu.c index 79d1a64f075989c59700f5ceb865048635d64a04..445e4d1b730669f5df84be06f042bf4fc62c33fb 100644 --- a/lib/cmp_icu.c +++ b/lib/cmp_icu.c @@ -1,6 +1,6 @@ /** - * @file icu_cmp.c - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at), + * @file cmp_icu.c + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) * @date 2020 * * @copyright GPLv2 @@ -44,23 +44,29 @@ extern struct cmp_max_used_bits max_used_bits; -/* pointer to a code word generation function */ +/** + * @brief pointer to a code word generation function + */ + typedef uint32_t (*generate_cw_f_pt)(uint32_t value, uint32_t encoder_par1, uint32_t encoder_par2, uint32_t *cw); -/* structure to hold a setup to encode a value */ +/** + * @brief structure to hold a setup to encode a value + */ + struct encoder_setupt { - generate_cw_f_pt generate_cw_f; /* pointer to the code word encoder */ + generate_cw_f_pt generate_cw_f; /**< function pointer to a code word encoder */ int (*encode_method_f)(uint32_t data, uint32_t model, int stream_len, - const struct encoder_setupt *setup); /* pointer to the encoding function */ - uint32_t *bitstream_adr; /* start address of the compressed data bitstream */ - uint32_t max_stream_len; /* maximum length of the bitstream/icu_output_buf in bits */ - uint32_t encoder_par1; /* encoding parameter 1 */ - uint32_t encoder_par2; /* encoding parameter 2 */ - uint32_t spillover_par; /* outlier parameter */ - uint32_t lossy_par; /* lossy compression parameter */ - uint32_t max_data_bits; /* how many bits are needed to represent the highest possible value */ + const struct encoder_setupt *setup); /**< pointer to the encoding function */ + uint32_t *bitstream_adr; /**< start address of the compressed data bitstream */ + uint32_t max_stream_len; /**< maximum length of the bitstream/icu_output_buf in bits */ + uint32_t encoder_par1; /**< encoding parameter 1 */ + uint32_t encoder_par2; /**< encoding parameter 2 */ + uint32_t spillover_par; /**< outlier parameter */ + uint32_t lossy_par; /**< lossy compression parameter */ + uint32_t max_data_bits; /**< how many bits are needed to represent the highest possible value */ }; @@ -88,7 +94,7 @@ struct cmp_cfg cmp_cfg_icu_create(enum cmp_data_type data_type, enum cmp_mode cm cfg.model_value = model_value; cfg.round = lossy_par; - if (cmp_cfg_icu_gen_par_is_invalid(&cfg)) + if (cmp_cfg_gen_par_is_invalid(&cfg, ICU_CHECK)) cfg.data_type = DATA_TYPE_UNKNOWN; return cfg; @@ -122,7 +128,7 @@ uint32_t cmp_cfg_icu_buffers(struct cmp_cfg *cfg, void *data_to_compress, void *updated_model, uint32_t *compressed_data, uint32_t compressed_data_len_samples) { - uint32_t data_size, hdr_size; + uint32_t cmp_data_size, hdr_size; if (!cfg) { debug_print("Error: pointer to the compression configuration structure is NULL.\n"); @@ -139,15 +145,15 @@ uint32_t cmp_cfg_icu_buffers(struct cmp_cfg *cfg, void *data_to_compress, if (cmp_cfg_icu_buffers_is_invalid(cfg)) return 0; - data_size = cmp_cal_size_of_data(compressed_data_len_samples, cfg->data_type); + cmp_data_size = cmp_cal_size_of_data(compressed_data_len_samples, cfg->data_type); hdr_size = cmp_ent_cal_hdr_size(cfg->data_type, cfg->cmp_mode == CMP_MODE_RAW); - if ((data_size + hdr_size) > CMP_ENTITY_MAX_SIZE) { + if ((cmp_data_size + hdr_size) > CMP_ENTITY_MAX_SIZE || cmp_data_size > CMP_ENTITY_MAX_SIZE) { debug_print("Error: The buffer for the compressed data is too large to fit in a compression entity.\n"); return 0; } - return data_size; + return cmp_data_size; } @@ -171,10 +177,7 @@ int cmp_cfg_icu_imagette(struct cmp_cfg *cfg, uint32_t cmp_par, cfg->golomb_par = cmp_par; cfg->spill = spillover_par; - if (cmp_cfg_imagette_is_invalid(cfg, ICU_CHECK)) - return -1; - - return 0; + return cmp_cfg_imagette_is_invalid(cfg, ICU_CHECK); } @@ -225,10 +228,7 @@ int cmp_cfg_fx_cob(struct cmp_cfg *cfg, cfg->spill_ecob = spillover_ecob; cfg->spill_fx_cob_variance = spillover_fx_cob_variance; - if (cmp_cfg_fx_cob_is_invalid(cfg)) - return -1; - - return 0; + return cmp_cfg_fx_cob_is_invalid(cfg); } @@ -266,10 +266,7 @@ int cmp_cfg_aux(struct cmp_cfg *cfg, cfg->spill_variance = spillover_variance; cfg->spill_pixels_error = spillover_pixels_error; - if (cmp_cfg_aux_is_invalid(cfg)) - return -1; - - return 0; + return cmp_cfg_aux_is_invalid(cfg); } @@ -2347,7 +2344,7 @@ int icu_compress_data(const struct cmp_cfg *cfg) if (cfg->samples > cfg->buffer_length) return CMP_ERROR_SMALL_BUF; - if (cmp_cfg_is_invalid(cfg)) + if (cmp_cfg_icu_is_invalid(cfg)) return -1; if (raw_mode_is_used(cfg->cmp_mode)) { diff --git a/lib/cmp_io.c b/lib/cmp_io.c index 0dfcc8d71d2f656934383000d5f71ac109af9ec3..4f3ba6ac2fa824f3f70a422f2c6e80f244aa46ad 100644 --- a/lib/cmp_io.c +++ b/lib/cmp_io.c @@ -1,7 +1,7 @@ /** * @file cmp_io.c + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) * @author Johannes Seelig (johannes.seelig@univie.ac.at) - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at), * @date 2020 * * @copyright GPLv2 @@ -14,7 +14,7 @@ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * @brief compression tool Input/Output library + * @brief compression tool input/output library * @warning this part of the software is not intended to run on-board on the ICU. */ @@ -31,6 +31,7 @@ #include <rdcu_cmd.h> #include <byteorder.h> #include <cmp_data_types.h> +#include <my_inttypes.h> /* directory to convert from data_type to string */ @@ -149,11 +150,12 @@ static FILE *open_file(const char *dirname, const char *filename) /** * @brief write uncompressed input data to an output file * - * @param data the data to write a file - * @param data_size size of the data in bytes - * @param output_prefix file name without file extension - * @param name_extension file extension (with leading point character) - * @param verbose print verbose output if not zero + * @param data the data to write a file + * @param data_size size of the data in bytes + * @param data_type compression data type of the data + * @param output_prefix file name without file extension + * @param name_extension extension (with leading point character) + * @param verbose print verbose output if not zero * * @returns 0 on success, error otherwise */ @@ -425,7 +427,7 @@ enum cmp_data_type string2data_type(const char *data_type_str) if (!atoui32("Compression Data Type", data_type_str, &read_val)) { data_type = read_val; - if (!cmp_data_type_valid(data_type)) + if (cmp_data_type_is_invalid(data_type)) data_type = DATA_TYPE_UNKNOWN; } } @@ -468,7 +470,7 @@ const char *data_type2string(enum cmp_data_type data_type) * @returns 0 on success, error otherwise */ -int cmp_mode_parse(const char *cmp_mode_str, uint32_t *cmp_mode) +int cmp_mode_parse(const char *cmp_mode_str, enum cmp_mode *cmp_mode) { size_t j; static const struct { @@ -501,8 +503,10 @@ int cmp_mode_parse(const char *cmp_mode_str, uint32_t *cmp_mode) } return -1; } else { - if (atoui32(cmp_mode_str, cmp_mode_str, cmp_mode)) + uint32_t read_val; + if (atoui32(cmp_mode_str, cmp_mode_str, &read_val)) return -1; + *cmp_mode = read_val; } if (!cmp_mode_is_supported(*cmp_mode)) @@ -785,7 +789,7 @@ static int parse_cfg(FILE *fp, struct cmp_cfg *cfg) * @returns 0 on success, error otherwise */ -int read_cmp_cfg(const char *file_name, struct cmp_cfg *cfg, int verbose_en) +int cmp_cfg_read(const char *file_name, struct cmp_cfg *cfg, int verbose_en) { int err; FILE *fp; @@ -816,7 +820,7 @@ int read_cmp_cfg(const char *file_name, struct cmp_cfg *cfg, int verbose_en) if (verbose_en) { printf("\n\n"); - print_cmp_cfg(cfg); + cmp_cfg_print(cfg); printf("\n"); } @@ -1044,7 +1048,7 @@ static int parse_info(FILE *fp, struct cmp_info *info) * @returns 0 on success, error otherwise */ -int read_cmp_info(const char *file_name, struct cmp_info *info, int verbose_en) +int cmp_info_read(const char *file_name, struct cmp_info *info, int verbose_en) { int err; FILE *fp; @@ -1394,7 +1398,8 @@ ssize_t read_file_data(const char *file_name, enum cmp_data_type data_type, void *buf, uint32_t buf_size, int verbose_en) { ssize_t size; - int samples, err; + int32_t samples; + int err; size = read_file8(file_name, (uint8_t *)buf, buf_size, verbose_en); @@ -1450,7 +1455,7 @@ ssize_t read_file_cmp_entity(const char *file_name, struct cmp_entity *ent, PROGRAM_NAME, file_name); return -1; } - if (size != cmp_ent_get_size(ent)) { + if (size != (ssize_t)cmp_ent_get_size(ent)) { fprintf(stderr, "%s: %s: The size of the compression entity set in the header of the compression entity is not the same size as the read-in file has.\n", PROGRAM_NAME, file_name); return -1; @@ -1551,19 +1556,29 @@ uint32_t cmp_tool_gen_version_id(const char *version) * @note internal use only! * * @param fp FILE pointer - * @param cfg configuration to print - * @param rdcu_cfg if set additional RDCU parameter are printed as well + * @param cfg pointer to a configuration to print */ -static void write_cfg_internal(FILE *fp, const struct cmp_cfg *cfg, int rdcu_cfg) +static void write_cfg_internal(FILE *fp, const struct cmp_cfg *cfg) { - fprintf(fp, "#-------------------------------------------------------------------------------\n"); - fprintf(fp, "# Default Configuration File\n"); + if (!fp) + return; + + if (!cfg) { + fprintf(fp, "Pointer to the compressor configuration is NULL.\n"); + return; + } + fprintf(fp, "#-------------------------------------------------------------------------------\n"); fprintf(fp, "# Selected compression data type\n"); fprintf(fp, "\n"); fprintf(fp, "data_type = %s\n", data_type2string(cfg->data_type)); fprintf(fp, "\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + + if (cmp_data_type_is_invalid(cfg->data_type)) + return; + fprintf(fp, "# Selected compression mode\n"); fprintf(fp, "# 0: raw mode\n"); fprintf(fp, "# 1: model mode with zero escape symbol mechanism\n"); @@ -1574,86 +1589,201 @@ static void write_cfg_internal(FILE *fp, const struct cmp_cfg *cfg, int rdcu_cfg fprintf(fp, "cmp_mode = %u\n", cfg->cmp_mode); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); - fprintf(fp, "# Number of samples (16 bit value) to compress, length of the data and model buffer\n"); - fprintf(fp, "\n"); - fprintf(fp, "samples = %u\n", cfg->samples); - fprintf(fp, "\n"); - fprintf(fp, "#-------------------------------------------------------------------------------\n"); - fprintf(fp, "# Length of the compressed data buffer in number of samples (16 bit values)\n"); - fprintf(fp, "\n"); - fprintf(fp, "buffer_length = %u\n", cfg->buffer_length); - fprintf(fp, "\n"); - fprintf(fp, "#-------------------------------------------------------------------------------\n"); - fprintf(fp, "# Golomb parameter for dictionary selection\n"); + fprintf(fp, "# Number of samples to compress, length of the data and model buffer\n"); fprintf(fp, "\n"); - fprintf(fp, "golomb_par = %u\n", cfg->golomb_par); + fprintf(fp, "samples = %" PRIu32 "\n", cfg->samples); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); - fprintf(fp, "# Spillover threshold for encoding outliers\n"); + fprintf(fp, "# Length of the compressed data buffer in number of samples\n"); fprintf(fp, "\n"); - fprintf(fp, "spill = %u\n", cfg->spill); + fprintf(fp, "buffer_length = %" PRIu32 "\n", cfg->buffer_length); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); fprintf(fp, "# Model weighting parameter\n"); fprintf(fp, "\n"); - fprintf(fp, "model_value = %u\n", cfg->model_value); + fprintf(fp, "model_value = %" PRIu32 "\n", cfg->model_value); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); fprintf(fp, "# Number of noise bits to be rounded\n"); fprintf(fp, "\n"); - fprintf(fp, "round = %u\n", cfg->round); + fprintf(fp, "round = %" PRIu32 "\n", cfg->round); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + fprintf(fp, "# Data Type Specific Compression Parameters\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); - if (rdcu_cfg) { - fprintf(fp, "#-------------------------------------------------------------------------------\n"); - fprintf(fp, "# Hardware Compressor Settings (not need for SW compression)\n"); + if (cmp_imagette_data_type_is_used(cfg->data_type)) { + fprintf(fp, "# Golomb parameter for dictionary selection\n"); + fprintf(fp, "\n"); + fprintf(fp, "golomb_par = %" PRIu32 "\n", cfg->golomb_par); + fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); + fprintf(fp, "# Spillover threshold for encoding outliers\n"); + fprintf(fp, "\n"); + fprintf(fp, "spill = %" PRIu32 "\n", cfg->spill); + fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); + } + + if (cmp_ap_imagette_data_type_is_used(cfg->data_type)) { fprintf(fp, "\n"); fprintf(fp, "# Adaptive 1 Golomb parameter; HW only\n"); fprintf(fp, "\n"); - fprintf(fp, "ap1_golomb_par = %u\n", cfg->ap1_golomb_par); + fprintf(fp, "ap1_golomb_par = %" PRIu32 "\n", cfg->ap1_golomb_par); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); fprintf(fp, "# Adaptive 1 spillover threshold; HW only\n"); fprintf(fp, "\n"); - fprintf(fp, "ap1_spill = %u\n", cfg->ap1_spill); + fprintf(fp, "ap1_spill = %" PRIu32 "\n", cfg->ap1_spill); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); fprintf(fp, "# Adaptive 2 Golomb parameter; HW only\n"); fprintf(fp, "\n"); - fprintf(fp, "ap2_golomb_par = %u\n", cfg->ap2_golomb_par); + fprintf(fp, "ap2_golomb_par = %" PRIu32 "\n", cfg->ap2_golomb_par); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); fprintf(fp, "# Adaptive 2 spillover threshold; HW only\n"); fprintf(fp, "\n"); - fprintf(fp, "ap2_spill = %u\n", cfg->ap2_spill); + fprintf(fp, "ap2_spill = %" PRIu32 "\n", cfg->ap2_spill); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); fprintf(fp, "# RDCU data to compress start address, the first data address in the RDCU SRAM; HW only\n"); fprintf(fp, "\n"); - fprintf(fp, "rdcu_data_adr = 0x%06X\n", - cfg->rdcu_data_adr); + fprintf(fp, "rdcu_data_adr = 0x%06"PRIX32"\n", cfg->rdcu_data_adr); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); fprintf(fp, "# RDCU model start address, the first model address in the RDCU SRAM\n"); fprintf(fp, "\n"); - fprintf(fp, "rdcu_model_adr = 0x%06X\n", - cfg->rdcu_model_adr); + fprintf(fp, "rdcu_model_adr = 0x%06"PRIX32"\n", cfg->rdcu_model_adr); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); fprintf(fp, "# RDCU updated model start address, the address in the RDCU SRAM where the updated model is stored\n"); fprintf(fp, "\n"); - fprintf(fp, "rdcu_new_model_adr = 0x%06X\n", - cfg->rdcu_new_model_adr); + fprintf(fp, "rdcu_new_model_adr = 0x%06"PRIX32"\n", cfg->rdcu_new_model_adr); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); fprintf(fp, "# RDCU compressed data start address, the first output data address in the RDCU SRAM\n"); fprintf(fp, "\n"); - fprintf(fp, "rdcu_buffer_adr = 0x%06X\n", cfg->rdcu_buffer_adr); + fprintf(fp, "rdcu_buffer_adr = 0x%06"PRIX32"\n", cfg->rdcu_buffer_adr); + fprintf(fp, "\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + } + + if (cmp_aux_data_type_is_used(cfg->data_type)) { + fprintf(fp, "# mean compression parameter\n"); + fprintf(fp, "\n"); + fprintf(fp, "cmp_par_mean = %" PRIu32 "\n", cfg->cmp_par_mean); + fprintf(fp, "\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + fprintf(fp, "# mean spillover threshold parameter\n"); + fprintf(fp, "\n"); + fprintf(fp, "spill_mean = %" PRIu32 "\n", cfg->spill_mean); + fprintf(fp, "\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + fprintf(fp, "# variance compression parameter\n"); + fprintf(fp, "\n"); + fprintf(fp, "cmp_par_variance = %" PRIu32 "\n", cfg->cmp_par_variance); + fprintf(fp, "\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + fprintf(fp, "# variance spillover threshold parameter\n"); + fprintf(fp, "\n"); + fprintf(fp, "spill_variance = %" PRIu32 "\n", cfg->spill_variance); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); + if (cfg->data_type != DATA_TYPE_OFFSET) { + fprintf(fp, "# outlier pixels number compression parameter\n"); + fprintf(fp, "\n"); + fprintf(fp, "cmp_par_pixels_error = %" PRIu32 "\n", cfg->cmp_par_pixels_error); + fprintf(fp, "\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + fprintf(fp, "# outlier pixels number spillover threshold parameter\n"); + fprintf(fp, "\n"); + fprintf(fp, "spill_pixels_error = %" PRIu32 "\n", cfg->spill_pixels_error); + fprintf(fp, "\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + } + /* TODO: implemented DATA_TYPE_F_CAM_OFFSET, DATA_TYPE_F_CAM_BACKGROUND */ + } + + if (cmp_fx_cob_data_type_is_used(cfg->data_type)) { + struct fx_cob_par needed_pars; + + cmp_cfg_fx_cob_get_need_pars(cfg->data_type, &needed_pars); + + if (needed_pars.exp_flags) { + fprintf(fp, "# exposure flags compression parameter\n"); + fprintf(fp, "\n"); + fprintf(fp, "cmp_par_exp_flags = %" PRIu32 "\n", cfg->cmp_par_exp_flags); + fprintf(fp, "\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + fprintf(fp, "# exposure flags spillover threshold parameter\n"); + fprintf(fp, "\n"); + fprintf(fp, "spill_exp_flags = %" PRIu32 "\n", cfg->spill_exp_flags); + fprintf(fp, "\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + } + if (needed_pars.fx) { + fprintf(fp, "# normal light flux compression parameter\n"); + fprintf(fp, "\n"); + fprintf(fp, "cmp_par_fx = %" PRIu32 "\n", cfg->cmp_par_fx); + fprintf(fp, "\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + fprintf(fp, "# normal light flux spillover threshold parameter\n"); + fprintf(fp, "\n"); + fprintf(fp, "spill_fx = %" PRIu32 "\n", cfg->spill_fx); + fprintf(fp, "\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + } + if (needed_pars.ncob) { + fprintf(fp, "# normal center of brightness compression parameter\n"); + fprintf(fp, "\n"); + fprintf(fp, "cmp_par_ncob = %" PRIu32 "\n", cfg->cmp_par_ncob); + fprintf(fp, "\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + fprintf(fp, "# normal center of brightness spillover threshold parameter\n"); + fprintf(fp, "\n"); + fprintf(fp, "spill_nocb = %" PRIu32 "\n", cfg->spill_ncob); + fprintf(fp, "\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + } + if (needed_pars.efx) { + fprintf(fp, "# extended light flux compression parameter\n"); + fprintf(fp, "\n"); + fprintf(fp, "cmp_par_efx = %" PRIu32 "\n", cfg->cmp_par_efx); + fprintf(fp, "\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + fprintf(fp, "# extended light flux spillover threshold parameter\n"); + fprintf(fp, "\n"); + fprintf(fp, "spill_efx = %" PRIu32 "\n", cfg->spill_efx); + fprintf(fp, "\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + } + if (needed_pars.ecob) { + fprintf(fp, "# extended center of brightness compression parameter\n"); + fprintf(fp, "\n"); + fprintf(fp, "cmp_par_ecob = %" PRIu32 "\n", cfg->cmp_par_ecob); + fprintf(fp, "\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + fprintf(fp, "# extended center of brightness spillover threshold parameter\n"); + fprintf(fp, "\n"); + fprintf(fp, "spill_ecob = %" PRIu32 "\n", cfg->spill_ecob); + fprintf(fp, "\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + } + if (needed_pars.fx_cob_variance) { + fprintf(fp, "# flux/COB variance compression parameter\n"); + fprintf(fp, "\n"); + fprintf(fp, "cmp_par_fx_cob_variance = %" PRIu32 "\n", cfg->cmp_par_fx_cob_variance); + fprintf(fp, "\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + fprintf(fp, "# flux/COB variance spillover threshold parameter\n"); + fprintf(fp, "\n"); + fprintf(fp, "spill_fx_cob_variance = %" PRIu32 "\n", cfg->spill_fx_cob_variance); + fprintf(fp, "\n"); + fprintf(fp, "#-------------------------------------------------------------------------------\n"); + } } } @@ -1662,12 +1792,11 @@ static void write_cfg_internal(FILE *fp, const struct cmp_cfg *cfg, int rdcu_cfg * @brief prints config struct * * @param cfg configuration to print - * @param rdcu_cfg if set additional RDCU parameter are printed as well */ -void print_cfg(const struct cmp_cfg *cfg, int rdcu_cfg) +void cmp_cfg_print(const struct cmp_cfg *cfg) { - write_cfg_internal(stdout, cfg, rdcu_cfg); + write_cfg_internal(stdout, cfg); } @@ -1676,14 +1805,12 @@ void print_cfg(const struct cmp_cfg *cfg, int rdcu_cfg) * * @param cfg configuration to print * @param output_prefix prefix of the written file (.cfg is added to the prefix) - * @param rdcu_cfg if non-zero additional RDCU parameter are printed as well * @param verbose print verbose output if not zero * * @returns 0 on success, error otherwise */ -int write_cfg(const struct cmp_cfg *cfg, const char *output_prefix, int rdcu_cfg, - int verbose) +int cmp_cfg_fo_file(const struct cmp_cfg *cfg, const char *output_prefix, int verbose) { FILE *fp = open_file(output_prefix, ".cfg"); @@ -1693,12 +1820,13 @@ int write_cfg(const struct cmp_cfg *cfg, const char *output_prefix, int rdcu_cfg return -1; } - write_cfg_internal(fp, cfg, rdcu_cfg); + write_cfg_internal(fp, cfg); fclose(fp); if (verbose) - print_cfg(cfg, rdcu_cfg); + cmp_cfg_print(cfg); + return 0; } @@ -1714,8 +1842,8 @@ int write_cfg(const struct cmp_cfg *cfg, const char *output_prefix, int rdcu_cfg * @returns 0 on success, error otherwise */ -int write_info(const struct cmp_info *info, const char *output_prefix, - int rdcu_cfg) +int cmp_info_to_file(const struct cmp_info *info, const char *output_prefix, + int rdcu_cfg) { FILE *fp = open_file(output_prefix, ".info"); @@ -1735,27 +1863,27 @@ int write_info(const struct cmp_info *info, const char *output_prefix, fprintf(fp, "# 3: model mode with multi escape symbol mechanism\n"); fprintf(fp, "# 4: 1d differencing mode without input model multi escape symbol mechanism\n"); fprintf(fp, "\n"); - fprintf(fp, "cmp_mode_used = %u\n", info->cmp_mode_used); + fprintf(fp, "cmp_mode_used = %" PRIu32 "\n", info->cmp_mode_used); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); fprintf(fp, "# Number of samples used, measured in 16 bit units, length of the data and model buffer\n"); fprintf(fp, "\n"); - fprintf(fp, "samples_used = %u\n", info->samples_used); + fprintf(fp, "samples_used = %" PRIu32 "\n", info->samples_used); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); fprintf(fp, "# Compressed data size; measured in bits\n"); fprintf(fp, "\n"); - fprintf(fp, "cmp_size = %u\n", info->cmp_size); + fprintf(fp, "cmp_size = %" PRIu32 "\n", info->cmp_size); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); fprintf(fp, "# Golomb parameter used\n"); fprintf(fp, "\n"); - fprintf(fp, "golomb_par_used = %u\n", info->golomb_par_used); + fprintf(fp, "golomb_par_used = %" PRIu32 "\n", info->golomb_par_used); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); fprintf(fp, "# Spillover threshold used\n"); fprintf(fp, "\n"); - fprintf(fp, "spill_used = %u\n", info->spill_used); + fprintf(fp, "spill_used = %" PRIu32 "\n", info->spill_used); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); fprintf(fp, "# Model weighting parameter used\n"); @@ -1777,22 +1905,22 @@ int write_info(const struct cmp_info *info, const char *output_prefix, fprintf(fp, "\n"); fprintf(fp, "# Adaptive compressed data size 1; measured in bits\n"); fprintf(fp, "\n"); - fprintf(fp, "ap1_cmp_size = %u\n", info->ap1_cmp_size); + fprintf(fp, "ap1_cmp_size = %" PRIu32 "\n", info->ap1_cmp_size); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); fprintf(fp, "# Adaptive compressed data size 2; measured in bits\n"); fprintf(fp, "\n"); - fprintf(fp, "ap2_cmp_size = %u\n", info->ap2_cmp_size); + fprintf(fp, "ap2_cmp_size = %" PRIu32 "\n", info->ap2_cmp_size); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); fprintf(fp, "# Updated model info start address used\n"); fprintf(fp, "\n"); - fprintf(fp, "rdcu_new_model_adr_used = 0x%06X\n", info->rdcu_new_model_adr_used); + fprintf(fp, "rdcu_new_model_adr_used = 0x%06"PRIX32"\n", info->rdcu_new_model_adr_used); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); fprintf(fp, " #RDCU compressed data start address\n"); fprintf(fp, "\n"); - fprintf(fp, "rdcu_cmp_adr_used = 0x%06X\n", info->rdcu_cmp_adr_used); + fprintf(fp, "rdcu_cmp_adr_used = 0x%06"PRIX32"\n", info->rdcu_cmp_adr_used); fprintf(fp, "\n"); fprintf(fp, "#-------------------------------------------------------------------------------\n"); } diff --git a/lib/cmp_rdcu.c b/lib/cmp_rdcu.c index 6a7354573e94d64a5e5b982c01ac71f979e5a6ee..e50fee6420d4fab2ff434025d6a3b70ae41f8117 100644 --- a/lib/cmp_rdcu.c +++ b/lib/cmp_rdcu.c @@ -1,6 +1,6 @@ /** * @file cmp_rdcu.c - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at), + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) * @date 2019 * * @copyright GPLv2 @@ -26,14 +26,13 @@ * rdcu_compress_data() function. */ + #include <stdint.h> #include <stdio.h> -#include <string.h> -#include <rdcu_cmd.h> #include <cmp_debug.h> #include <cmp_support.h> -#include <cmp_data_types.h> +#include <cmp_rdcu_cfg.h> #include <rdcu_ctrl.h> #include <rdcu_rmap.h> @@ -80,489 +79,6 @@ static void sync(void) } -/** - * @brief check if the compression data product type, compression mode, model - * value and the lossy rounding parameters are valid for an RDCU compression - * - * @param cfg pointer to a compression configuration containing the compression - * data product type, compression mode, model value and the rounding parameters - * - * @returns 0 if the compression data type, compression mode, model value and - * the lossy rounding parameters are valid for an RDCU compression, non-zero - * if parameters are invalid - */ - -static int rdcu_cfg_gen_par_is_invalid(const struct cmp_cfg *cfg) -{ - int cfg_invalid = 0; - - if (!cfg) - return -1; - - if (!cmp_imagette_data_type_is_used(cfg->data_type)) { - debug_print("Error: The selected compression data type is not supported for RDCU compression"); - cfg_invalid++; - } - - if (cfg->cmp_mode > MAX_RDCU_CMP_MODE) { - debug_print("Error: selected cmp_mode: %u is not supported. Largest supported mode is: %u.\n", - cfg->cmp_mode, MAX_RDCU_CMP_MODE); - cfg_invalid++; - } - - if (cfg->model_value > MAX_MODEL_VALUE) { - debug_print("Error: selected model_value: %u is invalid. Largest supported value is: %u.\n", - cfg->model_value, MAX_MODEL_VALUE); - cfg_invalid++; - } - - if (cfg->round > MAX_RDCU_ROUND) { - debug_print("Error: selected round parameter: %u is not supported. Largest supported value is: %u.\n", - cfg->round, MAX_RDCU_ROUND); - cfg_invalid++; - } - -#ifdef SKIP_CMP_PAR_CHECK - return 0; -#endif - - return -cfg_invalid; -} - - -/** - * @brief create an RDCU compression configuration - * - * @param data_type compression data product type - * @param cmp_mode compression mode - * @param model_value model weighting parameter (only needed for model compression mode) - * @param lossy_par lossy rounding parameter (use CMP_LOSSLESS for lossless compression) - * - * @returns a compression configuration containing the chosen parameters; - * on error the data_type record is set to DATA_TYPE_UNKNOWN - */ - -struct cmp_cfg rdcu_cfg_create(enum cmp_data_type data_type, enum cmp_mode cmp_mode, - uint32_t model_value, uint32_t lossy_par) -{ - struct cmp_cfg cfg; - - memset(&cfg, 0, sizeof(cfg)); - - cfg.data_type = data_type; - cfg.cmp_mode = cmp_mode; - cfg.model_value = model_value; - cfg.round = lossy_par; - - if (rdcu_cfg_gen_par_is_invalid(&cfg)) - cfg.data_type = DATA_TYPE_UNKNOWN; - - return cfg; -} - - -/** - * @brief check if a buffer is in inside the RDCU SRAM - * - * @param addr start address of the buffer - * @param size length of the buffer in bytes - * - * @returns 1 if buffer in inside the RDCU SRAM, 0 when the buffer is outside - */ - -static int in_sram_range(uint32_t addr, uint32_t size) -{ - if (addr > RDCU_SRAM_END) - return 0; - - if (size > RDCU_SRAM_SIZE) - return 0; - - if (addr + size > RDCU_SRAM_END) - return 0; - - return 1; -} - - -/** - * @brief check if two buffers are overlapping - * @note implement according to https://stackoverflow.com/a/325964 - * - * @param start_a start address of the 1st buffer - * @param end_a end address of the 1st buffer - * @param start_b start address of the 2nd buffer - * @param end_b end address of the 2nd buffer - * - * @returns 0 if buffers are not overlapping, otherwise buffer are - * overlapping - */ - -static int buffers_overlap(uint32_t start_a, uint32_t end_a, uint32_t start_b, - uint32_t end_b) -{ - if (start_a < end_b && end_a > start_b) - return 1; - else - return 0; -} - - -/** - * @brief check if RDCU buffer settings are invalid - * - * @param cfg a pointer to a compression configuration - * - * @returns 0 if buffers configuration is valid, otherwise the configuration is - * invalid - */ - -static int rdcu_cfg_buffers_is_invalid(const struct cmp_cfg *cfg) -{ - int cfg_invalid = 0; - - if (cfg->cmp_mode == CMP_MODE_RAW) { - if (cfg->buffer_length < cfg->samples) { - debug_print("rdcu_buffer_length is smaller than samples parameter. There is not enough space to copy the data in RAW mode.\n"); - cfg_invalid++; - } - } - - if (cfg->rdcu_data_adr & 0x3) { - debug_print("Error: The RDCU data to compress start address is not 4-Byte aligned.\n"); - cfg_invalid++; - } - - if (cfg->rdcu_buffer_adr & 0x3) { - debug_print("Error: The RDCU compressed data start address is not 4-Byte aligned.\n"); - cfg_invalid++; - } - - if (!in_sram_range(cfg->rdcu_data_adr, cfg->samples * IMA_SAM2BYT)) { - debug_print("Error: The RDCU data to compress buffer is outside the RDCU SRAM address space.\n"); - cfg_invalid++; - } - - if (!in_sram_range(cfg->rdcu_buffer_adr, cfg->buffer_length * IMA_SAM2BYT)) { - debug_print("Error: The RDCU compressed data buffer is outside the RDCU SRAM address space.\n"); - cfg_invalid++; - } - - if (buffers_overlap(cfg->rdcu_data_adr, - cfg->rdcu_data_adr + cfg->samples * IMA_SAM2BYT, - cfg->rdcu_buffer_adr, - cfg->rdcu_buffer_adr + cfg->buffer_length * IMA_SAM2BYT)) { - debug_print("Error: The RDCU data to compress buffer and the RDCU compressed data buffer are overlapping.\n"); - cfg_invalid++; - } - - if (model_mode_is_used(cfg->cmp_mode)) { - if (cfg->model_buf && cfg->model_buf == cfg->input_buf) { - debug_print("Error: The model buffer (model_buf) and the data to be compressed (input_buf) are equal."); - cfg_invalid++; - } - - if (cfg->rdcu_model_adr & 0x3) { - debug_print("Error: The RDCU model start address is not 4-Byte aligned.\n"); - cfg_invalid++; - } - - if (!in_sram_range(cfg->rdcu_model_adr, cfg->samples * IMA_SAM2BYT)) { - debug_print("Error: The RDCU model buffer is outside the RDCU SRAM address space.\n"); - cfg_invalid++; - } - - if (buffers_overlap( - cfg->rdcu_model_adr, - cfg->rdcu_model_adr + cfg->samples * IMA_SAM2BYT, - cfg->rdcu_data_adr, - cfg->rdcu_data_adr + cfg->samples * IMA_SAM2BYT)) { - debug_print("Error: The model buffer and the data to compress buffer are overlapping.\n"); - cfg_invalid++; - } - - if (buffers_overlap( - cfg->rdcu_model_adr, - cfg->rdcu_model_adr + cfg->samples * IMA_SAM2BYT, - cfg->rdcu_buffer_adr, - cfg->rdcu_buffer_adr + cfg->buffer_length * IMA_SAM2BYT) - ) { - debug_print("Error: The model buffer and the compressed data buffer are overlapping.\n"); - cfg_invalid++; - } - - if (cfg->rdcu_model_adr != cfg->rdcu_new_model_adr) { - if (cfg->rdcu_new_model_adr & 0x3) { - debug_print("Error: The RDCU updated model start address (rdcu_new_model_adr) is not 4-Byte aligned.\n"); - cfg_invalid++; - } - - if (!in_sram_range(cfg->rdcu_new_model_adr, - cfg->samples * IMA_SAM2BYT)) { - debug_print("Error: The RDCU updated model buffer is outside the RDCU SRAM address space.\n"); - cfg_invalid++; - } - - if (buffers_overlap( - cfg->rdcu_new_model_adr, - cfg->rdcu_new_model_adr + cfg->samples * IMA_SAM2BYT, - cfg->rdcu_data_adr, - cfg->rdcu_data_adr + cfg->samples * IMA_SAM2BYT) - ) { - debug_print("Error: The updated model buffer and the data to compress buffer are overlapping.\n"); - cfg_invalid++; - } - - if (buffers_overlap( - cfg->rdcu_new_model_adr, - cfg->rdcu_new_model_adr + cfg->samples * IMA_SAM2BYT, - cfg->rdcu_buffer_adr, - cfg->rdcu_buffer_adr + cfg->buffer_length * IMA_SAM2BYT) - ) { - debug_print("Error: The updated model buffer and the compressed data buffer are overlapping.\n"); - cfg_invalid++; - } - if (buffers_overlap( - cfg->rdcu_new_model_adr, - cfg->rdcu_new_model_adr + cfg->samples * IMA_SAM2BYT, - cfg->rdcu_model_adr, - cfg->rdcu_model_adr + cfg->samples * IMA_SAM2BYT) - ) { - debug_print("Error: The updated model buffer and the model buffer are overlapping.\n"); - cfg_invalid++; - } - } - } - - if (cfg->icu_new_model_buf) - debug_print("Warning: ICU updated model buffer is set. This buffer is not used for an RDCU compression.\n"); - - if (cfg->icu_output_buf) - debug_print("Warning: ICU compressed data buffer is set. This buffer is not used for an RDCU compression.\n"); - -#ifdef SKIP_CMP_PAR_CHECK - return 0; -#endif - return -cfg_invalid; -} - - -/** - * @brief setup of the different data buffers for an RDCU compression - * - * @param cfg pointer to a compression configuration (created - * with the rdcu_cfg_create() function) - * @param data_to_compress pointer to the data to be compressed (if NULL no - * data transfer to the RDCU) - * @param data_samples length of the data to be compressed measured in - * 16-bit data samples (ignoring the collection header) - * @param model_of_data pointer to model data buffer (only needed for - * model compression mode, if NULL no model data - * transfer to the RDCU) - * @param rdcu_data_adr RDCU SRAM data to compress start address - * @param rdcu_model_adr RDCU SRAM model start address (only need for - * model compression mode) - * @param rdcu_new_model_adr RDCU SRAM new/updated model start address(can be the - * by the same as rdcu_model_adr for in-place model update) - * @param rdcu_buffer_adr RDCU SRAM compressed data start address - * @param rdcu_buffer_lenght length of the RDCU compressed data SRAM buffer - * measured in 16-bit units (same as data_samples) - * - * @returns 0 if parameters are valid, non-zero if parameters are invalid - */ - -int rdcu_cfg_buffers(struct cmp_cfg *cfg, uint16_t *data_to_compress, - uint32_t data_samples, uint16_t *model_of_data, - uint32_t rdcu_data_adr, uint32_t rdcu_model_adr, - uint32_t rdcu_new_model_adr, uint32_t rdcu_buffer_adr, - uint32_t rdcu_buffer_lenght) -{ - if (!cfg) { - debug_print("Error: pointer to the compression configuration structure is NULL.\n"); - return -1; - } - - cfg->input_buf = data_to_compress; - cfg->samples = data_samples; - cfg->model_buf = model_of_data; - cfg->rdcu_data_adr = rdcu_data_adr; - cfg->rdcu_model_adr = rdcu_model_adr; - cfg->rdcu_new_model_adr = rdcu_new_model_adr; - cfg->rdcu_buffer_adr = rdcu_buffer_adr; - cfg->buffer_length = rdcu_buffer_lenght; - - if (rdcu_cfg_buffers_is_invalid(cfg)) - return -1; - - return 0; -} - - -/** - * @brief check if the Golomb and spillover threshold parameter combination is - * invalid for an RDCU compression - * @note also checked the adaptive Golomb and spillover threshold parameter combinations - * - * @param cfg a pointer to a compression configuration - * - * @returns 0 if (adaptive) Golomb spill threshold parameter combinations are - * valid, otherwise the configuration is invalid - */ - -static int rdcu_cfg_imagette_is_invalid(const struct cmp_cfg *cfg) -{ - int cfg_invalid = 0; - - if (cfg->golomb_par < MIN_IMA_GOLOMB_PAR || - cfg->golomb_par > MAX_IMA_GOLOMB_PAR) { - debug_print("Error: The selected Golomb parameter: %u is not supported. The Golomb parameter has to be between [%u, %u].\n", - cfg->golomb_par, MIN_IMA_GOLOMB_PAR, MAX_IMA_GOLOMB_PAR); - cfg_invalid++; - } - - if (cfg->ap1_golomb_par < MIN_IMA_GOLOMB_PAR || - cfg->ap1_golomb_par > MAX_IMA_GOLOMB_PAR) { - debug_print("Error: The selected adaptive 1 Golomb parameter: %u is not supported. The Golomb parameter has to be between [%u, %u].\n", - cfg->ap1_golomb_par, MIN_IMA_GOLOMB_PAR, MAX_IMA_GOLOMB_PAR); - cfg_invalid++; - } - - if (cfg->ap2_golomb_par < MIN_IMA_GOLOMB_PAR || - cfg->ap2_golomb_par > MAX_IMA_GOLOMB_PAR) { - debug_print("Error: The selected adaptive 2 Golomb parameter: %u is not supported. The Golomb parameter has to be between [%u, %u].\n", - cfg->ap2_golomb_par, MIN_IMA_GOLOMB_PAR, MAX_IMA_GOLOMB_PAR); - cfg_invalid++; - } - - if (cfg->spill < MIN_IMA_SPILL) { - debug_print("Error: The selected spillover threshold value: %u is too small. Smallest possible spillover value is: %u.\n", - cfg->spill, MIN_IMA_SPILL); - cfg_invalid++; - } - - if (cfg->spill > cmp_ima_max_spill(cfg->golomb_par)) { - debug_print("Error: The selected spillover threshold value: %u is too large for the selected Golomb parameter: %u, the largest possible spillover value is: %u.\n", - cfg->spill, cfg->golomb_par, cmp_ima_max_spill(cfg->golomb_par)); - cfg_invalid++; - } - - if (cfg->ap1_spill < MIN_IMA_SPILL) { - debug_print("Error: The selected adaptive 1 spillover threshold value: %u is too small. Smallest possible spillover value is: %u.\n", - cfg->ap1_spill, MIN_IMA_SPILL); - cfg_invalid++; - } - - if (cfg->ap1_spill > cmp_ima_max_spill(cfg->ap1_golomb_par)) { - debug_print("Error: The selected adaptive 1 spillover threshold value: %u is too large for the selected adaptive 1 Golomb parameter: %u, the largest possible adaptive 1 spillover value is: %u.\n", - cfg->ap1_spill, cfg->ap1_golomb_par, cmp_ima_max_spill(cfg->ap1_golomb_par)); - cfg_invalid++; - } - - if (cfg->ap2_spill < MIN_IMA_SPILL) { - debug_print("Error: The selected adaptive 2 spillover threshold value: %u is too small. Smallest possible spillover value is: %u.\n", - cfg->ap2_spill, MIN_IMA_SPILL); - cfg_invalid++; - } - - if (cfg->ap2_spill > cmp_ima_max_spill(cfg->ap2_golomb_par)) { - debug_print("Error: The selected adaptive 2 spillover threshold value: %u is too large for the selected adaptive 2 Golomb parameter: %u, the largest possible adaptive 2 spillover value is: %u.\n", - cfg->ap2_spill, cfg->ap2_golomb_par, cmp_ima_max_spill(cfg->ap2_golomb_par)); - cfg_invalid++; - } - -#ifdef SKIP_CMP_PAR_CHECK - return 0; -#endif - - return -cfg_invalid; -} - - -/** - * @brief set up the configuration parameters for an RDCU imagette compression - * - * @param cfg pointer to a compression configuration (created - * with the rdcu_cfg_create() function) - * @param golomb_par imagette compression parameter - * @param spillover_par imagette spillover threshold parameter - * @param ap1_golomb_par adaptive 1 imagette compression parameter - * @param ap1_spillover_par adaptive 1 imagette spillover threshold parameter - * @param ap2_golomb_par adaptive 2 imagette compression parameter - * @param ap2_spillover_par adaptive 2 imagette spillover threshold parameter - * - * @returns 0 if parameters are valid, non-zero if parameters are invalid - */ - -int rdcu_cfg_imagette(struct cmp_cfg *cfg, - uint32_t golomb_par, uint32_t spillover_par, - uint32_t ap1_golomb_par, uint32_t ap1_spillover_par, - uint32_t ap2_golomb_par, uint32_t ap2_spillover_par) -{ - if (!cfg) { - debug_print("Error: pointer to the compression configuration structure is NULL.\n"); - return -1; - } - - cfg->golomb_par = golomb_par; - cfg->spill = spillover_par; - cfg->ap1_golomb_par = ap1_golomb_par; - cfg->ap1_spill = ap1_spillover_par; - cfg->ap2_golomb_par = ap2_golomb_par; - cfg->ap2_spill = ap2_spillover_par; - - if (rdcu_cfg_imagette_is_invalid(cfg)) - return -1; - - return 0; -} - - -/** - * @brief check if the compressor configuration is invalid for an RDCU compression, - * see the user manual for more information (PLATO-UVIE-PL-UM-0001). - * - * @param cfg pointer to a compression configuration contains all parameters - * required for compression - * - * @returns 0 if parameters are valid, non-zero if parameters are invalid - */ - -int rdcu_cmp_cfg_is_invalid(const struct cmp_cfg *cfg) -{ - int cfg_invalid = 0; - - if (!cfg) { - debug_print("Error: pointer to the compression configuration structure is NULL.\n"); - return -1; - } - - if (!cfg->input_buf) - debug_print("Warning: The data to compress buffer is set to NULL. No data will be transferred to the rdcu_data_adr in the RDCU-SRAM.\n"); - - if (model_mode_is_used(cfg->cmp_mode)) { - if (!cfg->model_buf) - debug_print("Warning: The model buffer is set to NULL. No model data will be transferred to the rdcu_model_adr in the RDCU-SRAM.\n"); - } - - if (cfg->input_buf && cfg->samples == 0) - debug_print("Warning: The samples parameter is set to 0. No data will be compressed.\n"); - - if (cfg->buffer_length == 0) { - debug_print("Error: The buffer_length is set to 0. There is no place to store the compressed data.\n"); - cfg_invalid++; - } - - if (rdcu_cfg_gen_par_is_invalid(cfg)) - cfg_invalid++; - if (rdcu_cfg_buffers_is_invalid(cfg)) - cfg_invalid++; - if (rdcu_cfg_imagette_is_invalid(cfg)) - cfg_invalid++; - - return -cfg_invalid; -} - - /** * @brief set up RDCU compression register * @@ -974,7 +490,7 @@ int rdcu_compress_data_parallel(const struct cmp_cfg *cfg, cmp_size_4byte = ((last_info->cmp_size >> 3) + 3) & ~0x3U; /* parallel read compressed data and write input data from sram - * to mirror*/ + * to mirror */ if (rdcu_sync_sram_mirror_parallel(last_info->rdcu_cmp_adr_used, cmp_size_4byte, cfg->rdcu_data_adr, samples_4byte, rdcu_get_data_mtu())) diff --git a/lib/cmp_rdcu_cfg.c b/lib/cmp_rdcu_cfg.c new file mode 100644 index 0000000000000000000000000000000000000000..750a35e36a0484ee6929111b77b40768f43a04e7 --- /dev/null +++ b/lib/cmp_rdcu_cfg.c @@ -0,0 +1,374 @@ +/** + * @file cmp_rdcu_cfg.c + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) + * @date 2020 + * + * @copyright GPLv2 + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * @brief hardware compressor configuration library + * @see Data Compression User Manual PLATO-UVIE-PL-UM-0001 + */ + + +#include <stdint.h> +#include <string.h> + +#include <cmp_debug.h> +#include <cmp_support.h> +#include <rdcu_cmd.h> + + +#define IMA_SAM2BYT \ +2 /* imagette sample to byte conversion factor; one imagette samples has 16 bits (2 bytes) */ + + +/** + * @brief create an RDCU compression configuration + * + * @param data_type compression data product type + * @param cmp_mode compression mode + * @param model_value model weighting parameter (only needed for model compression mode) + * @param lossy_par lossy rounding parameter (use CMP_LOSSLESS for lossless compression) + * + * @returns a compression configuration containing the chosen parameters; + * on error the data_type record is set to DATA_TYPE_UNKNOWN + */ + +struct cmp_cfg rdcu_cfg_create(enum cmp_data_type data_type, enum cmp_mode cmp_mode, + uint32_t model_value, uint32_t lossy_par) +{ + struct cmp_cfg cfg; + + memset(&cfg, 0, sizeof(cfg)); + + cfg.data_type = data_type; + cfg.cmp_mode = cmp_mode; + cfg.model_value = model_value; + cfg.round = lossy_par; + + if (cmp_cfg_gen_par_is_invalid(&cfg, RDCU_CHECK)) + cfg.data_type = DATA_TYPE_UNKNOWN; + + return cfg; +} + + +/** + * @brief check if a buffer is in outside the RDCU SRAM + * + * @param addr start address of the buffer + * @param size length of the buffer in bytes + * + * @returns 0 if buffer in inside the RDCU SRAM, 1 when the buffer is outside + */ + +static int outside_sram_range(uint32_t addr, uint32_t size) +{ + if (addr + size > RDCU_SRAM_END) + return 1; + + if (addr > RDCU_SRAM_END) + return 1; + + if (size > RDCU_SRAM_SIZE) + return 1; + + return 0; +} + + +/** + * @brief check if two buffers are overlapping + * @note implement according to https://stackoverflow.com/a/325964 + * + * @param start_a start address of the 1st buffer + * @param end_a end address of the 1st buffer + * @param start_b start address of the 2nd buffer + * @param end_b end address of the 2nd buffer + * + * @returns 0 if buffers are not overlapping, otherwise buffer are + * overlapping + */ + +static int buffers_overlap(uint32_t start_a, uint32_t end_a, uint32_t start_b, + uint32_t end_b) +{ + if (start_a < end_b && end_a > start_b) + return 1; + else + return 0; +} + + +/** + * @brief check if RDCU buffer settings are invalid + * + * @param cfg a pointer to a compression configuration + * + * @returns 0 if buffers configuration is valid, otherwise the configuration is + * invalid + */ + +static int rdcu_cfg_buffers_is_invalid(const struct cmp_cfg *cfg) +{ + int cfg_invalid = 0; + + if (cfg->cmp_mode == CMP_MODE_RAW) { + if (cfg->buffer_length < cfg->samples) { + debug_print("rdcu_buffer_length is smaller than the samples parameter. There is not enough space to copy the data in RAW mode.\n"); + cfg_invalid++; + } + } + + if (cfg->rdcu_data_adr & 0x3) { + debug_print("Error: The RDCU data to compress start address is not 4-Byte aligned.\n"); + cfg_invalid++; + } + + if (cfg->rdcu_buffer_adr & 0x3) { + debug_print("Error: The RDCU compressed data start address is not 4-Byte aligned.\n"); + cfg_invalid++; + } + + if (outside_sram_range(cfg->rdcu_data_adr, cfg->samples * IMA_SAM2BYT)) { + debug_print("Error: The RDCU data to compress buffer is outside the RDCU SRAM address space.\n"); + cfg_invalid++; + } + + if (outside_sram_range(cfg->rdcu_buffer_adr, cfg->buffer_length * IMA_SAM2BYT)) { + debug_print("Error: The RDCU compressed data buffer is outside the RDCU SRAM address space.\n"); + cfg_invalid++; + } + + if (buffers_overlap(cfg->rdcu_data_adr, + cfg->rdcu_data_adr + cfg->samples * IMA_SAM2BYT, + cfg->rdcu_buffer_adr, + cfg->rdcu_buffer_adr + cfg->buffer_length * IMA_SAM2BYT)) { + debug_print("Error: The RDCU data to compress buffer and the RDCU compressed data buffer are overlapping.\n"); + cfg_invalid++; + } + + if (model_mode_is_used(cfg->cmp_mode)) { + if (cfg->model_buf && cfg->model_buf == cfg->input_buf) { + debug_print("Error: The model buffer (model_buf) and the data to be compressed (input_buf) are equal.\n"); + cfg_invalid++; + } + + if (cfg->rdcu_model_adr & 0x3) { + debug_print("Error: The RDCU model start address is not 4-Byte aligned.\n"); + cfg_invalid++; + } + + if (outside_sram_range(cfg->rdcu_model_adr, cfg->samples * IMA_SAM2BYT)) { + debug_print("Error: The RDCU model buffer is outside the RDCU SRAM address space.\n"); + cfg_invalid++; + } + + if (buffers_overlap( + cfg->rdcu_model_adr, + cfg->rdcu_model_adr + cfg->samples * IMA_SAM2BYT, + cfg->rdcu_data_adr, + cfg->rdcu_data_adr + cfg->samples * IMA_SAM2BYT)) { + debug_print("Error: The model buffer and the data to compress buffer are overlapping.\n"); + cfg_invalid++; + } + + if (buffers_overlap( + cfg->rdcu_model_adr, + cfg->rdcu_model_adr + cfg->samples * IMA_SAM2BYT, + cfg->rdcu_buffer_adr, + cfg->rdcu_buffer_adr + cfg->buffer_length * IMA_SAM2BYT) + ) { + debug_print("Error: The model buffer and the compressed data buffer are overlapping.\n"); + cfg_invalid++; + } + + if (cfg->rdcu_model_adr != cfg->rdcu_new_model_adr) { + if (cfg->rdcu_new_model_adr & 0x3) { + debug_print("Error: The RDCU updated model start address (rdcu_new_model_adr) is not 4-Byte aligned.\n"); + cfg_invalid++; + } + + if (outside_sram_range(cfg->rdcu_new_model_adr, + cfg->samples * IMA_SAM2BYT)) { + debug_print("Error: The RDCU updated model buffer is outside the RDCU SRAM address space.\n"); + cfg_invalid++; + } + + if (buffers_overlap( + cfg->rdcu_new_model_adr, + cfg->rdcu_new_model_adr + cfg->samples * IMA_SAM2BYT, + cfg->rdcu_data_adr, + cfg->rdcu_data_adr + cfg->samples * IMA_SAM2BYT) + ) { + debug_print("Error: The updated model buffer and the data to compress buffer are overlapping.\n"); + cfg_invalid++; + } + + if (buffers_overlap( + cfg->rdcu_new_model_adr, + cfg->rdcu_new_model_adr + cfg->samples * IMA_SAM2BYT, + cfg->rdcu_buffer_adr, + cfg->rdcu_buffer_adr + cfg->buffer_length * IMA_SAM2BYT) + ) { + debug_print("Error: The updated model buffer and the compressed data buffer are overlapping.\n"); + cfg_invalid++; + } + if (buffers_overlap( + cfg->rdcu_new_model_adr, + cfg->rdcu_new_model_adr + cfg->samples * IMA_SAM2BYT, + cfg->rdcu_model_adr, + cfg->rdcu_model_adr + cfg->samples * IMA_SAM2BYT) + ) { + debug_print("Error: The updated model buffer and the model buffer are overlapping.\n"); + cfg_invalid++; + } + } + } + +#ifdef SKIP_CMP_PAR_CHECK + return 0; +#endif + return cfg_invalid; +} + + +/** + * @brief setup of the different data buffers for an RDCU compression + * + * @param cfg pointer to a compression configuration (created + * with the rdcu_cfg_create() function) + * @param data_to_compress pointer to the data to be compressed (if NULL no + * data transfer to the RDCU) + * @param data_samples length of the data to be compressed (plus the + * collection header) measured in 16-bit data samples + * @param model_of_data pointer to the model data buffer (only needed for + * model compression mode, if NULL no model data is + * transferred to the RDCU) + * @param rdcu_data_adr RDCU SRAM data to compress start address + * @param rdcu_model_adr RDCU SRAM model start address (only needed for + * model compression mode) + * @param rdcu_new_model_adr RDCU SRAM new/updated model start address (can be + * the same as rdcu_model_adr for in-place model update) + * @param rdcu_buffer_adr RDCU SRAM compressed data start address + * @param rdcu_buffer_lenght length of the RDCU compressed data SRAM buffer + * measured in 16-bit units (same as data_samples) + * + * @returns 0 if parameters are valid, non-zero if parameters are invalid + */ + +int rdcu_cfg_buffers(struct cmp_cfg *cfg, uint16_t *data_to_compress, + uint32_t data_samples, uint16_t *model_of_data, + uint32_t rdcu_data_adr, uint32_t rdcu_model_adr, + uint32_t rdcu_new_model_adr, uint32_t rdcu_buffer_adr, + uint32_t rdcu_buffer_lenght) +{ + if (!cfg) { + debug_print("Error: pointer to the compression configuration structure is NULL.\n"); + return -1; + } + + cfg->input_buf = data_to_compress; + cfg->samples = data_samples; + cfg->model_buf = model_of_data; + cfg->rdcu_data_adr = rdcu_data_adr; + cfg->rdcu_model_adr = rdcu_model_adr; + cfg->rdcu_new_model_adr = rdcu_new_model_adr; + cfg->rdcu_buffer_adr = rdcu_buffer_adr; + cfg->buffer_length = rdcu_buffer_lenght; + + return rdcu_cfg_buffers_is_invalid(cfg); +} + + +/** + * @brief set up the configuration parameters for an RDCU imagette compression + * + * @param cfg pointer to a compression configuration (created + * with the rdcu_cfg_create() function) + * @param golomb_par imagette compression parameter + * @param spillover_par imagette spillover threshold parameter + * @param ap1_golomb_par adaptive 1 imagette compression parameter + * @param ap1_spillover_par adaptive 1 imagette spillover threshold parameter + * @param ap2_golomb_par adaptive 2 imagette compression parameter + * @param ap2_spillover_par adaptive 2 imagette spillover threshold parameter + * + * @returns 0 if parameters are valid, non-zero if parameters are invalid + */ + +int rdcu_cfg_imagette(struct cmp_cfg *cfg, + uint32_t golomb_par, uint32_t spillover_par, + uint32_t ap1_golomb_par, uint32_t ap1_spillover_par, + uint32_t ap2_golomb_par, uint32_t ap2_spillover_par) +{ + if (!cfg) { + debug_print("Error: pointer to the compression configuration structure is NULL.\n"); + return -1; + } + + cfg->golomb_par = golomb_par; + cfg->spill = spillover_par; + cfg->ap1_golomb_par = ap1_golomb_par; + cfg->ap1_spill = ap1_spillover_par; + cfg->ap2_golomb_par = ap2_golomb_par; + cfg->ap2_spill = ap2_spillover_par; + + return cmp_cfg_imagette_is_invalid(cfg, RDCU_CHECK); +} + + +/** + * @brief check if the compressor configuration is invalid for an RDCU compression, + * see the user manual for more information (PLATO-UVIE-PL-UM-0001). + * + * @param cfg pointer to a compression configuration contains all parameters + * required for compression + * + * @returns 0 if parameters are valid, non-zero if parameters are invalid + */ + +int rdcu_cmp_cfg_is_invalid(const struct cmp_cfg *cfg) +{ + int cfg_invalid = 0; + + if (!cfg) { + debug_print("Error: pointer to the compression configuration structure is NULL.\n"); + return -1; + } + + if (!cfg->input_buf) + debug_print("Warning: The data to compress buffer is set to NULL. No data will be transferred to the rdcu_data_adr in the RDCU SRAM.\n"); + + if (model_mode_is_used(cfg->cmp_mode)) { + if (!cfg->model_buf) + debug_print("Warning: The model buffer is set to NULL. No model data will be transferred to the rdcu_model_adr in the RDCU SRAM.\n"); + } + + if (cfg->samples == 0) + debug_print("Warning: The samples parameter is set to 0. No data will be compressed.\n"); + + if (cfg->icu_new_model_buf) + debug_print("Warning: ICU updated model buffer is set. This buffer is not used for an RDCU compression.\n"); + + if (cfg->icu_output_buf) + debug_print("Warning: ICU compressed data buffer is set. This buffer is not used for an RDCU compression.\n"); + + if (cfg->buffer_length == 0) { + debug_print("Error: The buffer_length is set to 0. There is no place to store the compressed data.\n"); + cfg_invalid++; + } + + cfg_invalid += cmp_cfg_gen_par_is_invalid(cfg, RDCU_CHECK); + cfg_invalid += rdcu_cfg_buffers_is_invalid(cfg); + cfg_invalid += cmp_cfg_imagette_is_invalid(cfg, RDCU_CHECK); + + return cfg_invalid; +} diff --git a/lib/cmp_support.c b/lib/cmp_support.c index 17deeed1809dd0c03be345763ed50b64953e5c8b..dea1e6f2f34bafae8ebb1589fd8aedad0a039e34 100644 --- a/lib/cmp_support.c +++ b/lib/cmp_support.c @@ -1,6 +1,6 @@ /** * @file cmp_support.c - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at), + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) * @date 2019 * * @copyright GPLv2 @@ -20,6 +20,7 @@ #include <cmp_support.h> #include <cmp_debug.h> +#include <my_inttypes.h> /** @@ -62,10 +63,10 @@ int is_a_pow_of_2(unsigned int v) * * @param data_type compression entity data product type to check * - * @returns zero if data_type is invalid; non-zero if data_type is valid + * @returns non-zero if data_type is invalid; zero if data_type is valid */ -int cmp_data_type_valid(enum cmp_data_type data_type) +int cmp_data_type_is_invalid(enum cmp_data_type data_type) { if (data_type == DATA_TYPE_F_CAM_OFFSET) debug_print("Error: DATA_TYPE_F_CAM_OFFSET is TBD and not implemented yet.\n"); @@ -73,9 +74,9 @@ int cmp_data_type_valid(enum cmp_data_type data_type) debug_print("Error: DATA_TYPE_F_CAM_BACKGROUND is TBD and not implemented yet.\n"); if (data_type <= DATA_TYPE_UNKNOWN || data_type > DATA_TYPE_F_CAM_IMAGETTE_ADAPTIVE) - return 0; + return 1; - return 1; + return 0; } @@ -97,24 +98,6 @@ int model_mode_is_used(enum cmp_mode cmp_mode) } -/** - * @brief check if a 1d-differencing mode is selected - * - * @param cmp_mode compression mode - * - * @returns 1 when the 1d-differencing mode is used, otherwise 0 - */ - -int diff_mode_is_used(enum cmp_mode cmp_mode) -{ - if (cmp_mode == CMP_MODE_DIFF_ZERO || - cmp_mode == CMP_MODE_DIFF_MULTI) - return 1; - - return 0; -} - - /** * @brief check if the raw mode is selected * @@ -366,6 +349,7 @@ unsigned int round_inv(unsigned int value, unsigned int round) * @param data data to process * @param model (current) model of the data to process * @param model_value model weighting parameter + * @param round routing parameter * * @returns (new) updated model */ @@ -389,7 +373,7 @@ unsigned int cmp_up_model(unsigned int data, unsigned int model, /** - * @brief get the maximum valid spill threshold value for a RDCU HW imagette + * @brief get the maximum valid spill threshold value for a imagette * compression in diff or model mode * * @param golomb_par Golomb parameter @@ -417,7 +401,7 @@ uint32_t cmp_ima_max_spill(unsigned int golomb_par) /** - * @brief get the maximum valid spill threshold value for a ICU SW compression + * @brief get the maximum valid spill threshold value for a non-imagette compression * in diff or model mode * * @param cmp_par compression parameter @@ -433,7 +417,7 @@ uint32_t cmp_icu_max_spill(unsigned int cmp_par) unsigned int cutoff = (1UL << (ilog_2(cmp_par)+1)) - cmp_par; unsigned int max_n_sym_offset = max_cw_bits/2 - 1; - if (!cmp_par || cmp_par > MAX_ICU_GOLOMB_PAR) + if (!cmp_par || cmp_par > MAX_NON_IMA_GOLOMB_PAR) return 0; return (max_cw_bits-1-ilog_2(cmp_par))*cmp_par + cutoff @@ -458,50 +442,83 @@ unsigned int cmp_bit_to_4byte(unsigned int cmp_size_bit) /** * @brief check if the compression data type, compression mode, model value and - * the lossy rounding parameters are invalid for a ICU compression + * the lossy rounding parameters are invalid for a RDCU or ICU compression * - * @param cfg pointer to the compressor configuration + * @param cfg pointer to a compression configuration containing the compression + * data product type, compression mode, model value and the rounding parameters + * @param opt check options: + * RDCU_CHECK for RDCU compression check + * ICU_CHECK for ICU compression check * - * @returns 0 if generic compression parameters are valid, otherwise invalid + * @returns 0 if the compression data type, compression mode, model value and + * the lossy rounding parameters are valid for an RDCU or ICU compression, + * non-zero if parameters are invalid */ -int cmp_cfg_icu_gen_par_is_invalid(const struct cmp_cfg *cfg) +int cmp_cfg_gen_par_is_invalid(const struct cmp_cfg *cfg, enum check_opt opt) { int cfg_invalid = 0; + int invalid_data_type = 1; + int unsupported_cmp_mode = 1; + int check_model_value = 1; + uint32_t max_round_value = 0; + char *str = ""; if (!cfg) - return 0; + return 1; - if (!cmp_data_type_valid(cfg->data_type)) { - debug_print("Error: selected compression data type is not supported.\n"); + switch (opt) { + case RDCU_CHECK: + /* the RDCU can only compress imagette data */ + invalid_data_type = !cmp_imagette_data_type_is_used(cfg->data_type); + unsupported_cmp_mode = !rdcu_supported_cmp_mode_is_used(cfg->cmp_mode); + max_round_value = MAX_RDCU_ROUND; + /* for the RDCU the model vale has to be always in the allowed range */ + check_model_value = 1; + str = " for a RDCU compression"; + break; + case ICU_CHECK: + invalid_data_type = cmp_data_type_is_invalid(cfg->data_type); + unsupported_cmp_mode = !cmp_mode_is_supported(cfg->cmp_mode); + max_round_value = MAX_ICU_ROUND; + check_model_value = model_mode_is_used(cfg->cmp_mode); + break; + } + + if (invalid_data_type) { + debug_print("Error: selected compression data type is not supported%s.\n", str); cfg_invalid++; } - if (cfg->cmp_mode > CMP_MODE_STUFF) { - debug_print("Error: selected cmp_mode: %i is not supported.\n", cfg->cmp_mode); + if (unsupported_cmp_mode) { + debug_print("Error: selected cmp_mode: %i is not supported%s.\n", cfg->cmp_mode, str); cfg_invalid++; } - if (model_mode_is_used(cfg->cmp_mode)) { + if (check_model_value) { if (cfg->model_value > MAX_MODEL_VALUE) { - debug_print("Error: selected model_value: %u is invalid. Largest supported value is: %u.\n", + debug_print("Error: selected model_value: %" PRIu32 " is invalid. The largest supported value is: %u.\n", cfg->model_value, MAX_MODEL_VALUE); cfg_invalid++; } } - if (cfg->round > MAX_ICU_ROUND) { - debug_print("Error: selected lossy parameter: %u is not supported. Largest supported value is: %u.\n", - cfg->round, MAX_ICU_ROUND); + if (cfg->round > max_round_value) { + debug_print("Error: selected lossy parameter: %" PRIu32 " is not supported%s. The largest supported value is: %" PRIu32 ".\n", + cfg->round, str, max_round_value); cfg_invalid++; } +#ifdef SKIP_CMP_PAR_CHECK + return 0; +#endif + return cfg_invalid; } /** - * @brief check if the buffer parameters are invalid + * @brief check if the ICU buffer parameters are invalid * * @param cfg pointer to the compressor configuration * @@ -513,7 +530,7 @@ int cmp_cfg_icu_buffers_is_invalid(const struct cmp_cfg *cfg) int cfg_invalid = 0; if (!cfg) - return 0; + return 1; if (cfg->input_buf == NULL) { debug_print("Error: The data_to_compress buffer for the data to be compressed is NULL.\n"); @@ -595,9 +612,6 @@ static int cmp_pars_are_invalid(uint32_t cmp_par, uint32_t spill, enum cmp_mode uint32_t min_spill; uint32_t max_spill; - if (!par_name) - par_name = ""; - /* The maximum compression parameter for imagette data are smaller to * fit into the imagette compression entity header */ if (cmp_imagette_data_type_is_used(data_type)) { @@ -606,9 +620,9 @@ static int cmp_pars_are_invalid(uint32_t cmp_par, uint32_t spill, enum cmp_mode min_spill = MIN_IMA_SPILL; max_spill = cmp_ima_max_spill(cmp_par); } else { - min_golomb_par = MIN_ICU_GOLOMB_PAR; - max_golomb_par = MAX_ICU_GOLOMB_PAR; - min_spill = MIN_ICU_SPILL; + min_golomb_par = MIN_NON_IMA_GOLOMB_PAR; + max_golomb_par = MAX_NON_IMA_GOLOMB_PAR; + min_spill = MIN_NON_IMA_SPILL; max_spill = cmp_icu_max_spill(cmp_par); } @@ -622,17 +636,17 @@ static int cmp_pars_are_invalid(uint32_t cmp_par, uint32_t spill, enum cmp_mode case CMP_MODE_MODEL_ZERO: case CMP_MODE_MODEL_MULTI: if (cmp_par < min_golomb_par || cmp_par > max_golomb_par) { - debug_print("Error: The selected %s compression parameter: %u is not supported. The compression parameter has to be between [%u, %u].\n", + debug_print("Error: The selected %s compression parameter: %" PRIu32 " is not supported in the selected compression mode. The compression parameter has to be between [%" PRIu32 ", %" PRIu32 "] in this mode.\n", par_name, cmp_par, min_golomb_par, max_golomb_par); cfg_invalid++; } if (spill < min_spill) { - debug_print("Error: The selected %s spillover threshold value: %u is too small. Smallest possible spillover value is: %u.\n", + debug_print("Error: The selected %s spillover threshold value: %" PRIu32 " is too small. The smallest possible spillover value is: %" PRIu32 ".\n", par_name, spill, min_spill); cfg_invalid++; } if (spill > max_spill) { - debug_print("Error: The selected %s spillover threshold value: %u is too large for the selected %s compression parameter: %u, the largest possible spillover value in the selected compression mode is: %u.\n", + debug_print("Error: The selected %s spillover threshold value: %" PRIu32 " is too large for the selected %s compression parameter: %" PRIu32 ". The largest possible spillover value in the selected compression mode is: %" PRIu32 ".\n", par_name, spill, par_name, cmp_par, max_spill); cfg_invalid++; } @@ -640,7 +654,7 @@ static int cmp_pars_are_invalid(uint32_t cmp_par, uint32_t spill, enum cmp_mode break; case CMP_MODE_STUFF: if (cmp_par > MAX_STUFF_CMP_PAR) { - debug_print("Error: The selected %s stuff mode compression parameter: %u is too large, the largest possible value in the selected compression mode is: %u.\n", + debug_print("Error: The selected %s stuff mode compression parameter: %" PRIu32 " is too large. The largest possible value in the selected compression mode is: %u.\n", par_name, cmp_par, MAX_STUFF_CMP_PAR); cfg_invalid++; } @@ -658,20 +672,21 @@ static int cmp_pars_are_invalid(uint32_t cmp_par, uint32_t spill, enum cmp_mode /** * @brief check if the imagette specific compression parameters are invalid * - * @param cfg pointer to the compressor configuration - * @param rdcu_check set to non-zero if a check for a imagette RDCU compression - * should be done; zero for imagette ICU compression + * @param cfg pointer to a compressor configuration + * @param opt check options: + * RDCU_CHECK for a imagette RDCU compression check + * ICU_CHECK for a imagette ICU compression check * * @returns 0 if the imagette specific parameters are valid, otherwise invalid */ -int cmp_cfg_imagette_is_invalid(const struct cmp_cfg *cfg, int rdcu_check) +int cmp_cfg_imagette_is_invalid(const struct cmp_cfg *cfg, enum check_opt opt) { int cfg_invalid = 0; enum cmp_mode cmp_mode; if (!cfg) - return 0; + return 1; if (!cmp_imagette_data_type_is_used(cfg->data_type)) { debug_print("Error: The compression data type is not an imagette compression data type.\n"); @@ -679,7 +694,7 @@ int cmp_cfg_imagette_is_invalid(const struct cmp_cfg *cfg, int rdcu_check) } /* The RDCU needs valid compression parameters also in RAW_MODE */ - if (rdcu_check && cfg->cmp_mode == CMP_MODE_RAW) + if (opt == RDCU_CHECK && cfg->cmp_mode == CMP_MODE_RAW) cmp_mode = CMP_MODE_MODEL_ZERO; else cmp_mode = cfg->cmp_mode; @@ -688,7 +703,7 @@ int cmp_cfg_imagette_is_invalid(const struct cmp_cfg *cfg, int rdcu_check) cfg->data_type, "imagette"); /* for the RDCU the adaptive parameters have to be always valid */ - if (rdcu_check || cmp_ap_imagette_data_type_is_used(cfg->data_type)) { + if (opt == RDCU_CHECK || cmp_ap_imagette_data_type_is_used(cfg->data_type)) { cfg_invalid += cmp_pars_are_invalid(cfg->ap1_golomb_par, cfg->ap1_spill, cmp_mode, cfg->data_type, "adaptive 1 imagette"); cfg_invalid += cmp_pars_are_invalid(cfg->ap2_golomb_par, cfg->ap2_spill, @@ -700,102 +715,133 @@ int cmp_cfg_imagette_is_invalid(const struct cmp_cfg *cfg, int rdcu_check) /** - * @brief check if the flux/center of brightness specific compression parameters - * are invalid + * @brief get needed compression parameter pairs for a flux/center of brightness + * data type * - * @param cfg pointer to the compressor configuration + * @param data_type a flux/center of brightness data type + * @param par pointer to a structure containing flux/COB compression + * parameters pairs * - * @returns 0 if the flux/center of brightness specific parameters are valid, otherwise invalid + * @returns 0 on success and sets the needed compression parameter pairs in the + * par struct, otherwise error */ -int cmp_cfg_fx_cob_is_invalid(const struct cmp_cfg *cfg) +int cmp_cfg_fx_cob_get_need_pars(enum cmp_data_type data_type, struct fx_cob_par *par) { - int cfg_invalid = 0; - int check_exp_flags = 0, check_ncob = 0, check_efx = 0, check_ecob = 0, check_var = 0; + if (!par) + return -1; - if (!cfg) - return 0; + par->exp_flags = 0; + par->fx = 0; + par->ncob = 0; + par->efx = 0; + par->ecob = 0; + par->fx_cob_variance = 0; - if (!cmp_fx_cob_data_type_is_used(cfg->data_type)) { - debug_print("Error: The compression data type is not a flux/center of brightness compression data type.\n"); - cfg_invalid++; - } /* flux parameter is needed for every fx_cob data_type */ - cfg_invalid += cmp_pars_are_invalid(cfg->cmp_par_fx, cfg->spill_fx, - cfg->cmp_mode, cfg->data_type, "flux"); + par->fx = 1; - switch (cfg->data_type) { + switch (data_type) { case DATA_TYPE_S_FX: - check_exp_flags = 1; + par->exp_flags = 1; break; case DATA_TYPE_S_FX_EFX: - check_exp_flags = 1; - check_efx = 1; + par->exp_flags = 1; + par->efx = 1; break; case DATA_TYPE_S_FX_NCOB: - check_exp_flags = 1; - check_ncob = 1; + par->exp_flags = 1; + par->ncob = 1; break; case DATA_TYPE_S_FX_EFX_NCOB_ECOB: - check_exp_flags = 1; - check_ncob = 1; - check_efx = 1; - check_ecob = 1; + par->exp_flags = 1; + par->ncob = 1; + par->efx = 1; + par->ecob = 1; break; case DATA_TYPE_L_FX: - check_exp_flags = 1; - check_var = 1; + par->exp_flags = 1; + par->fx_cob_variance = 1; break; case DATA_TYPE_L_FX_EFX: - check_exp_flags = 1; - check_efx = 1; - check_var = 1; + par->exp_flags = 1; + par->efx = 1; + par->fx_cob_variance = 1; break; case DATA_TYPE_L_FX_NCOB: - check_exp_flags = 1; - check_ncob = 1; - check_var = 1; + par->exp_flags = 1; + par->ncob = 1; + par->fx_cob_variance = 1; break; case DATA_TYPE_L_FX_EFX_NCOB_ECOB: - check_exp_flags = 1; - check_ncob = 1; - check_efx = 1; - check_ecob = 1; - check_var = 1; + par->exp_flags = 1; + par->ncob = 1; + par->efx = 1; + par->ecob = 1; + par->fx_cob_variance = 1; break; case DATA_TYPE_F_FX: break; case DATA_TYPE_F_FX_EFX: - check_efx = 1; + par->efx = 1; break; case DATA_TYPE_F_FX_NCOB: - check_ncob = 1; + par->ncob = 1; break; case DATA_TYPE_F_FX_EFX_NCOB_ECOB: - check_ncob = 1; - check_efx = 1; - check_ecob = 1; + par->ncob = 1; + par->efx = 1; + par->ecob = 1; break; default: + return -1; + } + return 0; +} + + +/** + * @brief check if the flux/center of brightness specific compression parameters + * are invalid + * + * @param cfg pointer to the compressor configuration + * + * @returns 0 if the flux/center of brightness specific parameters are valid, otherwise invalid + */ + +int cmp_cfg_fx_cob_is_invalid(const struct cmp_cfg *cfg) +{ + int cfg_invalid = 0; + struct fx_cob_par needed_pars; + + if (!cfg) + return 1; + + if (!cmp_fx_cob_data_type_is_used(cfg->data_type)) { + debug_print("Error: The compression data type is not a flux/center of brightness compression data type.\n"); cfg_invalid++; - break; } - if (check_exp_flags) + cmp_cfg_fx_cob_get_need_pars(cfg->data_type, &needed_pars); + + if (needed_pars.fx) /* this is always true because every flux/center of brightness data type contains a flux parameter */ + cfg_invalid += cmp_pars_are_invalid(cfg->cmp_par_fx, cfg->spill_fx, + cfg->cmp_mode, cfg->data_type, "flux"); + if (needed_pars.exp_flags) cfg_invalid += cmp_pars_are_invalid(cfg->cmp_par_exp_flags, cfg->spill_exp_flags, cfg->cmp_mode, cfg->data_type, "exposure flags"); - if (check_ncob) + if (needed_pars.ncob) cfg_invalid += cmp_pars_are_invalid(cfg->cmp_par_ncob, cfg->spill_ncob, cfg->cmp_mode, cfg->data_type, "center of brightness"); - if (check_efx) + if (needed_pars.efx) cfg_invalid += cmp_pars_are_invalid(cfg->cmp_par_efx, cfg->spill_efx, cfg->cmp_mode, cfg->data_type, "extended flux"); - if (check_ecob) + if (needed_pars.ecob) cfg_invalid += cmp_pars_are_invalid(cfg->cmp_par_ecob, cfg->spill_ecob, cfg->cmp_mode, cfg->data_type, "extended center of brightness"); - if (check_var) + if (needed_pars.fx_cob_variance) cfg_invalid += cmp_pars_are_invalid(cfg->cmp_par_fx_cob_variance, - cfg->spill_fx_cob_variance, cfg->cmp_mode, cfg->data_type, "flux COB varianc"); + cfg->spill_fx_cob_variance, cfg->cmp_mode, cfg->data_type, "flux/COB variance"); return cfg_invalid; } @@ -816,7 +862,7 @@ int cmp_cfg_aux_is_invalid(const struct cmp_cfg *cfg) int cfg_invalid = 0; if (!cfg) - return 0; + return 1; if (!cmp_aux_data_type_is_used(cfg->data_type)) { debug_print("Error: The compression data type is not an auxiliary science compression data type.\n"); @@ -838,21 +884,21 @@ int cmp_cfg_aux_is_invalid(const struct cmp_cfg *cfg) /** - * @brief check if a compression configuration is invalid + * @brief check if a compression configuration is invalid for a ICU compression * - * @param cfg pointer to the compressor configuration + * @param cfg pointer to a compressor configuration * * @returns 0 if the compression configuration is valid, otherwise invalid */ -int cmp_cfg_is_invalid(const struct cmp_cfg *cfg) +int cmp_cfg_icu_is_invalid(const struct cmp_cfg *cfg) { int cfg_invalid = 0; if (!cfg) - return 0; + return 1; - cfg_invalid += cmp_cfg_icu_gen_par_is_invalid(cfg); + cfg_invalid += cmp_cfg_gen_par_is_invalid(cfg, ICU_CHECK); cfg_invalid += cmp_cfg_icu_buffers_is_invalid(cfg); @@ -869,69 +915,30 @@ int cmp_cfg_is_invalid(const struct cmp_cfg *cfg) } -/** - * @brief print the cmp_cfg structure - * - * @param cfg compressor configuration contains all parameters required for - * compression - */ - -void print_cmp_cfg(const struct cmp_cfg *cfg) -{ - size_t i; - - printf("cmp_mode: %i\n", cfg->cmp_mode); - printf("golomb_par: %u\n", cfg->golomb_par); - printf("spill: %u\n", cfg->spill); - printf("model_value: %u\n", cfg->model_value); - printf("round: %u\n", cfg->round); - printf("ap1_golomb_par: %u\n", cfg->ap1_golomb_par); - printf("ap1_spill: %u\n", cfg->ap1_spill); - printf("ap2_golomb_par: %u\n", cfg->ap2_golomb_par); - printf("ap2_spill: %u\n", cfg->ap2_spill); - printf("input_buf: %p\n", (void *)cfg->input_buf); - if (cfg->input_buf != NULL) { - printf("input data:"); - for (i = 0; i < cfg->samples; i++) - printf(" %04X", ((uint16_t *)cfg->input_buf)[i]); - printf("\n"); - } - printf("rdcu_data_adr: 0x%06X\n", cfg->rdcu_data_adr); - printf("model_buf: %p\n", (void *)cfg->model_buf); - if (cfg->model_buf != NULL) { - printf("model data:"); - for (i = 0; i < cfg->samples; i++) - printf(" %04X", ((uint16_t *)cfg->model_buf)[i]); - printf("\n"); - } - printf("rdcu_model_adr: 0x%06X\n", cfg->rdcu_model_adr); - printf("rdcu_new_model_adr: 0x%06X\n", cfg->rdcu_new_model_adr); - printf("samples: %u\n", cfg->samples); - printf("icu_output_buf: %p\n", (void *)cfg->icu_output_buf); - printf("rdcu_buffer_adr: 0x%06X\n", cfg->rdcu_buffer_adr); - printf("buffer_length: %u\n", cfg->buffer_length); -} - - /** * @brief print the cmp_info structure * - * @param info compressor information contains information of an executed - * compression + * @param info pointer to a compressor information contains information of an + * executed RDCU compression */ void print_cmp_info(const struct cmp_info *info) { - printf("cmp_mode_used: %u\n", info->cmp_mode_used); - printf("model_value_used: %u\n", info->model_value_used); - printf("round_used: %u\n", info->round_used); - printf("spill_used: %u\n", info->spill_used); - printf("golomb_par_used: %u\n", info->golomb_par_used); - printf("samples_used: %u\n", info->samples_used); - printf("cmp_size: %u\n", info->cmp_size); - printf("ap1_cmp_size: %u\n", info->ap1_cmp_size); - printf("ap2_cmp_size: %u\n", info->ap2_cmp_size); - printf("rdcu_new_model_adr_used: 0x%06X\n", info->rdcu_new_model_adr_used); - printf("rdcu_cmp_adr_used: 0x%06X\n", info->rdcu_cmp_adr_used); - printf("cmp_err: %#X\n", info->cmp_err); + if (!info) { + debug_print("Pointer to the compressor information is NULL.\n"); + return; + } + + debug_print("cmp_mode_used: %" PRIu32 "\n", info->cmp_mode_used); + debug_print("spill_used: %" PRIu32 "\n", info->spill_used); + debug_print("golomb_par_used: %" PRIu32 "\n", info->golomb_par_used); + debug_print("samples_used: %" PRIu32 "\n", info->samples_used); + debug_print("cmp_size: %" PRIu32 "\n", info->cmp_size); + debug_print("ap1_cmp_size: %" PRIu32 "\n", info->ap1_cmp_size); + debug_print("ap2_cmp_size: %" PRIu32 "\n", info->ap2_cmp_size); + debug_print("rdcu_new_model_adr_used: 0x%06"PRIX32"\n", info->rdcu_new_model_adr_used); + debug_print("rdcu_cmp_adr_used: 0x%06"PRIX32"\n", info->rdcu_cmp_adr_used); + debug_print("model_value_used: %u\n", info->model_value_used); + debug_print("round_used: %u\n", info->round_used); + debug_print("cmp_err: %#X\n", info->cmp_err); } diff --git a/lib/decmp.c b/lib/decmp.c index 3be77c96daeac25b6e63b8099ee09af53649679b..ea8cecd48d7f1dcb9b92c139fc13db2f602b3075 100644 --- a/lib/decmp.c +++ b/lib/decmp.c @@ -1,6 +1,6 @@ /** * @file decmp.c - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at), + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) * @date 2020 * * @copyright GPLv2 @@ -22,7 +22,6 @@ #include <stdint.h> #include <stdio.h> -#include <stdlib.h> #include <limits.h> #include <string.h> @@ -39,10 +38,18 @@ /* maximum used bits registry */ extern struct cmp_max_used_bits max_used_bits; -/* function pointer to a code word decoder function */ + +/** + * @brief function pointer to a code word decoder function + */ + typedef int (*decoder_ptr)(uint32_t, unsigned int, unsigned int, uint32_t *); -/* structure to hold a setup to encode a value */ + +/** + * @brief structure to hold a setup to encode a value + */ + struct decoder_setup { decoder_ptr decode_cw_f; /* pointer to the code word decoder (Golomb/Rice)*/ int (*decode_method_f)(uint32_t *decoded_value, int stream_pos, @@ -2028,6 +2035,7 @@ static int decompress_smearing(const struct cmp_cfg *cfg) * compression) * * @returns the size of the decompressed data on success; returns negative on failure + * TODO: change return type to int32_t */ static int decompressed_data_internal(struct cmp_cfg *cfg) @@ -2141,7 +2149,7 @@ static int decompressed_data_internal(struct cmp_cfg *cfg) * @param ent pointer to the compression entity to be decompressed * @param model_of_data pointer to model data buffer (can be NULL if no * model compression mode is used) - * @param updated_model pointer to store the updated model for the next model + * @param up_model_buf pointer to store the updated model for the next model * mode compression (can be the same as the model_of_data * buffer for in-place update or NULL if updated model is not needed) * @param decompressed_data pointer to the decompressed data buffer (can be NULL) @@ -2175,9 +2183,11 @@ int decompress_cmp_entiy(struct cmp_entity *ent, void *model_of_data, * * @param compressed_data pointer to the RDCU compressed data (without a * compression entity header) + * @param info pointer to a decompression information structure + * consisting the metadata of the compression * @param model_of_data pointer to model data buffer (can be NULL if no * model compression mode is used) - * @param updated_model pointer to store the updated model for the next model + * @param up_model_buf pointer to store the updated model for the next model * mode compression (can be the same as the model_of_data * buffer for in-place update or NULL if updated model is not needed) * @param decompressed_data pointer to the decompressed data buffer (can be NULL) diff --git a/lib/meson.build b/lib/meson.build index f072ce4371b24f303ac3f51a607735870fd216f2..9a4f44df75ab19c0a0901977e7e572c00ec38e23 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -9,6 +9,7 @@ cmplib_sources = files([ 'decmp.c', 'rdcu_pkt_to_file.c', 'cmp_guess.c', + 'cmp_rdcu_cfg.c', 'cmp_rdcu.c', 'rdcu_cmd.c', 'rdcu_rmap.c' diff --git a/lib/rdcu_cmd.c b/lib/rdcu_cmd.c index 21548353a68a4aa01862ef6821bae2a2bbae3edd..2c7feaedf9924080e70f404a38a5b33501ee90df 100644 --- a/lib/rdcu_cmd.c +++ b/lib/rdcu_cmd.c @@ -1,6 +1,6 @@ /** * @file rdcu_cmd.c - * @author Armin Luntzer (armin.luntzer@univie.ac.at), + * @author Armin Luntzer (armin.luntzer@univie.ac.at) * @date 2018 * * @copyright GPLv2 @@ -18,9 +18,7 @@ */ -#include <stdio.h> #include <stdlib.h> -#include <string.h> #include <rmap.h> #include <rdcu_cmd.h> diff --git a/lib/rdcu_ctrl.c b/lib/rdcu_ctrl.c index 6f743c68c09bc656bef11a941845d1d9cb7847ea..f870c534f0be38d3ab50ec442b4c73768bad8361 100644 --- a/lib/rdcu_ctrl.c +++ b/lib/rdcu_ctrl.c @@ -1,6 +1,6 @@ /** * @file rdcu_ctrl.c - * @author Armin Luntzer (armin.luntzer@univie.ac.at), + * @author Armin Luntzer (armin.luntzer@univie.ac.at) * @date 2018 * * @copyright GPLv2 @@ -48,7 +48,7 @@ * value = get_register_uvw(); * * - * WARNING: this has not been thoroughly tested and is in need of inspection + * @warning this has not been thoroughly tested and is in need of inspection * with regards to the specification, in order to locate any * register transcription errors or typos * In the PLATO-IWF-PL-RS-005 Issue 0.7 (at least the one I have), @@ -59,10 +59,10 @@ #include <stdio.h> #include <stdlib.h> +#include <stdint.h> #include <string.h> #include <byteorder.h> -#include <rmap.h> #include <rdcu_cmd.h> #include <rdcu_ctrl.h> #include <rdcu_rmap.h> diff --git a/lib/rdcu_pkt_to_file.c b/lib/rdcu_pkt_to_file.c index 9e80125f0335a9576dc56194c79479155a906368..723ab9bffca874752e160acbed7d4dd9c12b0f65 100644 --- a/lib/rdcu_pkt_to_file.c +++ b/lib/rdcu_pkt_to_file.c @@ -1,6 +1,6 @@ /** * @file rdcu_pkt_to_file.c - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at), + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) * @date 2020 * * @copyright GPLv2 @@ -28,12 +28,17 @@ #include <errno.h> #include <sys/stat.h> +#include <cmp_support.h> #include <rdcu_pkt_to_file.h> -#include <cmp_rdcu_extended.h> +#include <cmp_rdcu.h> #include <rdcu_rmap.h> #include <rdcu_ctrl.h> #include <rdcu_cmd.h> + +int rdcu_compress_data_parallel(const struct cmp_cfg *cfg, const struct cmp_info *last_info); + + /* Name of directory were the RMAP packages are stored */ static char tc_folder_dir[MAX_TC_FOLDER_DIR_LEN] = "TC_FILES"; diff --git a/lib/rdcu_rmap.c b/lib/rdcu_rmap.c index e4ec4b61952db0049c37d36914d5216c69c6aecf..73d90cf69fd33b0b6511d2d6ded9b304fd5feb18 100644 --- a/lib/rdcu_rmap.c +++ b/lib/rdcu_rmap.c @@ -1,6 +1,6 @@ /** * @file rdcu_rmap.c - * @author Armin Luntzer (armin.luntzer@univie.ac.at), + * @author Armin Luntzer (armin.luntzer@univie.ac.at) * @date 2018 * * @copyright GPLv2 @@ -36,11 +36,11 @@ * available, please adapt all malloc/free calls to your needs, or ask us * to do that for you. * - * NOTE: in order to run this on the GR712RC eval board, we set the SRAM mirror + * @note in order to run this on the GR712RC eval board, we set the SRAM mirror * image to the boards SDRAM in rdcu_ctrl_init() and just malloc() it for * the PC (see rdcu_ctrl_init) * - * The interface requires that you provide an RX and a TX function, + * @note The interface requires that you provide an RX and a TX function, * see rdcu_ctrl_init for the call interface. * The TX function shall to return 0 on success, everything else * is considered an error in submission. The RX function shall return @@ -51,12 +51,12 @@ * your particular SpW interface or just redirect RX/TX to files * or via a network connection. * - * NOTE: We don't have to serve more than one RDCU at any given time, so we + * @note We don't have to serve more than one RDCU at any given time, so we * track addresses and paths internally in a single instance. This also * makes the interface less cluttered. Besides, I'm lazy. * * - * @warn when operational, we expect to have exclusive control of the SpW link + * @warning when operational, we expect to have exclusive control of the SpW link * * TODO: RMAP command response evaluation */ diff --git a/lib/rmap.c b/lib/rmap.c index 703add595bb907340be3399759178229afa6db89..113ad1ebdab3ac700bc57532d6dafb26a5e226a6 100644 --- a/lib/rmap.c +++ b/lib/rmap.c @@ -1,6 +1,6 @@ /** * @file rmap.c - * @author Armin Luntzer (armin.luntzer@univie.ac.at), + * @author Armin Luntzer (armin.luntzer@univie.ac.at) * @date 2018 * * @copyright GPLv2 @@ -25,9 +25,7 @@ #include <stdio.h> #include <rmap.h> - - - +#include <my_inttypes.h> /** @@ -584,12 +582,14 @@ struct rmap_pkt *rmap_pkt_from_buffer(uint8_t *buf, uint32_t len) pkt->hdr_crc = buf[RMAP_HEADER_CRC]; if (pkt->data_len) { - if (len < RMAP_DATA_START + n + pkt->data_len + 1) { /* +1 for data CRC */ - printf("buffer len is smaller than the contained RMAP packet; buf len: %u bytes vs RMAP: %zu bytes needed\n", - len, RMAP_DATA_START + n + pkt->data_len); + size_t pkt_size = RMAP_DATA_START + n + pkt->data_len + 1; /* +1 for data CRC */ + + if (len < pkt_size) { + printf("buffer len is smaller than the contained RMAP packet; buf len: %" PRIu32 " bytes vs RMAP: %zu bytes needed\n", + len, pkt_size); goto error; } - if (len > RMAP_DATA_START + n + pkt->data_len + 1) /* +1 for data CRC */ + if (len > pkt_size) printf("warning: the buffer is larger than the included RMAP packet\n"); pkt->data = (uint8_t *) malloc(pkt->data_len); diff --git a/meson.build b/meson.build index 53603eebf0b0e1af1fb963b45023abc37659c990..5f282685062ecf880cd5317d705516848d10c2c9 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cmp_tool', 'c', - version : '0.09', + version : '0.10', meson_version : '>= 0.56', license : 'GPL-2.0', default_options : ['warning_level=3', 'c_std=gnu99'] diff --git a/sparc-efl-gcc.txt b/sparc-efl-gcc.txt new file mode 100644 index 0000000000000000000000000000000000000000..817f1154e803ca79b4ef05357b6a64d3e49d3c32 --- /dev/null +++ b/sparc-efl-gcc.txt @@ -0,0 +1,24 @@ +[binaries] +c = 'sparc-elf-gcc' +cpp = 'sparc-elf-g++' +objc = 'sparc-elf-gcc' +ar = 'sparc-elf-ar' +strip = 'sparc-elf-strip' +ld = 'sparc-elf-ld' + +# pkgconfig = ['false'] +# cmake = ['false'] + +[built-in options] +# use sparcv8 +c_args = ['-mcpu=v8'] +b_staticpic = 'false' + +[properties] + + +[host_machine] +system = 'none' +cpu_family = 'sparc' +cpu = 'leon' +endian = 'big' diff --git a/test/cmp_data_types/meson.build b/test/cmp_data_types/meson.build index 8de2ef86510c269ed1c3888c806c0a630133ec1c..17ff50e1f5752be2f639282aeb7b5a7212a74779 100644 --- a/test/cmp_data_types/meson.build +++ b/test/cmp_data_types/meson.build @@ -1,7 +1,7 @@ test_case = files('test_cmp_data_types.c') test_runner = test_runner_generator.process(test_case) -test_cmp_icu = executable('test_cmp_data_types', +test_cmp_data_types = executable('test_cmp_data_types', test_case, test_runner, include_directories : incdir, link_with : cmp_lib, @@ -9,4 +9,4 @@ test_cmp_icu = executable('test_cmp_data_types', build_by_default : false ) -test('Compression Data Types Unit Tests', test_cmp_icu) +test('Compression Data Types Unit Tests', test_cmp_data_types) diff --git a/test/cmp_data_types/test_cmp_data_types.c b/test/cmp_data_types/test_cmp_data_types.c index 881f46a250f904a1fab14a685b7c2b315fc5553b..403143c523175540c8bc1946391b261456af2a2a 100644 --- a/test/cmp_data_types/test_cmp_data_types.c +++ b/test/cmp_data_types/test_cmp_data_types.c @@ -1,7 +1,111 @@ +/** + * @file test_cmp_data_types.c + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) + * @date 2022 + * + * @copyright GPLv2 + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * @brief compression data types tests + */ + + #include <stdint.h> -#include "unity.h" -#include "cmp_data_types.h" +#include <unity.h> +#include <cmp_data_types.h> + + +/** + * @test cmp_set_max_us + */ + +void test_cmp_set_max_used_bits(void) +{ + struct cmp_max_used_bits set_max_used_bits = cmp_get_max_used_bits(); + + cmp_set_max_used_bits(&set_max_used_bits); + cmp_set_max_used_bits(NULL); +} + + +/** + * @test cmp_get_max_used_bits + */ + +void test_cmp_get_max_used_bits(void) +{ + struct cmp_max_used_bits max_used_bits = cmp_get_max_used_bits(); + + TEST_ASSERT_EQUAL_INT(max_used_bits.nc_imagette, MAX_USED_NC_IMAGETTE_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.saturated_imagette, MAX_USED_SATURATED_IMAGETTE_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.fc_imagette, MAX_USED_FC_IMAGETTE_BITS); + + TEST_ASSERT_EQUAL_INT(max_used_bits.f_fx, MAX_USED_F_FX_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.f_efx, MAX_USED_F_EFX_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.f_ncob, MAX_USED_F_NCOB_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.f_ecob, MAX_USED_F_ECOB_BITS); + + TEST_ASSERT_EQUAL_INT(max_used_bits.s_exp_flags, MAX_USED_S_FX_EXPOSURE_FLAGS_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.s_fx, MAX_USED_S_FX_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.s_efx, MAX_USED_S_EFX_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.s_ncob, MAX_USED_S_NCOB_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.s_ecob, MAX_USED_S_ECOB_BITS); + + TEST_ASSERT_EQUAL_INT(max_used_bits.l_fx_variance, MAX_USED_L_FX_VARIANCE_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.l_efx, MAX_USED_L_EFX_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.l_ncob, MAX_USED_L_NCOB_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.l_ecob, MAX_USED_L_ECOB_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.l_cob_variance, MAX_USED_L_COB_VARIANCE_BITS); + + TEST_ASSERT_EQUAL_INT(max_used_bits.nc_offset_mean, MAX_USED_NC_OFFSET_MEAN_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.nc_offset_variance, MAX_USED_NC_OFFSET_VARIANCE_BITS); + + TEST_ASSERT_EQUAL_INT(max_used_bits.nc_background_mean, MAX_USED_NC_BACKGROUND_MEAN_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.nc_background_variance, MAX_USED_NC_BACKGROUND_VARIANCE_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.nc_background_outlier_pixels, MAX_USED_NC_BACKGROUND_OUTLIER_PIXELS_BITS); + + TEST_ASSERT_EQUAL_INT(max_used_bits.smearing_mean, MAX_USED_SMEARING_MEAN_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.smearing_variance_mean, MAX_USED_SMEARING_VARIANCE_MEAN_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.smearing_outlier_pixels, MAX_USED_SMEARING_OUTLIER_PIXELS_BITS); + + TEST_ASSERT_EQUAL_INT(max_used_bits.fc_offset_mean, MAX_USED_FC_OFFSET_MEAN_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.fc_offset_variance, MAX_USED_FC_OFFSET_VARIANCE_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.fc_offset_pixel_in_error, MAX_USED_FC_OFFSET_PIXEL_IN_ERROR_BITS); + + TEST_ASSERT_EQUAL_INT(max_used_bits.fc_background_mean, MAX_USED_FC_BACKGROUND_MEAN_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.fc_background_variance, MAX_USED_FC_BACKGROUND_VARIANCE_BITS); + TEST_ASSERT_EQUAL_INT(max_used_bits.fc_background_outlier_pixels, MAX_USED_FC_BACKGROUND_OUTLIER_PIXELS_BITS); +} + + +/** + * @test size_of_a_sample + */ + +void test_size_of_a_sample(void) +{ + size_t size; + /* TODO: implied DATA_TYPE_F_CAM_OFFSET and DATA_TYPE_F_CAM_BACKGROUND DATA_TYPE_F_CAM_BACKGROUND*/ + size = size_of_a_sample(DATA_TYPE_F_CAM_OFFSET); + TEST_ASSERT_EQUAL(0, size); + size = size_of_a_sample(DATA_TYPE_F_CAM_BACKGROUND); + TEST_ASSERT_EQUAL(0, size); + + /* test error cases */ + size = size_of_a_sample(DATA_TYPE_UNKNOWN); + TEST_ASSERT_EQUAL(0, size); + size = size_of_a_sample(DATA_TYPE_F_CAM_BACKGROUND+1); + TEST_ASSERT_EQUAL(0, size); +} + /** * @test cmp_cal_size_of_data @@ -9,18 +113,106 @@ void test_cmp_cal_size_of_data(void) { - unsigned int s; + uint32_t s; s = cmp_cal_size_of_data(1, DATA_TYPE_IMAGETTE); TEST_ASSERT_EQUAL_UINT(sizeof(uint16_t), s); + s = cmp_cal_size_of_data(32, DATA_TYPE_IMAGETTE); + TEST_ASSERT_EQUAL_UINT(32 * sizeof(uint16_t), s); + s = cmp_cal_size_of_data(1, DATA_TYPE_F_FX); TEST_ASSERT_EQUAL_UINT(sizeof(struct f_fx)+MULTI_ENTRY_HDR_SIZE, s); + s = cmp_cal_size_of_data(4, DATA_TYPE_F_FX); + TEST_ASSERT_EQUAL_UINT(4*sizeof(struct f_fx)+MULTI_ENTRY_HDR_SIZE, s); + /* overflow tests */ s = cmp_cal_size_of_data(0x1999999A, DATA_TYPE_BACKGROUND); TEST_ASSERT_EQUAL_UINT(0, s); s = cmp_cal_size_of_data(0x19999999, DATA_TYPE_BACKGROUND); TEST_ASSERT_EQUAL_UINT(0, s); + s = cmp_cal_size_of_data(UINT_MAX, DATA_TYPE_L_FX_EFX_NCOB_ECOB); + TEST_ASSERT_EQUAL_UINT(0, s); } + +/** + * @test cmp_input_size_to_samples + */ + +void test_cmp_input_size_to_samples(void) +{ + enum cmp_data_type data_type; + uint32_t size, samples; + int32_t samples_get; + + data_type = DATA_TYPE_IMAGETTE; + samples = 42; + size = cmp_cal_size_of_data(samples, data_type); + samples_get = cmp_input_size_to_samples(size, data_type); + TEST_ASSERT_EQUAL(samples, samples_get); + + data_type = DATA_TYPE_IMAGETTE; + samples = 0; + size = cmp_cal_size_of_data(samples, data_type); + samples_get = cmp_input_size_to_samples(size, data_type); + TEST_ASSERT_EQUAL(samples, samples_get); + + data_type = DATA_TYPE_S_FX_NCOB; + samples = 42; + size = cmp_cal_size_of_data(samples, data_type); + samples_get = cmp_input_size_to_samples(size, data_type); + TEST_ASSERT_EQUAL(samples, samples_get); + + data_type = DATA_TYPE_S_FX_NCOB; + samples = 0; + size = cmp_cal_size_of_data(samples, data_type); + samples_get = cmp_input_size_to_samples(size, data_type); + TEST_ASSERT_EQUAL(samples, samples_get); + + /* error cases */ + data_type = DATA_TYPE_S_FX_NCOB; + size = MULTI_ENTRY_HDR_SIZE - 1; + samples_get = cmp_input_size_to_samples(size, data_type); + TEST_ASSERT_EQUAL(-1, samples_get); + data_type = DATA_TYPE_S_FX_NCOB; + + size = MULTI_ENTRY_HDR_SIZE + 4*sizeof(struct s_fx_ncob) - 1; + samples_get = cmp_input_size_to_samples(size, data_type); + TEST_ASSERT_EQUAL(-1, samples_get); +} + + +/** + * @test cmp_input_big_to_cpu_endianness + */ + +void test_cmp_input_big_to_cpu_endianness(void) +{ + int error; + void *data; + uint8_t data_err[3] = {0x01, 0xFF, 0x42}; + uint32_t data_size_byte; + enum cmp_data_type data_type; + + /* data = NULL test */ + data = NULL; + data_size_byte = 0; + data_type = DATA_TYPE_IMAGETTE; + error = cmp_input_big_to_cpu_endianness(data, data_size_byte, data_type); + TEST_ASSERT_EQUAL(0, error); + + /* error cases */ + data = data_err; + data_size_byte = 3; + data_type = DATA_TYPE_IMAGETTE; + error = cmp_input_big_to_cpu_endianness(data, data_size_byte, data_type); + TEST_ASSERT_EQUAL(-1, error); + + data = data_err; + data_size_byte = 0; + data_type = DATA_TYPE_UNKNOWN; + error = cmp_input_big_to_cpu_endianness(data, data_size_byte, data_type); + TEST_ASSERT_EQUAL(-1, error); +} diff --git a/test/cmp_decmp/meson.build b/test/cmp_decmp/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..9c72c6b3a1e093d7041f8088843fa79385938034 --- /dev/null +++ b/test/cmp_decmp/meson.build @@ -0,0 +1,12 @@ +test_case = files('test_cmp_decmp.c') +test_runner = test_runner_generator.process(test_case) + +test_cmp_decmp = executable('test_cmp_decmp', + test_case, test_runner, + include_directories : incdir, + link_with : cmp_lib, + dependencies : unity_dep, + build_by_default : false +) + +test('Compression Decompression Unit Tests', test_cmp_decmp) diff --git a/test/cmp_icu/test_cmp_decmp.c b/test/cmp_decmp/test_cmp_decmp.c similarity index 89% rename from test/cmp_icu/test_cmp_decmp.c rename to test/cmp_decmp/test_cmp_decmp.c index 9eb587e96c8a34379ac56e8bb5a452ef8a891fe4..d9dc3ab7589563a4dedbd30b859aa83a08c53e80 100644 --- a/test/cmp_icu/test_cmp_decmp.c +++ b/test/cmp_decmp/test_cmp_decmp.c @@ -1,6 +1,6 @@ /** * @file test_cmp_decmp.c - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at), + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) * @date 2022 * * @copyright GPLv2 @@ -13,8 +13,8 @@ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * @brief random compression decompression test - * @detail We generate random data and compress them with random parameters. + * @brief random compression decompression tests + * @details We generate random data and compress them with random parameters. * After that we put the data in a compression entity. We decompress the * compression entity and compare the decompressed data with the original * data. @@ -41,7 +41,7 @@ #define IMAX_BITS(m) ((m)/((m)%255+1) / 255%255*8 + 7-86/((m)%255+12)) #define RAND_MAX_WIDTH IMAX_BITS(RAND_MAX) -#define set_n_bits(n) (n!=32?~(~0UL << (n)):0xFFFFFFFF) +#define set_n_bits(n) (n != 32 ? ~(~0UL << (n)):0xFFFFFFFF) /** @@ -113,9 +113,8 @@ static void gen_ima_data(uint16_t *data, uint32_t samples) uint32_t i; struct cmp_max_used_bits max_used_bits = cmp_get_max_used_bits(); - for (i = 0; i < samples; i++) { + for (i = 0; i < samples; i++) data[i] = random_between(0, set_n_bits(max_used_bits.nc_imagette)); - } } @@ -218,9 +217,8 @@ static void gen_f_fx_data(struct f_fx *data, uint32_t samples) uint32_t i; struct cmp_max_used_bits max_used_bits = cmp_get_max_used_bits(); - for (i = 0; i < samples; i++) { + for (i = 0; i < samples; i++) data[i].fx = random_between(0, set_n_bits(max_used_bits.f_fx)); - } } @@ -351,10 +349,10 @@ void *generate_random_test_data(uint32_t samples, enum cmp_data_type data_type) if (!rdcu_supported_data_type_is_used(data_type)) { int i; + TEST_ASSERT(data_size > MULTI_ENTRY_HDR_SIZE); - for (i = 0; i < MULTI_ENTRY_HDR_SIZE; ++i) { + for (i = 0; i < MULTI_ENTRY_HDR_SIZE; ++i) *p++ = random_between(0, UINT8_MAX); - } data = p; } @@ -435,30 +433,30 @@ void generate_random_cmp_par(struct cmp_cfg *cfg) cfg->ap1_golomb_par = random_between(MIN_IMA_GOLOMB_PAR, MAX_IMA_GOLOMB_PAR); cfg->ap2_golomb_par = random_between(MIN_IMA_GOLOMB_PAR, MAX_IMA_GOLOMB_PAR); - cfg->cmp_par_exp_flags = random_between(MIN_ICU_GOLOMB_PAR, MAX_ICU_GOLOMB_PAR); - cfg->cmp_par_fx = random_between(MIN_ICU_GOLOMB_PAR, MAX_ICU_GOLOMB_PAR); - cfg->cmp_par_ncob = random_between(MIN_ICU_GOLOMB_PAR, MAX_ICU_GOLOMB_PAR); - cfg->cmp_par_efx = random_between(MIN_ICU_GOLOMB_PAR, MAX_ICU_GOLOMB_PAR); - cfg->cmp_par_ecob = random_between(MIN_ICU_GOLOMB_PAR, MAX_ICU_GOLOMB_PAR); - cfg->cmp_par_fx_cob_variance = random_between(MIN_ICU_GOLOMB_PAR, MAX_ICU_GOLOMB_PAR); - cfg->cmp_par_mean = random_between(MIN_ICU_GOLOMB_PAR, MAX_ICU_GOLOMB_PAR); - cfg->cmp_par_variance = random_between(MIN_ICU_GOLOMB_PAR, MAX_ICU_GOLOMB_PAR); - cfg->cmp_par_pixels_error = random_between(MIN_ICU_GOLOMB_PAR, MAX_ICU_GOLOMB_PAR); + cfg->cmp_par_exp_flags = random_between(MIN_NON_IMA_GOLOMB_PAR, MAX_NON_IMA_GOLOMB_PAR); + cfg->cmp_par_fx = random_between(MIN_NON_IMA_GOLOMB_PAR, MAX_NON_IMA_GOLOMB_PAR); + cfg->cmp_par_ncob = random_between(MIN_NON_IMA_GOLOMB_PAR, MAX_NON_IMA_GOLOMB_PAR); + cfg->cmp_par_efx = random_between(MIN_NON_IMA_GOLOMB_PAR, MAX_NON_IMA_GOLOMB_PAR); + cfg->cmp_par_ecob = random_between(MIN_NON_IMA_GOLOMB_PAR, MAX_NON_IMA_GOLOMB_PAR); + cfg->cmp_par_fx_cob_variance = random_between(MIN_NON_IMA_GOLOMB_PAR, MAX_NON_IMA_GOLOMB_PAR); + cfg->cmp_par_mean = random_between(MIN_NON_IMA_GOLOMB_PAR, MAX_NON_IMA_GOLOMB_PAR); + cfg->cmp_par_variance = random_between(MIN_NON_IMA_GOLOMB_PAR, MAX_NON_IMA_GOLOMB_PAR); + cfg->cmp_par_pixels_error = random_between(MIN_NON_IMA_GOLOMB_PAR, MAX_NON_IMA_GOLOMB_PAR); cfg->spill = random_between(MIN_IMA_SPILL, cmp_ima_max_spill(cfg->golomb_par)); cfg->ap1_spill = random_between(MIN_IMA_SPILL, cmp_ima_max_spill(cfg->ap1_golomb_par)); cfg->ap2_spill = random_between(MIN_IMA_SPILL, cmp_ima_max_spill(cfg->ap2_golomb_par)); - cfg->spill_exp_flags = random_between(MIN_ICU_SPILL, cmp_icu_max_spill(cfg->cmp_par_exp_flags)); - cfg->spill_fx = random_between(MIN_ICU_SPILL, cmp_icu_max_spill(cfg->cmp_par_fx)); - cfg->spill_ncob = random_between(MIN_ICU_SPILL, cmp_icu_max_spill(cfg->cmp_par_ncob)); - cfg->spill_efx = random_between(MIN_ICU_SPILL, cmp_icu_max_spill(cfg->cmp_par_efx)); - cfg->spill_ecob = random_between(MIN_ICU_SPILL, cmp_icu_max_spill(cfg->cmp_par_ecob)); - cfg->spill_fx_cob_variance = random_between(MIN_ICU_SPILL, cmp_icu_max_spill(cfg->cmp_par_fx_cob_variance)); - cfg->spill_mean = random_between(MIN_ICU_SPILL, cmp_icu_max_spill(cfg->cmp_par_mean)); - cfg->spill_variance = random_between(MIN_ICU_SPILL, cmp_icu_max_spill(cfg->cmp_par_variance)); - cfg->spill_pixels_error = random_between(MIN_ICU_SPILL, cmp_icu_max_spill(cfg->cmp_par_pixels_error)); + cfg->spill_exp_flags = random_between(MIN_NON_IMA_SPILL, cmp_icu_max_spill(cfg->cmp_par_exp_flags)); + cfg->spill_fx = random_between(MIN_NON_IMA_SPILL, cmp_icu_max_spill(cfg->cmp_par_fx)); + cfg->spill_ncob = random_between(MIN_NON_IMA_SPILL, cmp_icu_max_spill(cfg->cmp_par_ncob)); + cfg->spill_efx = random_between(MIN_NON_IMA_SPILL, cmp_icu_max_spill(cfg->cmp_par_efx)); + cfg->spill_ecob = random_between(MIN_NON_IMA_SPILL, cmp_icu_max_spill(cfg->cmp_par_ecob)); + cfg->spill_fx_cob_variance = random_between(MIN_NON_IMA_SPILL, cmp_icu_max_spill(cfg->cmp_par_fx_cob_variance)); + cfg->spill_mean = random_between(MIN_NON_IMA_SPILL, cmp_icu_max_spill(cfg->cmp_par_mean)); + cfg->spill_variance = random_between(MIN_NON_IMA_SPILL, cmp_icu_max_spill(cfg->cmp_par_variance)); + cfg->spill_pixels_error = random_between(MIN_NON_IMA_SPILL, cmp_icu_max_spill(cfg->cmp_par_pixels_error)); #if 0 if (cfg->cmp_mode == CMP_MODE_STUFF) { /* cfg->golomb_par = random_between(16, MAX_STUFF_CMP_PAR); */ @@ -496,6 +494,11 @@ void compression_decompression(struct cmp_cfg *cfg) static void *model_of_data; void *updated_model = NULL; + if (!cfg) { + free(model_of_data); + return; + } + TEST_ASSERT_NOT_NULL(cfg); TEST_ASSERT_NULL(cfg->icu_output_buf); @@ -563,7 +566,7 @@ void compression_decompression(struct cmp_cfg *cfg) /** * @brief random compression decompression test - * @detail We generate random data and compress them with random parameters. + * @details We generate random data and compress them with random parameters. * After that we put the data in a compression entity. We decompress the * compression entity and compare the decompressed data with the original * data. @@ -611,6 +614,7 @@ void test_random_compression_decompression(void) free(data_to_compress2); free(updated_model); } + compression_decompression(NULL); } #define N_SAMPLES 5 @@ -653,9 +657,8 @@ void test_random_compression_decompression2(void) s = decompress_rdcu_data(compressed_data, &info, NULL, NULL, decompressed_data); TEST_ASSERT(s > 0); - for (i = 0; i < N_SAMPLES; i++) { + for (i = 0; i < N_SAMPLES; i++) TEST_ASSERT_EQUAL_HEX16(data[i], decompressed_data[i]); - } free(compressed_data); diff --git a/test/cmp_entity/meson.build b/test/cmp_entity/meson.build index 72219124fb502125bbe9482379c81097b9c148b5..98fedca8e8fc6f0963ee7adb98583e86cc6aa103 100644 --- a/test/cmp_entity/meson.build +++ b/test/cmp_entity/meson.build @@ -1,7 +1,7 @@ test_case = files('test_cmp_entity.c') test_runner = test_runner_generator.process(test_case) -test_cmp_entity = executable('test_cmp_data_types', +test_cmp_entity = executable('test_cmp_entity', test_case, test_runner, include_directories : incdir, link_with : cmp_lib, diff --git a/test/cmp_entity/test_cmp_entity.c b/test/cmp_entity/test_cmp_entity.c index 8493e329333bf928bfe0a0dfd1ad666a28291d11..439222d3464c18d77ef107801d1bc1ff79d80c24 100644 --- a/test/cmp_entity/test_cmp_entity.c +++ b/test/cmp_entity/test_cmp_entity.c @@ -1,7 +1,1296 @@ +/** + * @file test_cmp_entity.c + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) + * @date 2022 + * + * @copyright GPLv2 + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * @brief compression entity tests + */ + + +#include <stdlib.h> +#include <string.h> +#if defined __has_include +# if __has_include(<time.h>) +# include <time.h> +# define HAS_TIME_H 1 +# endif +#endif + #include <unity.h> -#include <cmp_entity.h> -#include <cmp_io.h> +#include <cmp_entity.h> +#include <cmp_data_types.h> + + +/** + * @test cmp_ent_cal_hdr_size + */ + +void test_cmp_ent_cal_hdr_size(void) +{ + uint32_t hdr_size; + enum cmp_data_type data_type; + int raw_mode_flag; + + /* raw_mode test */ + raw_mode_flag = 1; + /*TODO: implement: DATA_TYPE_F_CAM_OFFSET, DATA_TYPE_F_CAM_BACKGROUND */ + /* for (data_type = DATA_TYPE_IMAGETTE; data_type <= DATA_TYPE_F_CAM_BACKGROUND; data_type++) { */ + for (data_type = DATA_TYPE_IMAGETTE; data_type <= DATA_TYPE_F_CAM_IMAGETTE_ADAPTIVE; data_type++) { + hdr_size = cmp_ent_cal_hdr_size(data_type, raw_mode_flag); + TEST_ASSERT_EQUAL_INT(GENERIC_HEADER_SIZE, hdr_size); + + } + /* non raw_mode test */ + raw_mode_flag = 0; + for (data_type = DATA_TYPE_IMAGETTE; data_type <= DATA_TYPE_F_CAM_BACKGROUND; data_type++) { + hdr_size = cmp_ent_cal_hdr_size(data_type, raw_mode_flag); + if (cmp_imagette_data_type_is_used(data_type)) { + if (cmp_ap_imagette_data_type_is_used(data_type)) + TEST_ASSERT_EQUAL_INT(IMAGETTE_ADAPTIVE_HEADER_SIZE, hdr_size); + else + TEST_ASSERT_EQUAL_INT(IMAGETTE_HEADER_SIZE, hdr_size); + } else { + TEST_ASSERT_EQUAL_INT(NON_IMAGETTE_HEADER_SIZE, hdr_size); + } + + } + + /* error case raw_mode*/ + raw_mode_flag = 1; + data_type = DATA_TYPE_UNKNOWN; + hdr_size = cmp_ent_cal_hdr_size(data_type, raw_mode_flag); + TEST_ASSERT_EQUAL_INT(0, hdr_size); + + data_type = ~0; + hdr_size = cmp_ent_cal_hdr_size(data_type, raw_mode_flag); + TEST_ASSERT_EQUAL_INT(0, hdr_size); + + /* error case non raw_mode*/ + raw_mode_flag = 0; + data_type = DATA_TYPE_UNKNOWN; + hdr_size = cmp_ent_cal_hdr_size(data_type, raw_mode_flag); + TEST_ASSERT_EQUAL_INT(0, hdr_size); + + data_type = ~0; + hdr_size = cmp_ent_cal_hdr_size(data_type, raw_mode_flag); + TEST_ASSERT_EQUAL_INT(0, hdr_size); +} + + +/** + * @test cmp_ent_set_version_id + * @test cmp_ent_get_version_id + */ + +void test_ent_version_id(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t version_id; + uint32_t version_id_read; + uint8_t *entity_p = (uint8_t *)&ent; + + version_id = 0x12345678; + error = cmp_ent_set_version_id(&ent, version_id); + TEST_ASSERT_FALSE(error); + + version_id_read = cmp_ent_get_version_id(&ent); + TEST_ASSERT_EQUAL_UINT32(version_id, version_id_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[0]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[1]); + TEST_ASSERT_EQUAL_HEX(0x56, entity_p[2]); + TEST_ASSERT_EQUAL_HEX(0x78, entity_p[3]); + + /* error cases */ + error = cmp_ent_set_version_id(NULL, version_id); + TEST_ASSERT_TRUE(error); + version_id_read = cmp_ent_get_version_id(NULL); + TEST_ASSERT_EQUAL_UINT32(0, version_id_read); +} + + +/** + * @test cmp_ent_set_size + * @test cmp_ent_get_size + */ + +void test_ent_size(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t size; + uint32_t size_read; + uint8_t *entity_p = (uint8_t *)&ent; + + size = 0x123456; + error = cmp_ent_set_size(&ent, size); + TEST_ASSERT_FALSE(error); + + size_read = cmp_ent_get_size(&ent); + TEST_ASSERT_EQUAL_UINT32(size, size_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[4]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[5]); + TEST_ASSERT_EQUAL_HEX(0x56, entity_p[6]); + + /* error cases */ + size = 0x1234567; + error = cmp_ent_set_size(&ent, size); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_size(NULL, size); + TEST_ASSERT_TRUE(error); + size_read = cmp_ent_get_size(NULL); + TEST_ASSERT_EQUAL_UINT32(0, size_read); +} + + +/** + * @test cmp_ent_set_original_size + * @test cmp_ent_get_original_size + */ + +void test_ent_original_size(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t original_size; + uint32_t original_size_read; + uint8_t *entity_p = (uint8_t *)&ent; + + original_size = 0x123456; + error = cmp_ent_set_original_size(&ent, original_size); + TEST_ASSERT_FALSE(error); + + original_size_read = cmp_ent_get_original_size(&ent); + TEST_ASSERT_EQUAL_UINT32(original_size, original_size_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[7]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[8]); + TEST_ASSERT_EQUAL_HEX(0x56, entity_p[9]); + + /* error cases */ + original_size = 0x1234567; + error = cmp_ent_set_original_size(&ent, original_size); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_original_size(NULL, original_size); + TEST_ASSERT_TRUE(error); + original_size_read = cmp_ent_get_original_size(NULL); + TEST_ASSERT_EQUAL_UINT32(0, original_size_read); +} + + +/** + * @test cmp_ent_set_start_timestamp + * @test cmp_ent_get_start_timestamp + */ + +void test_ent_start_timestamp(void) +{ + int error; + struct cmp_entity ent = {0}; + uint64_t start_timestamp; + uint64_t start_timestamp_read; + uint32_t coarse_start_timestamp_read; + uint16_t fine_start_timestamp_read; + uint8_t *entity_p = (uint8_t *)&ent; + + start_timestamp = 0x123456789ABC; + error = cmp_ent_set_start_timestamp(&ent, start_timestamp); + TEST_ASSERT_FALSE(error); + + start_timestamp_read = cmp_ent_get_start_timestamp(&ent); + TEST_ASSERT_EQUAL_UINT64(start_timestamp, start_timestamp_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[10]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[11]); + TEST_ASSERT_EQUAL_HEX(0x56, entity_p[12]); + TEST_ASSERT_EQUAL_HEX(0x78, entity_p[13]); + TEST_ASSERT_EQUAL_HEX(0x9A, entity_p[14]); + TEST_ASSERT_EQUAL_HEX(0xBC, entity_p[15]); + + coarse_start_timestamp_read = cmp_ent_get_coarse_start_time(&ent); + TEST_ASSERT_EQUAL_UINT64(0x12345678, coarse_start_timestamp_read); + fine_start_timestamp_read = cmp_ent_get_fine_start_time(&ent); + TEST_ASSERT_EQUAL_UINT64(0x9ABC, fine_start_timestamp_read); + + /* error cases */ + start_timestamp = 0x1000000000000; + error = cmp_ent_set_start_timestamp(&ent, start_timestamp); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_start_timestamp(NULL, start_timestamp); + TEST_ASSERT_TRUE(error); + start_timestamp_read = cmp_ent_get_start_timestamp(NULL); + TEST_ASSERT_EQUAL_UINT32(0, start_timestamp_read); +} + + +/** + * @test cmp_ent_set_coarse_start_time + * @test cmp_ent_get_coarse_start_time + */ + +void test_ent_coarse_start_time(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t coarse_start_time; + uint32_t coarse_start_time_read; + uint8_t *entity_p = (uint8_t *)&ent; + + coarse_start_time = 0x12345678; + error = cmp_ent_set_coarse_start_time(&ent, coarse_start_time); + TEST_ASSERT_FALSE(error); + + coarse_start_time_read = cmp_ent_get_coarse_start_time(&ent); + TEST_ASSERT_EQUAL_UINT32(coarse_start_time, coarse_start_time_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[10]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[11]); + TEST_ASSERT_EQUAL_HEX(0x56, entity_p[12]); + TEST_ASSERT_EQUAL_HEX(0x78, entity_p[13]); + + /* error cases */ + error = cmp_ent_set_coarse_start_time(NULL, coarse_start_time); + TEST_ASSERT_TRUE(error); + coarse_start_time_read = cmp_ent_get_coarse_start_time(NULL); + TEST_ASSERT_EQUAL_UINT32(0, coarse_start_time_read); +} + + +/** + * @test cmp_ent_set_fine_start_time + * @test cmp_ent_get_fine_start_time + */ + +void test_ent_fine_start_time(void) +{ + int error; + struct cmp_entity ent = {0}; + uint16_t fine_start_time; + uint16_t fine_start_time_read; + uint8_t *entity_p = (uint8_t *)&ent; + + fine_start_time = 0x1234; + error = cmp_ent_set_fine_start_time(&ent, fine_start_time); + TEST_ASSERT_FALSE(error); + + fine_start_time_read = cmp_ent_get_fine_start_time(&ent); + TEST_ASSERT_EQUAL_UINT32(fine_start_time, fine_start_time_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[14]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[15]); + + /* error cases */ + error = cmp_ent_set_fine_start_time(NULL, fine_start_time); + TEST_ASSERT_TRUE(error); + fine_start_time_read = cmp_ent_get_fine_start_time(NULL); + TEST_ASSERT_EQUAL_UINT32(0, fine_start_time_read); +} + + +/** + * @test cmp_ent_set_end_timestamp + * @test cmp_ent_get_end_timestamp + */ + +void test_ent_end_timestamp(void) +{ + int error; + struct cmp_entity ent = {0}; + uint64_t end_timestamp; + uint64_t end_timestamp_read; + uint32_t coarse_end_timestamp_read; + uint16_t fine_end_timestamp_read; + uint8_t *entity_p = (uint8_t *)&ent; + + end_timestamp = 0x123456789ABC; + error = cmp_ent_set_end_timestamp(&ent, end_timestamp); + TEST_ASSERT_FALSE(error); + + end_timestamp_read = cmp_ent_get_end_timestamp(&ent); + TEST_ASSERT_EQUAL_HEX64(end_timestamp, end_timestamp_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[16]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[17]); + TEST_ASSERT_EQUAL_HEX(0x56, entity_p[18]); + TEST_ASSERT_EQUAL_HEX(0x78, entity_p[19]); + TEST_ASSERT_EQUAL_HEX(0x9A, entity_p[20]); + TEST_ASSERT_EQUAL_HEX(0xBC, entity_p[21]); + + coarse_end_timestamp_read = cmp_ent_get_coarse_end_time(&ent); + TEST_ASSERT_EQUAL_UINT64(0x12345678, coarse_end_timestamp_read); + fine_end_timestamp_read = cmp_ent_get_fine_end_time(&ent); + TEST_ASSERT_EQUAL_UINT64(0x9ABC, fine_end_timestamp_read); + + /* error cases */ + end_timestamp = 0x1000000000000; + error = cmp_ent_set_end_timestamp(&ent, end_timestamp); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_end_timestamp(NULL, end_timestamp); + TEST_ASSERT_TRUE(error); + end_timestamp_read = cmp_ent_get_end_timestamp(NULL); + TEST_ASSERT_EQUAL_UINT32(0, end_timestamp_read); +} + + +/** + * @test cmp_ent_set_coarse_end_time + * @test cmp_ent_get_coarse_end_time + */ + +void test_ent_coarse_end_time(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t coarse_end_time; + uint32_t coarse_end_time_read; + uint8_t *entity_p = (uint8_t *)&ent; + + coarse_end_time = 0x12345678; + error = cmp_ent_set_coarse_end_time(&ent, coarse_end_time); + TEST_ASSERT_FALSE(error); + + coarse_end_time_read = cmp_ent_get_coarse_end_time(&ent); + TEST_ASSERT_EQUAL_UINT32(coarse_end_time, coarse_end_time_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[16]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[17]); + TEST_ASSERT_EQUAL_HEX(0x56, entity_p[18]); + TEST_ASSERT_EQUAL_HEX(0x78, entity_p[19]); + + /* error cases */ + error = cmp_ent_set_coarse_end_time(NULL, coarse_end_time); + TEST_ASSERT_TRUE(error); + coarse_end_time_read = cmp_ent_get_coarse_end_time(NULL); + TEST_ASSERT_EQUAL_UINT32(0, coarse_end_time_read); +} + + +/** + * @test cmp_ent_set_fine_end_time + * @test cmp_ent_get_fine_end_time + */ + +void test_ent_fine_end_time(void) +{ + int error; + struct cmp_entity ent = {0}; + uint16_t fine_end_time; + uint16_t fine_end_time_read; + uint8_t *entity_p = (uint8_t *)&ent; + + fine_end_time = 0x1234; + error = cmp_ent_set_fine_end_time(&ent, fine_end_time); + TEST_ASSERT_FALSE(error); + + fine_end_time_read = cmp_ent_get_fine_end_time(&ent); + TEST_ASSERT_EQUAL_UINT32(fine_end_time, fine_end_time_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[20]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[21]); + + /* error cases */ + error = cmp_ent_set_fine_end_time(NULL, fine_end_time); + TEST_ASSERT_TRUE(error); + fine_end_time_read = cmp_ent_get_fine_end_time(NULL); + TEST_ASSERT_EQUAL_UINT32(0, fine_end_time_read); +} + + +/** + * @test cmp_ent_set_data_type + * @test cmp_ent_get_data_type + * @test cmp_ent_get_data_type_raw_bit + */ + +void test_cmp_ent_data_type(void) +{ + int error; + struct cmp_entity ent = {0}; + enum cmp_data_type data_type, data_type_read; + int raw_mode_flag, raw_mode_flag_read; + uint8_t *entity_p = (uint8_t *)&ent; + + /* test non raw_mode */ + raw_mode_flag = 0; + data_type = DATA_TYPE_F_CAM_IMAGETTE_ADAPTIVE; + error = cmp_ent_set_data_type(&ent, data_type, raw_mode_flag); + TEST_ASSERT_FALSE(error); + + data_type_read = cmp_ent_get_data_type(&ent); + TEST_ASSERT_EQUAL_HEX32(data_type, data_type_read); + raw_mode_flag_read = cmp_ent_get_data_type_raw_bit(&ent); + TEST_ASSERT_EQUAL(raw_mode_flag, raw_mode_flag_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0, entity_p[22]); + TEST_ASSERT_EQUAL_HEX(21, entity_p[23]); + + /* test raw_mode */ + raw_mode_flag = 1; + data_type = DATA_TYPE_F_CAM_IMAGETTE_ADAPTIVE; + error = cmp_ent_set_data_type(&ent, data_type, raw_mode_flag); + TEST_ASSERT_FALSE(error); + + data_type_read = cmp_ent_get_data_type(&ent); + TEST_ASSERT_EQUAL_HEX32(data_type, data_type_read); + raw_mode_flag_read = cmp_ent_get_data_type_raw_bit(&ent); + TEST_ASSERT_EQUAL(raw_mode_flag, raw_mode_flag_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x80, entity_p[22]); + TEST_ASSERT_EQUAL_HEX(21, entity_p[23]); + + /* error cases */ + raw_mode_flag = 0; + data_type = 0x8000; + error = cmp_ent_set_data_type(&ent, data_type, raw_mode_flag); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_data_type(NULL, data_type, raw_mode_flag); + TEST_ASSERT_TRUE(error); + data_type_read = cmp_ent_get_data_type(NULL); + TEST_ASSERT_EQUAL_UINT32(0, data_type_read); + raw_mode_flag_read = cmp_ent_get_data_type_raw_bit(NULL); + TEST_ASSERT_EQUAL_UINT32(0, raw_mode_flag_read); +} + + +/** + * @test cmp_ent_set_cmp_mode + * @test cmp_ent_get_cmp_mode + */ + +void test_ent_cmp_mode(void) +{ + int error; + struct cmp_entity ent = {0}; + enum cmp_mode cmp_mode, cmp_mode_read; + uint8_t *entity_p = (uint8_t *)&ent; + + cmp_mode = 0x12; + error = cmp_ent_set_cmp_mode(&ent, cmp_mode); + TEST_ASSERT_FALSE(error); + + cmp_mode_read = cmp_ent_get_cmp_mode(&ent); + TEST_ASSERT_EQUAL_UINT32(cmp_mode, cmp_mode_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[24]); + + /* error cases */ + cmp_mode = 0x100; + error = cmp_ent_set_cmp_mode(&ent, cmp_mode); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_cmp_mode(NULL, cmp_mode); + TEST_ASSERT_TRUE(error); + cmp_mode_read = cmp_ent_get_cmp_mode(NULL); + TEST_ASSERT_EQUAL_UINT32(0, cmp_mode_read); +} + + +/** + * @test cmp_ent_set_model_value + * @test cmp_ent_get_model_value + */ + +void test_ent_model_value(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t model_value, model_value_read; + uint8_t *entity_p = (uint8_t *)&ent; + + model_value = 0x12; + error = cmp_ent_set_model_value(&ent, model_value); + TEST_ASSERT_FALSE(error); + + model_value_read = cmp_ent_get_model_value(&ent); + TEST_ASSERT_EQUAL_UINT32(model_value, model_value_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[25]); + + /* error cases */ + model_value = 0x100; + error = cmp_ent_set_model_value(&ent, model_value); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_model_value(NULL, model_value); + TEST_ASSERT_TRUE(error); + model_value_read = cmp_ent_get_model_value(NULL); + TEST_ASSERT_EQUAL_UINT32(0, model_value_read); +} + + +/** + * @test cmp_ent_set_model_id + * @test cmp_ent_get_model_id + */ + +void test_ent_model_id(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t model_id, model_id_read; + uint8_t *entity_p = (uint8_t *)&ent; + + model_id = 0x1234; + error = cmp_ent_set_model_id(&ent, model_id); + TEST_ASSERT_FALSE(error); + + model_id_read = cmp_ent_get_model_id(&ent); + TEST_ASSERT_EQUAL_UINT32(model_id, model_id_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[26]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[27]); + + /* error cases */ + model_id = 0x10000; + error = cmp_ent_set_model_id(&ent, model_id); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_model_id(NULL, model_id); + TEST_ASSERT_TRUE(error); + model_id_read = cmp_ent_get_model_id(NULL); + TEST_ASSERT_EQUAL_UINT32(0, model_id_read); +} + + +/** + * @test cmp_ent_set_model_counter + * @test cmp_ent_get_model_counter + */ + +void test_ent_model_counter(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t model_counter, model_counter_read; + uint8_t *entity_p = (uint8_t *)&ent; + + model_counter = 0x12; + error = cmp_ent_set_model_counter(&ent, model_counter); + TEST_ASSERT_FALSE(error); + + model_counter_read = cmp_ent_get_model_counter(&ent); + TEST_ASSERT_EQUAL_UINT32(model_counter, model_counter_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[28]); + + /* error cases */ + model_counter = 0x100; + error = cmp_ent_set_model_counter(&ent, model_counter); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_model_counter(NULL, model_counter); + TEST_ASSERT_TRUE(error); + model_counter_read = cmp_ent_get_model_counter(NULL); + TEST_ASSERT_EQUAL_UINT32(0, model_counter_read); +} + + +/** + * @test cmp_ent_set_max_used_bits_version + * @test cmp_ent_get_max_used_bits_version + */ + +void test_ent_max_used_bits_version(void) +{ + int error; + struct cmp_entity ent = {0}; + uint8_t max_used_bits_version, max_used_bits_version_read; + uint8_t *entity_p = (uint8_t *)&ent; + + max_used_bits_version = 0x12; + error = cmp_ent_set_max_used_bits_version(&ent, max_used_bits_version); + TEST_ASSERT_FALSE(error); + + max_used_bits_version_read = cmp_ent_get_max_used_bits_version(&ent); + TEST_ASSERT_EQUAL_UINT32(max_used_bits_version, max_used_bits_version_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[29]); + + /* error cases */ + error = cmp_ent_set_max_used_bits_version(NULL, max_used_bits_version); + TEST_ASSERT_TRUE(error); + max_used_bits_version_read = cmp_ent_get_max_used_bits_version(NULL); + TEST_ASSERT_EQUAL_UINT32(0, max_used_bits_version_read); +} + + +/** + * @test cmp_ent_set_lossy_cmp_par + * @test cmp_ent_get_lossy_cmp_par + */ + +void test_ent_lossy_cmp_par(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t lossy_cmp_par, lossy_cmp_par_read; + uint8_t *entity_p = (uint8_t *)&ent; + + lossy_cmp_par = 0x1234; + error = cmp_ent_set_lossy_cmp_par(&ent, lossy_cmp_par); + TEST_ASSERT_FALSE(error); + + lossy_cmp_par_read = cmp_ent_get_lossy_cmp_par(&ent); + TEST_ASSERT_EQUAL_UINT32(lossy_cmp_par, lossy_cmp_par_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[30]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[31]); + + /* error cases */ + lossy_cmp_par = 0x10000; + error = cmp_ent_set_lossy_cmp_par(&ent, lossy_cmp_par); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_lossy_cmp_par(NULL, lossy_cmp_par); + TEST_ASSERT_TRUE(error); + lossy_cmp_par_read = cmp_ent_get_lossy_cmp_par(NULL); + TEST_ASSERT_EQUAL_UINT32(0, lossy_cmp_par_read); +} + + +/** + * @test cmp_ent_set_ima_spill + * @test cmp_ent_get_ima_spill + */ + +void test_ent_ima_spill(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t ima_spill, ima_spill_read; + uint8_t *entity_p = (uint8_t *)&ent; + + ima_spill = 0x1234; + error = cmp_ent_set_ima_spill(&ent, ima_spill); + TEST_ASSERT_FALSE(error); + + ima_spill_read = cmp_ent_get_ima_spill(&ent); + TEST_ASSERT_EQUAL_UINT32(ima_spill, ima_spill_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[32]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[33]); + + /* error cases */ + ima_spill = 0x10000; + error = cmp_ent_set_ima_spill(&ent, ima_spill); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_ima_spill(NULL, ima_spill); + TEST_ASSERT_TRUE(error); + ima_spill_read = cmp_ent_get_ima_spill(NULL); + TEST_ASSERT_EQUAL_UINT32(0, ima_spill_read); +} + + +/** + * @test cmp_ent_set_ima_golomb_par + * @test cmp_ent_get_ima_golomb_par + */ + +void test_ent_ima_golomb_par(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t ima_golomb_par, ima_golomb_par_read; + uint8_t *entity_p = (uint8_t *)&ent; + + ima_golomb_par = 0x12; + error = cmp_ent_set_ima_golomb_par(&ent, ima_golomb_par); + TEST_ASSERT_FALSE(error); + + ima_golomb_par_read = cmp_ent_get_ima_golomb_par(&ent); + TEST_ASSERT_EQUAL_UINT32(ima_golomb_par, ima_golomb_par_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[34]); + + /* error cases */ + ima_golomb_par = 0x100; + error = cmp_ent_set_ima_golomb_par(&ent, ima_golomb_par); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_ima_golomb_par(NULL, ima_golomb_par); + TEST_ASSERT_TRUE(error); + ima_golomb_par_read = cmp_ent_get_ima_golomb_par(NULL); + TEST_ASSERT_EQUAL_UINT32(0, ima_golomb_par_read); +} + + +/** + * @test cmp_ent_set_ima_ap1_spill + * @test cmp_ent_get_ima_ap1_spill + */ + +void test_ent_ima_ap1_spill(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t ima_ap1_spill, ima_ap1_spill_read; + uint8_t *entity_p = (uint8_t *)&ent; + + ima_ap1_spill = 0x1234; + error = cmp_ent_set_ima_ap1_spill(&ent, ima_ap1_spill); + TEST_ASSERT_FALSE(error); + + ima_ap1_spill_read = cmp_ent_get_ima_ap1_spill(&ent); + TEST_ASSERT_EQUAL_UINT32(ima_ap1_spill, ima_ap1_spill_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[35]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[36]); + + /* error cases */ + ima_ap1_spill = 0x10000; + error = cmp_ent_set_ima_ap1_spill(&ent, ima_ap1_spill); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_ima_ap1_spill(NULL, ima_ap1_spill); + TEST_ASSERT_TRUE(error); + ima_ap1_spill_read = cmp_ent_get_ima_ap1_spill(NULL); + TEST_ASSERT_EQUAL_UINT32(0, ima_ap1_spill_read); +} + + +/** + * @test cmp_ent_set_ima_ap1_golomb_par + * @test cmp_ent_get_ima_ap1_golomb_par + */ + +void test_ent_ima_ap1_golomb_par(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t ima_ap1_golomb_par, ima_ap1_golomb_par_read; + uint8_t *entity_p = (uint8_t *)&ent; + + ima_ap1_golomb_par = 0x12; + error = cmp_ent_set_ima_ap1_golomb_par(&ent, ima_ap1_golomb_par); + TEST_ASSERT_FALSE(error); + + ima_ap1_golomb_par_read = cmp_ent_get_ima_ap1_golomb_par(&ent); + TEST_ASSERT_EQUAL_UINT32(ima_ap1_golomb_par, ima_ap1_golomb_par_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[37]); + + /* error cases */ + ima_ap1_golomb_par = 0x100; + error = cmp_ent_set_ima_ap1_golomb_par(&ent, ima_ap1_golomb_par); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_ima_ap1_golomb_par(NULL, ima_ap1_golomb_par); + TEST_ASSERT_TRUE(error); + ima_ap1_golomb_par_read = cmp_ent_get_ima_ap1_golomb_par(NULL); + TEST_ASSERT_EQUAL_UINT32(0, ima_ap1_golomb_par_read); +} + + +/** + * @test cmp_ent_set_ima_ap2_spill + * @test cmp_ent_get_ima_ap2_spill + */ + +void test_ent_ima_ap2_spill(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t ima_ap2_spill, ima_ap2_spill_read; + uint8_t *entity_p = (uint8_t *)&ent; + + ima_ap2_spill = 0x1234; + error = cmp_ent_set_ima_ap2_spill(&ent, ima_ap2_spill); + TEST_ASSERT_FALSE(error); + + ima_ap2_spill_read = cmp_ent_get_ima_ap2_spill(&ent); + TEST_ASSERT_EQUAL_UINT32(ima_ap2_spill, ima_ap2_spill_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[38]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[39]); + + /* error cases */ + ima_ap2_spill = 0x10000; + error = cmp_ent_set_ima_ap2_spill(&ent, ima_ap2_spill); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_ima_ap2_spill(NULL, ima_ap2_spill); + TEST_ASSERT_TRUE(error); + ima_ap2_spill_read = cmp_ent_get_ima_ap2_spill(NULL); + TEST_ASSERT_EQUAL_UINT32(0, ima_ap2_spill_read); +} + + +/** + * @test cmp_ent_set_ima_ap2_golomb_par + * @test cmp_ent_get_ima_ap2_golomb_par + */ + +void test_ent_ima_ap2_golomb_par(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t ima_ap2_golomb_par, ima_ap2_golomb_par_read; + uint8_t *entity_p = (uint8_t *)&ent; + + ima_ap2_golomb_par = 0x12; + error = cmp_ent_set_ima_ap2_golomb_par(&ent, ima_ap2_golomb_par); + TEST_ASSERT_FALSE(error); + + ima_ap2_golomb_par_read = cmp_ent_get_ima_ap2_golomb_par(&ent); + TEST_ASSERT_EQUAL_UINT32(ima_ap2_golomb_par, ima_ap2_golomb_par_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[40]); + + /* error cases */ + ima_ap2_golomb_par = 0x100; + error = cmp_ent_set_ima_ap2_golomb_par(&ent, ima_ap2_golomb_par); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_ima_ap2_golomb_par(NULL, ima_ap2_golomb_par); + TEST_ASSERT_TRUE(error); + ima_ap2_golomb_par_read = cmp_ent_get_ima_ap2_golomb_par(NULL); + TEST_ASSERT_EQUAL_UINT32(0, ima_ap2_golomb_par_read); +} + + +/** + * @test cmp_ent_set_non_ima_spill1 + * @test cmp_ent_get_non_ima_spill1 + */ + +void test_ent_non_ima_spill1(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t non_ima_spill1, non_ima_spill1_read; + uint8_t *entity_p = (uint8_t *)&ent; + + non_ima_spill1 = 0x123456; + error = cmp_ent_set_non_ima_spill1(&ent, non_ima_spill1); + TEST_ASSERT_FALSE(error); + + non_ima_spill1_read = cmp_ent_get_non_ima_spill1(&ent); + TEST_ASSERT_EQUAL_UINT32(non_ima_spill1, non_ima_spill1_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[32]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[33]); + TEST_ASSERT_EQUAL_HEX(0x56, entity_p[34]); + + /* error cases */ + non_ima_spill1 = 0x1000000; + error = cmp_ent_set_non_ima_spill1(&ent, non_ima_spill1); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_non_ima_spill1(NULL, non_ima_spill1); + TEST_ASSERT_TRUE(error); + non_ima_spill1_read = cmp_ent_get_non_ima_spill1(NULL); + TEST_ASSERT_EQUAL_UINT32(0, non_ima_spill1_read); +} + + +/** + * @test cmp_ent_set_non_ima_cmp_par1 + * @test cmp_ent_get_non_ima_cmp_par1 + */ + +void test_ent_non_ima_cmp_par1(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t non_ima_cmp_par1, non_ima_cmp_par1_read; + uint8_t *entity_p = (uint8_t *)&ent; + + non_ima_cmp_par1 = 0x1234; + error = cmp_ent_set_non_ima_cmp_par1(&ent, non_ima_cmp_par1); + TEST_ASSERT_FALSE(error); + + non_ima_cmp_par1_read = cmp_ent_get_non_ima_cmp_par1(&ent); + TEST_ASSERT_EQUAL_UINT32(non_ima_cmp_par1, non_ima_cmp_par1_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[35]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[36]); + + /* error cases */ + non_ima_cmp_par1 = 0x10000; + error = cmp_ent_set_non_ima_cmp_par1(&ent, non_ima_cmp_par1); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_non_ima_cmp_par1(NULL, non_ima_cmp_par1); + TEST_ASSERT_TRUE(error); + non_ima_cmp_par1_read = cmp_ent_get_non_ima_cmp_par1(NULL); + TEST_ASSERT_EQUAL_UINT32(0, non_ima_cmp_par1_read); +} + + +/** + * @test cmp_ent_set_non_ima_spill2 + * @test cmp_ent_get_non_ima_spill2 + */ + +void test_ent_non_ima_spill2(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t non_ima_spill2, non_ima_spill2_read; + uint8_t *entity_p = (uint8_t *)&ent; + + non_ima_spill2 = 0x123456; + error = cmp_ent_set_non_ima_spill2(&ent, non_ima_spill2); + TEST_ASSERT_FALSE(error); + + non_ima_spill2_read = cmp_ent_get_non_ima_spill2(&ent); + TEST_ASSERT_EQUAL_UINT32(non_ima_spill2, non_ima_spill2_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[37]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[38]); + TEST_ASSERT_EQUAL_HEX(0x56, entity_p[39]); + + /* error cases */ + non_ima_spill2 = 0x1000000; + error = cmp_ent_set_non_ima_spill2(&ent, non_ima_spill2); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_non_ima_spill2(NULL, non_ima_spill2); + TEST_ASSERT_TRUE(error); + non_ima_spill2_read = cmp_ent_get_non_ima_spill2(NULL); + TEST_ASSERT_EQUAL_UINT32(0, non_ima_spill2_read); +} + + +/** + * @test cmp_ent_set_non_ima_cmp_par2 + * @test cmp_ent_get_non_ima_cmp_par2 + */ + +void test_ent_non_ima_cmp_par2(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t non_ima_cmp_par2, non_ima_cmp_par2_read; + uint8_t *entity_p = (uint8_t *)&ent; + + non_ima_cmp_par2 = 0x1234; + error = cmp_ent_set_non_ima_cmp_par2(&ent, non_ima_cmp_par2); + TEST_ASSERT_FALSE(error); + + non_ima_cmp_par2_read = cmp_ent_get_non_ima_cmp_par2(&ent); + TEST_ASSERT_EQUAL_UINT32(non_ima_cmp_par2, non_ima_cmp_par2_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[40]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[41]); + + /* error cases */ + non_ima_cmp_par2 = 0x10000; + error = cmp_ent_set_non_ima_cmp_par2(&ent, non_ima_cmp_par2); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_non_ima_cmp_par2(NULL, non_ima_cmp_par2); + TEST_ASSERT_TRUE(error); + non_ima_cmp_par2_read = cmp_ent_get_non_ima_cmp_par2(NULL); + TEST_ASSERT_EQUAL_UINT32(0, non_ima_cmp_par2_read); +} + + +/** + * @test cmp_ent_set_non_ima_spill3 + * @test cmp_ent_get_non_ima_spill3 + */ + +void test_ent_non_ima_spill3(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t non_ima_spill3, non_ima_spill3_read; + uint8_t *entity_p = (uint8_t *)&ent; + + non_ima_spill3 = 0x123456; + error = cmp_ent_set_non_ima_spill3(&ent, non_ima_spill3); + TEST_ASSERT_FALSE(error); + + non_ima_spill3_read = cmp_ent_get_non_ima_spill3(&ent); + TEST_ASSERT_EQUAL_UINT32(non_ima_spill3, non_ima_spill3_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[42]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[43]); + TEST_ASSERT_EQUAL_HEX(0x56, entity_p[44]); + + /* error cases */ + non_ima_spill3 = 0x1000000; + error = cmp_ent_set_non_ima_spill3(&ent, non_ima_spill3); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_non_ima_spill3(NULL, non_ima_spill3); + TEST_ASSERT_TRUE(error); + non_ima_spill3_read = cmp_ent_get_non_ima_spill3(NULL); + TEST_ASSERT_EQUAL_UINT32(0, non_ima_spill3_read); +} + + +/** + * @test cmp_ent_set_non_ima_cmp_par3 + * @test cmp_ent_get_non_ima_cmp_par3 + */ + +void test_ent_non_ima_cmp_par3(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t non_ima_cmp_par3, non_ima_cmp_par3_read; + uint8_t *entity_p = (uint8_t *)&ent; + + non_ima_cmp_par3 = 0x1234; + error = cmp_ent_set_non_ima_cmp_par3(&ent, non_ima_cmp_par3); + TEST_ASSERT_FALSE(error); + + non_ima_cmp_par3_read = cmp_ent_get_non_ima_cmp_par3(&ent); + TEST_ASSERT_EQUAL_UINT32(non_ima_cmp_par3, non_ima_cmp_par3_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[45]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[46]); + + /* error cases */ + non_ima_cmp_par3 = 0x10000; + error = cmp_ent_set_non_ima_cmp_par3(&ent, non_ima_cmp_par3); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_non_ima_cmp_par3(NULL, non_ima_cmp_par3); + TEST_ASSERT_TRUE(error); + non_ima_cmp_par3_read = cmp_ent_get_non_ima_cmp_par3(NULL); + TEST_ASSERT_EQUAL_UINT32(0, non_ima_cmp_par3_read); +} + + +/** + * @test cmp_ent_set_non_ima_spill4 + * @test cmp_ent_get_non_ima_spill4 + */ + +void test_ent_non_ima_spill4(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t non_ima_spill4, non_ima_spill4_read; + uint8_t *entity_p = (uint8_t *)&ent; + + non_ima_spill4 = 0x123456; + error = cmp_ent_set_non_ima_spill4(&ent, non_ima_spill4); + TEST_ASSERT_FALSE(error); + + non_ima_spill4_read = cmp_ent_get_non_ima_spill4(&ent); + TEST_ASSERT_EQUAL_UINT32(non_ima_spill4, non_ima_spill4_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[47]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[48]); + TEST_ASSERT_EQUAL_HEX(0x56, entity_p[49]); + + /* error cases */ + non_ima_spill4 = 0x1000000; + error = cmp_ent_set_non_ima_spill4(&ent, non_ima_spill4); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_non_ima_spill4(NULL, non_ima_spill4); + TEST_ASSERT_TRUE(error); + non_ima_spill4_read = cmp_ent_get_non_ima_spill4(NULL); + TEST_ASSERT_EQUAL_UINT32(0, non_ima_spill4_read); +} + + +/** + * @test cmp_ent_set_non_ima_cmp_par4 + * @test cmp_ent_get_non_ima_cmp_par4 + */ + +void test_ent_non_ima_cmp_par4(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t non_ima_cmp_par4, non_ima_cmp_par4_read; + uint8_t *entity_p = (uint8_t *)&ent; + + non_ima_cmp_par4 = 0x1234; + error = cmp_ent_set_non_ima_cmp_par4(&ent, non_ima_cmp_par4); + TEST_ASSERT_FALSE(error); + + non_ima_cmp_par4_read = cmp_ent_get_non_ima_cmp_par4(&ent); + TEST_ASSERT_EQUAL_UINT32(non_ima_cmp_par4, non_ima_cmp_par4_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[50]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[51]); + + /* error cases */ + non_ima_cmp_par4 = 0x10000; + error = cmp_ent_set_non_ima_cmp_par4(&ent, non_ima_cmp_par4); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_non_ima_cmp_par4(NULL, non_ima_cmp_par4); + TEST_ASSERT_TRUE(error); + non_ima_cmp_par4_read = cmp_ent_get_non_ima_cmp_par4(NULL); + TEST_ASSERT_EQUAL_UINT32(0, non_ima_cmp_par4_read); +} + + +/** + * @test cmp_ent_set_non_ima_spill5 + * @test cmp_ent_get_non_ima_spill5 + */ + +void test_ent_non_ima_spill5(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t non_ima_spill5, non_ima_spill5_read; + uint8_t *entity_p = (uint8_t *)&ent; + + non_ima_spill5 = 0x123456; + error = cmp_ent_set_non_ima_spill5(&ent, non_ima_spill5); + TEST_ASSERT_FALSE(error); + + non_ima_spill5_read = cmp_ent_get_non_ima_spill5(&ent); + TEST_ASSERT_EQUAL_UINT32(non_ima_spill5, non_ima_spill5_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[52]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[53]); + TEST_ASSERT_EQUAL_HEX(0x56, entity_p[54]); + + /* error cases */ + non_ima_spill5 = 0x1000000; + error = cmp_ent_set_non_ima_spill5(&ent, non_ima_spill5); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_non_ima_spill5(NULL, non_ima_spill5); + TEST_ASSERT_TRUE(error); + non_ima_spill5_read = cmp_ent_get_non_ima_spill5(NULL); + TEST_ASSERT_EQUAL_UINT32(0, non_ima_spill5_read); +} + + +/** + * @test cmp_ent_set_non_ima_cmp_par5 + * @test cmp_ent_get_non_ima_cmp_par5 + */ + +void test_ent_non_ima_cmp_par5(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t non_ima_cmp_par5, non_ima_cmp_par5_read; + uint8_t *entity_p = (uint8_t *)&ent; + + non_ima_cmp_par5 = 0x1234; + error = cmp_ent_set_non_ima_cmp_par5(&ent, non_ima_cmp_par5); + TEST_ASSERT_FALSE(error); + + non_ima_cmp_par5_read = cmp_ent_get_non_ima_cmp_par5(&ent); + TEST_ASSERT_EQUAL_UINT32(non_ima_cmp_par5, non_ima_cmp_par5_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[55]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[56]); + + /* error cases */ + non_ima_cmp_par5 = 0x10000; + error = cmp_ent_set_non_ima_cmp_par5(&ent, non_ima_cmp_par5); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_non_ima_cmp_par5(NULL, non_ima_cmp_par5); + TEST_ASSERT_TRUE(error); + non_ima_cmp_par5_read = cmp_ent_get_non_ima_cmp_par5(NULL); + TEST_ASSERT_EQUAL_UINT32(0, non_ima_cmp_par5_read); +} + + +/** + * @test cmp_ent_set_non_ima_spill6 + * @test cmp_ent_get_non_ima_spill6 + */ + +void test_ent_non_ima_spill6(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t non_ima_spill6, non_ima_spill6_read; + uint8_t *entity_p = (uint8_t *)&ent; + + non_ima_spill6 = 0x123456; + error = cmp_ent_set_non_ima_spill6(&ent, non_ima_spill6); + TEST_ASSERT_FALSE(error); + + non_ima_spill6_read = cmp_ent_get_non_ima_spill6(&ent); + TEST_ASSERT_EQUAL_UINT32(non_ima_spill6, non_ima_spill6_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[57]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[58]); + TEST_ASSERT_EQUAL_HEX(0x56, entity_p[59]); + + /* error cases */ + non_ima_spill6 = 0x1000000; + error = cmp_ent_set_non_ima_spill6(&ent, non_ima_spill6); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_non_ima_spill6(NULL, non_ima_spill6); + TEST_ASSERT_TRUE(error); + non_ima_spill6_read = cmp_ent_get_non_ima_spill6(NULL); + TEST_ASSERT_EQUAL_UINT32(0, non_ima_spill6_read); +} + + +/** + * @test cmp_ent_set_non_ima_cmp_par6 + * @test cmp_ent_get_non_ima_cmp_par6 + */ + +void test_ent_non_ima_cmp_par6(void) +{ + int error; + struct cmp_entity ent = {0}; + uint32_t non_ima_cmp_par6, non_ima_cmp_par6_read; + uint8_t *entity_p = (uint8_t *)&ent; + + non_ima_cmp_par6 = 0x1234; + error = cmp_ent_set_non_ima_cmp_par6(&ent, non_ima_cmp_par6); + TEST_ASSERT_FALSE(error); + + non_ima_cmp_par6_read = cmp_ent_get_non_ima_cmp_par6(&ent); + TEST_ASSERT_EQUAL_UINT32(non_ima_cmp_par6, non_ima_cmp_par6_read); + + /* check the right position in the header */ + TEST_ASSERT_EQUAL_HEX(0x12, entity_p[60]); + TEST_ASSERT_EQUAL_HEX(0x34, entity_p[61]); + + /* error cases */ + non_ima_cmp_par6 = 0x10000; + error = cmp_ent_set_non_ima_cmp_par6(&ent, non_ima_cmp_par6); + TEST_ASSERT_TRUE(error); + error = cmp_ent_set_non_ima_cmp_par6(NULL, non_ima_cmp_par6); + TEST_ASSERT_TRUE(error); + non_ima_cmp_par6_read = cmp_ent_get_non_ima_cmp_par6(NULL); + TEST_ASSERT_EQUAL_UINT32(0, non_ima_cmp_par6_read); +} + + +/** + * @test cmp_ent_get_data_buf + */ void test_cmp_ent_get_data_buf(void) { @@ -9,9 +1298,10 @@ void test_cmp_ent_get_data_buf(void) struct cmp_entity ent = {0}; char *adr; uint32_t s, hdr_size; + int error; for (data_type = DATA_TYPE_IMAGETTE; - data_type <=DATA_TYPE_F_CAM_IMAGETTE_ADAPTIVE; + data_type <= DATA_TYPE_F_CAM_IMAGETTE_ADAPTIVE; data_type++) { s = cmp_ent_create(&ent, data_type, 0, 0); TEST_ASSERT_NOT_EQUAL_INT(0, s); @@ -25,7 +1315,7 @@ void test_cmp_ent_get_data_buf(void) /* RAW mode test */ for (data_type = DATA_TYPE_IMAGETTE; - data_type <=DATA_TYPE_F_CAM_IMAGETTE_ADAPTIVE; + data_type <= DATA_TYPE_F_CAM_IMAGETTE_ADAPTIVE; data_type++) { s = cmp_ent_create(&ent, data_type, 1, 0); TEST_ASSERT_NOT_EQUAL_INT(0, s); @@ -42,10 +1332,1400 @@ void test_cmp_ent_get_data_buf(void) TEST_ASSERT_NULL(adr); /* compression data type not supported test */ - s = cmp_ent_set_data_type(&ent, DATA_TYPE_UNKNOWN, 0); - TEST_ASSERT_FALSE(s); + error = cmp_ent_set_data_type(&ent, DATA_TYPE_UNKNOWN, 0); + TEST_ASSERT_FALSE(error); adr = cmp_ent_get_data_buf(&ent); TEST_ASSERT_NULL(adr); } + +/** + * @test cmp_ent_get_cmp_data + */ + +void test_cmp_ent_get_cmp_data(void) +{ + int32_t size; + struct cmp_entity *ent; + uint32_t *data_buf; + uint32_t s; + uint8_t i; + uint8_t *data_p; + + /* setup compression entity */ + s = cmp_ent_create(NULL, DATA_TYPE_S_FX, 0, 12); + TEST_ASSERT_EQUAL_INT(NON_IMAGETTE_HEADER_SIZE + 12, s); + ent = malloc(s); TEST_ASSERT_NOT_NULL(ent); + s = cmp_ent_create(ent, DATA_TYPE_S_FX, 0, 12); + TEST_ASSERT_EQUAL_INT(NON_IMAGETTE_HEADER_SIZE + 12, s); + data_p = cmp_ent_get_data_buf(ent); + for (i = 0; i < 12 ; ++i) + data_p[i] = i; + + size = cmp_ent_get_cmp_data(ent, NULL, 0); + TEST_ASSERT_EQUAL_INT(12, size); + data_buf = malloc(size); TEST_ASSERT_NOT_NULL(data_buf); + + size = cmp_ent_get_cmp_data(ent, data_buf, 12); + TEST_ASSERT_EQUAL_INT(12, size); + TEST_ASSERT_EQUAL_HEX32(0x00010203, data_buf[0]); + TEST_ASSERT_EQUAL_HEX32(0x04050607, data_buf[1]); + TEST_ASSERT_EQUAL_HEX32(0x08090A0B, data_buf[2]); + + /* error cases */ + size = cmp_ent_get_cmp_data(NULL, data_buf, 12); + TEST_ASSERT_EQUAL_INT(-1, size); + + cmp_ent_set_size(ent, NON_IMAGETTE_HEADER_SIZE + 11); + size = cmp_ent_get_cmp_data(ent, NULL, 12); + TEST_ASSERT_EQUAL_INT(-1, size); + cmp_ent_set_size(ent, NON_IMAGETTE_HEADER_SIZE + 12); + + size = cmp_ent_get_cmp_data(ent, data_buf, 11); + TEST_ASSERT_EQUAL_INT(-1, size); + + cmp_ent_set_data_type(ent, DATA_TYPE_UNKNOWN, 0); + size = cmp_ent_get_cmp_data(ent, data_buf, 12); + TEST_ASSERT_EQUAL_INT(-1, size); + + free(ent); + free(data_buf); +} + + +/** + * @test cmp_ent_get_cmp_data_size + */ + +void test_cmp_ent_get_cmp_data_size(void) +{ + uint32_t cmp_data_size; + struct cmp_entity ent; + + cmp_ent_set_data_type(&ent, DATA_TYPE_L_FX_EFX, 0); + cmp_ent_set_size(&ent, 100); + cmp_data_size = cmp_ent_get_cmp_data_size(&ent); + TEST_ASSERT_EQUAL_UINT(100-NON_IMAGETTE_HEADER_SIZE, cmp_data_size); + + /* raw mode test */ + cmp_ent_set_data_type(&ent, DATA_TYPE_L_FX_EFX, 1); + cmp_data_size = cmp_ent_get_cmp_data_size(&ent); + TEST_ASSERT_EQUAL_UINT(100-GENERIC_HEADER_SIZE, cmp_data_size); + + /* error case */ + + cmp_ent_set_data_type(&ent, DATA_TYPE_L_FX_NCOB, 0); + cmp_ent_set_size(&ent, NON_IMAGETTE_HEADER_SIZE-1); + cmp_data_size = cmp_ent_get_cmp_data_size(&ent); + TEST_ASSERT_EQUAL_UINT(0, cmp_data_size); +} + + +/** + * @test cmp_ent_write_cmp_pars + * @test cmp_ent_read_header + */ + +void test_cmp_ent_write_cmp_pars(void) +{ + int error; + struct cmp_entity *ent; + struct cmp_cfg cfg = {0}, cfg_read = {0}; + int cmp_size_bits; + uint32_t size; + struct cmp_max_used_bits max_used_bits = {0}; + + /* set up max used bit version */ + max_used_bits.version = 42; + cmp_set_max_used_bits(&max_used_bits); + + cmp_size_bits = 93; + /** RAW mode test **/ + /* create imagette raw mode configuration */ + cfg.data_type = DATA_TYPE_IMAGETTE; + cfg.cmp_mode = CMP_MODE_RAW; + cfg.model_value = 11; + cfg.round = 2; + cfg.samples = 9; + + /* create a compression entity */ + size = cmp_ent_create(NULL, cfg.data_type, cfg.cmp_mode == CMP_MODE_RAW, 12); + TEST_ASSERT_NOT_EQUAL_INT(0, size); + ent = malloc(size); TEST_ASSERT_NOT_NULL(ent); + size = cmp_ent_create(ent, cfg.data_type, cfg.cmp_mode == CMP_MODE_RAW, 12); + TEST_ASSERT_NOT_EQUAL_INT(0, size); + + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_FALSE(error); + + TEST_ASSERT_EQUAL_INT(cfg.data_type, cmp_ent_get_data_type(ent)); + TEST_ASSERT_EQUAL_INT(1, cmp_ent_get_data_type_raw_bit(ent)); + TEST_ASSERT_EQUAL_INT(12, cmp_ent_get_cmp_data_size(ent)); + + TEST_ASSERT_EQUAL_INT(cmp_cal_size_of_data(cfg.samples, cfg.data_type), cmp_ent_get_original_size(ent)); + TEST_ASSERT_EQUAL_INT(cfg.cmp_mode, cmp_ent_get_cmp_mode(ent)); + TEST_ASSERT_EQUAL_INT(cfg.model_value, cmp_ent_get_model_value(ent)); + TEST_ASSERT_EQUAL_INT(max_used_bits.version, cmp_ent_get_max_used_bits_version(ent)); + TEST_ASSERT_EQUAL_INT(cfg.round, cmp_ent_get_lossy_cmp_par(ent)); + + error = cmp_ent_read_header(ent, &cfg_read); + TEST_ASSERT_FALSE(error); + cfg.icu_output_buf = cmp_ent_get_data_buf(ent); /* quick fix that both cfg are equal */ + cfg.buffer_length = 12; /* quick fix that both cfg are equal */ + TEST_ASSERT_EQUAL_MEMORY(&cfg, &cfg_read, sizeof(struct cmp_cfg)); + + free(ent); + memset(&cfg, 0, sizeof(struct cmp_cfg)); + memset(&cfg_read, 0, sizeof(struct cmp_cfg)); + + /** imagette test **/ + /* create imagette mode configuration */ + cfg.data_type = DATA_TYPE_IMAGETTE; + cfg.cmp_mode = CMP_MODE_MODEL_ZERO; + cfg.model_value = 11; + cfg.round = 2; + cfg.samples = 9; + cfg.spill = MIN_IMA_SPILL; + cfg.golomb_par = MAX_IMA_GOLOMB_PAR; + + /* create a compression entity */ + size = cmp_ent_create(NULL, cfg.data_type, cfg.cmp_mode == CMP_MODE_RAW, 12); + TEST_ASSERT_NOT_EQUAL_INT(0, size); + ent = malloc(size); TEST_ASSERT_NOT_NULL(ent); + size = cmp_ent_create(ent, cfg.data_type, cfg.cmp_mode == CMP_MODE_RAW, 12); + TEST_ASSERT_NOT_EQUAL_INT(0, size); + + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_FALSE(error); + + TEST_ASSERT_EQUAL_INT(cfg.data_type, cmp_ent_get_data_type(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_data_type_raw_bit(ent)); + TEST_ASSERT_EQUAL_INT(12, cmp_ent_get_cmp_data_size(ent)); + + TEST_ASSERT_EQUAL_INT(cmp_cal_size_of_data(cfg.samples, cfg.data_type), cmp_ent_get_original_size(ent)); + TEST_ASSERT_EQUAL_INT(cfg.cmp_mode, cmp_ent_get_cmp_mode(ent)); + TEST_ASSERT_EQUAL_INT(cfg.model_value, cmp_ent_get_model_value(ent)); + TEST_ASSERT_EQUAL_INT(max_used_bits.version, cmp_ent_get_max_used_bits_version(ent)); + TEST_ASSERT_EQUAL_INT(cfg.round, cmp_ent_get_lossy_cmp_par(ent)); + + TEST_ASSERT_EQUAL_INT(cfg.spill, cmp_ent_get_ima_spill(ent)); + TEST_ASSERT_EQUAL_INT(cfg.golomb_par, cmp_ent_get_ima_golomb_par(ent)); + + error = cmp_ent_read_header(ent, &cfg_read); + TEST_ASSERT_FALSE(error); + cfg.icu_output_buf = cmp_ent_get_data_buf(ent); /* quick fix that both cfg are equal */ + cfg.buffer_length = 12; /* quick fix that both cfg are equal */ + TEST_ASSERT_EQUAL_MEMORY(&cfg, &cfg_read, sizeof(struct cmp_cfg)); + + free(ent); + memset(&cfg, 0, sizeof(struct cmp_cfg)); + memset(&cfg_read, 0, sizeof(struct cmp_cfg)); + + /** adaptive imagette test **/ + /* create a configuration */ + cfg.data_type = DATA_TYPE_IMAGETTE_ADAPTIVE; + cfg.cmp_mode = CMP_MODE_MODEL_ZERO; + cfg.model_value = 11; + cfg.round = 2; + cfg.samples = 9; + cfg.spill = MIN_IMA_SPILL; + cfg.golomb_par = MAX_IMA_GOLOMB_PAR; + cfg.ap1_spill = 555; + cfg.ap1_golomb_par = 14; + cfg.ap2_spill = 333; + cfg.ap2_golomb_par = 43; + + /* create a compression entity */ + size = cmp_ent_create(NULL, cfg.data_type, cfg.cmp_mode == CMP_MODE_RAW, 12); + TEST_ASSERT_NOT_EQUAL_INT(0, size); + ent = malloc(size); TEST_ASSERT_NOT_NULL(ent); + size = cmp_ent_create(ent, cfg.data_type, cfg.cmp_mode == CMP_MODE_RAW, 12); + TEST_ASSERT_NOT_EQUAL_INT(0, size); + + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_FALSE(error); + + TEST_ASSERT_EQUAL_INT(cfg.data_type, cmp_ent_get_data_type(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_data_type_raw_bit(ent)); + TEST_ASSERT_EQUAL_INT(12, cmp_ent_get_cmp_data_size(ent)); + + TEST_ASSERT_EQUAL_INT(cmp_cal_size_of_data(cfg.samples, cfg.data_type), cmp_ent_get_original_size(ent)); + TEST_ASSERT_EQUAL_INT(cfg.cmp_mode, cmp_ent_get_cmp_mode(ent)); + TEST_ASSERT_EQUAL_INT(cfg.model_value, cmp_ent_get_model_value(ent)); + TEST_ASSERT_EQUAL_INT(max_used_bits.version, cmp_ent_get_max_used_bits_version(ent)); + TEST_ASSERT_EQUAL_INT(cfg.round, cmp_ent_get_lossy_cmp_par(ent)); + + TEST_ASSERT_EQUAL_INT(cfg.spill, cmp_ent_get_ima_spill(ent)); + TEST_ASSERT_EQUAL_INT(cfg.golomb_par, cmp_ent_get_ima_golomb_par(ent)); + TEST_ASSERT_EQUAL_INT(cfg.ap1_spill, cmp_ent_get_ima_ap1_spill(ent)); + TEST_ASSERT_EQUAL_INT(cfg.ap1_golomb_par, cmp_ent_get_ima_ap1_golomb_par(ent)); + TEST_ASSERT_EQUAL_INT(cfg.ap2_spill, cmp_ent_get_ima_ap2_spill(ent)); + TEST_ASSERT_EQUAL_INT(cfg.ap2_golomb_par, cmp_ent_get_ima_ap2_golomb_par(ent)); + + error = cmp_ent_read_header(ent, &cfg_read); + TEST_ASSERT_FALSE(error); + cfg.icu_output_buf = cmp_ent_get_data_buf(ent); /* quick fix that both cfg are equal */ + cfg.buffer_length = 12; /* quick fix that both cfg are equal */ + TEST_ASSERT_EQUAL_MEMORY(&cfg, &cfg_read, sizeof(struct cmp_cfg)); + + free(ent); + memset(&cfg, 0, sizeof(struct cmp_cfg)); + memset(&cfg_read, 0, sizeof(struct cmp_cfg)); + + /** flux cob data type test **/ + /* create configuration */ + cfg.data_type = DATA_TYPE_S_FX_EFX_NCOB_ECOB; + cfg.cmp_mode = CMP_MODE_MODEL_ZERO; + cfg.model_value = 11; + cfg.round = 2; + cfg.samples = 9; + cfg.spill_exp_flags = 1; + cfg.spill_fx = 2; + cfg.spill_ncob = 3; + cfg.spill_efx = 4; + cfg.spill_ecob = 5; + cfg.spill_fx_cob_variance = 6; + cfg.cmp_par_exp_flags = 7; + cfg.cmp_par_fx = 8; + cfg.cmp_par_ncob = 9; + cfg.cmp_par_efx = 10; + cfg.cmp_par_ecob = 11; + cfg.cmp_par_fx_cob_variance = 12; + + /* create a compression entity */ + size = cmp_ent_create(NULL, cfg.data_type, cfg.cmp_mode == CMP_MODE_RAW, 12); + TEST_ASSERT_NOT_EQUAL_INT(0, size); + ent = malloc(size); TEST_ASSERT_NOT_NULL(ent); + size = cmp_ent_create(ent, cfg.data_type, cfg.cmp_mode == CMP_MODE_RAW, 12); + TEST_ASSERT_NOT_EQUAL_INT(0, size); + + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_FALSE(error); + + TEST_ASSERT_EQUAL_INT(cfg.data_type, cmp_ent_get_data_type(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_data_type_raw_bit(ent)); + TEST_ASSERT_EQUAL_INT(12, cmp_ent_get_cmp_data_size(ent)); + + TEST_ASSERT_EQUAL_INT(cmp_cal_size_of_data(cfg.samples, cfg.data_type), cmp_ent_get_original_size(ent)); + TEST_ASSERT_EQUAL_INT(cfg.cmp_mode, cmp_ent_get_cmp_mode(ent)); + TEST_ASSERT_EQUAL_INT(cfg.model_value, cmp_ent_get_model_value(ent)); + TEST_ASSERT_EQUAL_INT(max_used_bits.version, cmp_ent_get_max_used_bits_version(ent)); + TEST_ASSERT_EQUAL_INT(cfg.round, cmp_ent_get_lossy_cmp_par(ent)); + + + TEST_ASSERT_EQUAL_INT(cfg.spill_exp_flags, cmp_ent_get_non_ima_spill1(ent)); + TEST_ASSERT_EQUAL_INT(cfg.spill_fx, cmp_ent_get_non_ima_spill2(ent)); + TEST_ASSERT_EQUAL_INT(cfg.spill_ncob, cmp_ent_get_non_ima_spill3(ent)); + TEST_ASSERT_EQUAL_INT(cfg.spill_efx, cmp_ent_get_non_ima_spill4(ent)); + TEST_ASSERT_EQUAL_INT(cfg.spill_ecob, cmp_ent_get_non_ima_spill5(ent)); + TEST_ASSERT_EQUAL_INT(cfg.spill_fx_cob_variance, cmp_ent_get_non_ima_spill6(ent)); + TEST_ASSERT_EQUAL_INT(cfg.cmp_par_exp_flags, cmp_ent_get_non_ima_cmp_par1(ent)); + TEST_ASSERT_EQUAL_INT(cfg.cmp_par_fx, cmp_ent_get_non_ima_cmp_par2(ent)); + TEST_ASSERT_EQUAL_INT(cfg.cmp_par_ncob, cmp_ent_get_non_ima_cmp_par3(ent)); + TEST_ASSERT_EQUAL_INT(cfg.cmp_par_efx, cmp_ent_get_non_ima_cmp_par4(ent)); + TEST_ASSERT_EQUAL_INT(cfg.cmp_par_ecob, cmp_ent_get_non_ima_cmp_par5(ent)); + TEST_ASSERT_EQUAL_INT(cfg.cmp_par_fx_cob_variance, cmp_ent_get_non_ima_cmp_par6(ent)); + + error = cmp_ent_read_header(ent, &cfg_read); + TEST_ASSERT_FALSE(error); + cfg.icu_output_buf = cmp_ent_get_data_buf(ent); /* quick fix that both cfg are equal */ + cfg.buffer_length = 12; /* quick fix that both cfg are equal */ + TEST_ASSERT_EQUAL_MEMORY(&cfg, &cfg_read, sizeof(struct cmp_cfg)); + + free(ent); + memset(&cfg, 0, sizeof(struct cmp_cfg)); + memset(&cfg_read, 0, sizeof(struct cmp_cfg)); + + /** auxiliary data data_type test **/ + /* create configuration */ + cfg.data_type = DATA_TYPE_SMEARING; + cfg.cmp_mode = CMP_MODE_MODEL_ZERO; + cfg.model_value = 11; + cfg.round = 2; + cfg.samples = 9; + cfg.spill_mean = 1; + cfg.spill_variance = 2; + cfg.spill_pixels_error = 3; + cfg.cmp_par_mean = 7; + cfg.cmp_par_variance = 8; + cfg.cmp_par_pixels_error = 9; + + /* create a compression entity */ + size = cmp_ent_create(NULL, cfg.data_type, cfg.cmp_mode == CMP_MODE_RAW, 12); + TEST_ASSERT_NOT_EQUAL_INT(0, size); + ent = malloc(size); TEST_ASSERT_NOT_NULL(ent); + size = cmp_ent_create(ent, cfg.data_type, cfg.cmp_mode == CMP_MODE_RAW, 12); + TEST_ASSERT_NOT_EQUAL_INT(0, size); + + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_FALSE(error); + + TEST_ASSERT_EQUAL_INT(cfg.data_type, cmp_ent_get_data_type(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_data_type_raw_bit(ent)); + TEST_ASSERT_EQUAL_INT(12, cmp_ent_get_cmp_data_size(ent)); + + TEST_ASSERT_EQUAL_INT(cmp_cal_size_of_data(cfg.samples, cfg.data_type), cmp_ent_get_original_size(ent)); + TEST_ASSERT_EQUAL_INT(cfg.cmp_mode, cmp_ent_get_cmp_mode(ent)); + TEST_ASSERT_EQUAL_INT(cfg.model_value, cmp_ent_get_model_value(ent)); + TEST_ASSERT_EQUAL_INT(max_used_bits.version, cmp_ent_get_max_used_bits_version(ent)); + TEST_ASSERT_EQUAL_INT(cfg.round, cmp_ent_get_lossy_cmp_par(ent)); + + + TEST_ASSERT_EQUAL_INT(cfg.spill_mean, cmp_ent_get_non_ima_spill1(ent)); + TEST_ASSERT_EQUAL_INT(cfg.spill_variance, cmp_ent_get_non_ima_spill2(ent)); + TEST_ASSERT_EQUAL_INT(cfg.spill_pixels_error, cmp_ent_get_non_ima_spill3(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_non_ima_spill4(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_non_ima_spill5(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_non_ima_spill6(ent)); + TEST_ASSERT_EQUAL_INT(cfg.cmp_par_mean, cmp_ent_get_non_ima_cmp_par1(ent)); + TEST_ASSERT_EQUAL_INT(cfg.cmp_par_variance, cmp_ent_get_non_ima_cmp_par2(ent)); + TEST_ASSERT_EQUAL_INT(cfg.cmp_par_pixels_error, cmp_ent_get_non_ima_cmp_par3(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_non_ima_cmp_par4(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_non_ima_cmp_par5(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_non_ima_cmp_par6(ent)); + + error = cmp_ent_read_header(ent, &cfg_read); + TEST_ASSERT_FALSE(error); + cfg.icu_output_buf = cmp_ent_get_data_buf(ent); /* quick fix that both cfg are equal */ + cfg.buffer_length = 12; /* quick fix that both cfg are equal */ + TEST_ASSERT_EQUAL_MEMORY(&cfg, &cfg_read, sizeof(struct cmp_cfg)); + + free(ent); + memset(&cfg, 0, sizeof(struct cmp_cfg)); + memset(&cfg_read, 0, sizeof(struct cmp_cfg)); + + /** Error Cases **/ + /* create imagette raw mode configuration */ + cfg.data_type = DATA_TYPE_IMAGETTE; + cfg.cmp_mode = CMP_MODE_MODEL_ZERO; + cfg.model_value = 11; + cfg.round = 2; + cfg.samples = 9; + + /* create a compression entity */ + size = cmp_ent_create(NULL, cfg.data_type, cfg.cmp_mode == CMP_MODE_RAW, 12); + TEST_ASSERT_NOT_EQUAL_INT(0, size); + ent = malloc(size); TEST_ASSERT_NOT_NULL(ent); + size = cmp_ent_create(ent, cfg.data_type, cfg.cmp_mode == CMP_MODE_RAW, 12); + TEST_ASSERT_NOT_EQUAL_INT(0, size); + + + /* ent = NULL */ + error = cmp_ent_write_cmp_pars(NULL, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + + /* cfg = NULL */ + error = cmp_ent_write_cmp_pars(ent, NULL, cmp_size_bits); + TEST_ASSERT_TRUE(error); + + /* cmp_size_bits negative */ + error = cmp_ent_write_cmp_pars(ent, &cfg, -1); + TEST_ASSERT_TRUE(error); + + /* data_type mismatch */ + cfg.data_type = DATA_TYPE_S_FX; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.data_type = DATA_TYPE_IMAGETTE; + + /* compressed data to big for compression entity */ + error = cmp_ent_write_cmp_pars(ent, &cfg, 97); + TEST_ASSERT_TRUE(error); + + /* original_size to high */ + cfg.samples = 0x800000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.samples = 0x7FFFFF; + + /* cmp_mode to high */ + cfg.cmp_mode = 0x100; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.cmp_mode = 0xFF; + + /* max model_value to high */ + cfg.model_value = 0x100; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.model_value = 0xFF; + + /* max used bit version to high */ + TEST_ASSERT_EQUAL_INT(1, sizeof(max_used_bits.version)); +#if 0 + max_used_bits.version = 0x100; + cmp_set_max_used_bits(&max_used_bits); + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + max_used_bits.version = 42; + cmp_set_max_used_bits(&max_used_bits); +#endif + + /* max lossy_cmp_par to high */ + cfg.round = 0x10000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.round = 0xFFFF; + + /* The entity's raw data bit is not set, but the configuration contains raw data */ + cfg.cmp_mode = CMP_MODE_RAW; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.cmp_mode = CMP_MODE_MODEL_MULTI; + + /* The entity's raw data bit is set, but the configuration contains no raw data */ + cmp_ent_set_data_type(ent, cfg.data_type, 1); /* set raw bit */ + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cmp_ent_set_data_type(ent, cfg.data_type, 0); + + /* spill to high */ + cfg.spill = 0x10000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.spill = 0xFFFF; + + /* golomb_par to high */ + cfg.golomb_par = 0x100; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.golomb_par = 0xFF; + + + cmp_ent_set_data_type(ent, DATA_TYPE_SAT_IMAGETTE_ADAPTIVE, 0); + cfg.data_type = DATA_TYPE_SAT_IMAGETTE_ADAPTIVE; + cmp_size_bits = 1; + /* adaptive 1 spill to high */ + cfg.ap1_spill = 0x10000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.ap1_spill = 0xFFFF; + + /* adaptive 1 golomb_par to high */ + cfg.ap1_golomb_par = 0x100; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.ap1_golomb_par = 0xFF; + + /* adaptive 2 spill to high */ + cfg.ap2_spill = 0x10000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.ap2_spill = 0xFFFF; + + /* adaptive 2 golomb_par to high */ + cfg.ap2_golomb_par = 0x100; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.ap2_golomb_par = 0xFF; + + cmp_ent_set_data_type(ent, DATA_TYPE_OFFSET, 0); + cfg.data_type = DATA_TYPE_OFFSET; + + free(ent); + + /* create a compression entity */ + cfg.data_type = DATA_TYPE_OFFSET; + cfg.samples = 9; + size = cmp_ent_create(NULL, cfg.data_type, cfg.cmp_mode == CMP_MODE_RAW, 12); + TEST_ASSERT_NOT_EQUAL_INT(0, size); + ent = malloc(size); TEST_ASSERT_NOT_NULL(ent); + size = cmp_ent_create(ent, cfg.data_type, cfg.cmp_mode == CMP_MODE_RAW, 12); + TEST_ASSERT_NOT_EQUAL_INT(0, size); + + /* mean cmp_par to high */ + cfg.cmp_par_mean = 0x10000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.cmp_par_mean = 0xFFFF; + + /* mean spill to high */ + cfg.spill_mean = 0x1000000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.spill_mean = 0xFFFFFF; + + /* variance cmp_par to high */ + cfg.cmp_par_variance = 0x10000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.cmp_par_variance = 0xFFFF; + + /* variance spill to high */ + cfg.spill_variance = 0x1000000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.spill_variance = 0xFFFFFF; + + /* pixels_error cmp_par to high */ + cfg.cmp_par_pixels_error = 0x10000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.cmp_par_pixels_error = 0xFFFF; + + /* pixels_error spill to high */ + cfg.spill_pixels_error = 0x1000000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.spill_pixels_error = 0xFFFFFF; + + + cmp_ent_set_data_type(ent, DATA_TYPE_F_FX_EFX_NCOB_ECOB, 0); + cfg.data_type = DATA_TYPE_F_FX_EFX_NCOB_ECOB; + + /* exp_flags cmp_par to high */ + cfg.cmp_par_exp_flags = 0x10000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.cmp_par_exp_flags = 0xFFFF; + + /* exp_flags spill to high */ + cfg.spill_exp_flags = 0x1000000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.spill_exp_flags = 0xFFFFFF; + + /* fx cmp_par to high */ + cfg.cmp_par_fx = 0x10000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.cmp_par_fx = 0xFFFF; + + /* fx spill to high */ + cfg.spill_fx = 0x1000000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.spill_fx = 0xFFFFFF; + + /* ncob cmp_par to high */ + cfg.cmp_par_ncob = 0x10000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.cmp_par_ncob = 0xFFFF; + + /* ncob spill to high */ + cfg.spill_ncob = 0x1000000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.spill_ncob = 0xFFFFFF; + + /* efx cmp_par to high */ + cfg.cmp_par_efx = 0x10000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.cmp_par_efx = 0xFFFF; + + /* efx spill to high */ + cfg.spill_efx = 0x1000000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.spill_efx = 0xFFFFFF; + + /* ecob cmp_par to high */ + cfg.cmp_par_ecob = 0x10000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.cmp_par_ecob = 0xFFFF; + + /* ecob spill to high */ + cfg.spill_ecob = 0x1000000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.spill_ecob = 0xFFFFFF; + + /* fx_cob_variance cmp_par to high */ + cfg.cmp_par_fx_cob_variance = 0x10000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.cmp_par_fx_cob_variance = 0xFFFF; + + /* fx_cob_variance spill to high */ + cfg.spill_fx_cob_variance = 0x1000000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + cfg.spill_fx_cob_variance = 0xFFFFFF; + + /* test data type = DATA_TYPE_UNKNOWN */ + cmp_ent_set_data_type(ent, DATA_TYPE_UNKNOWN, 0); + cfg.data_type = DATA_TYPE_UNKNOWN; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + + /* test data type = DATA_TYPE_F_CAM_BACKGROUND +1 */ + cmp_ent_set_data_type(ent, DATA_TYPE_F_CAM_BACKGROUND + 1, 0); + cfg.data_type = DATA_TYPE_F_CAM_BACKGROUND + 1; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + free(ent); +} + + +/** + * @test cmp_ent_write_rdcu_cmp_pars + */ + +void test_cmp_ent_write_rdcu_cmp_pars(void) +{ + int error; + uint32_t size; + struct cmp_entity *ent; + struct cmp_info info; + struct cmp_cfg cfg; + struct cmp_max_used_bits max_used_bits = {0}; + + /* set up max used bit version */ + max_used_bits.version = 42; + cmp_set_max_used_bits(&max_used_bits); + + info.cmp_mode_used = CMP_MODE_DIFF_ZERO; + info.spill_used = 42; + info.golomb_par_used = 23; + info.samples_used = 9; + info.cmp_size = 96; + /* info.ap1_cmp_size = 100; */ + /* info.ap2_cmp_size = 3; */ + /* info.rdcu_new_model_adr_used = 0x100; */ + /* info.rdcu_cmp_adr_used= 0x300; */ + info.model_value_used = 6; + info.round_used = 1; + info.cmp_err = 0; + + /* create a imagette compression entity */ + size = cmp_ent_create(NULL, DATA_TYPE_IMAGETTE, info.cmp_mode_used == CMP_MODE_RAW, 12); + TEST_ASSERT_NOT_EQUAL_INT(0, size); + ent = malloc(size); TEST_ASSERT_NOT_NULL(ent); + size = cmp_ent_create(ent, DATA_TYPE_IMAGETTE, info.cmp_mode_used == CMP_MODE_RAW, 12); + TEST_ASSERT_NOT_EQUAL_INT(0, size); + + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, NULL); + TEST_ASSERT_FALSE(error); + + TEST_ASSERT_EQUAL_INT(DATA_TYPE_IMAGETTE, cmp_ent_get_data_type(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_data_type_raw_bit(ent)); + TEST_ASSERT_EQUAL_INT(12, cmp_ent_get_cmp_data_size(ent)); + + TEST_ASSERT_EQUAL_INT(cmp_cal_size_of_data(info.samples_used, DATA_TYPE_IMAGETTE), cmp_ent_get_original_size(ent)); + TEST_ASSERT_EQUAL_INT(info.cmp_mode_used, cmp_ent_get_cmp_mode(ent)); + TEST_ASSERT_EQUAL_INT(info.model_value_used, cmp_ent_get_model_value(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_max_used_bits_version(ent)); + TEST_ASSERT_EQUAL_INT(info.round_used, cmp_ent_get_lossy_cmp_par(ent)); + + TEST_ASSERT_EQUAL_INT(info.spill_used, cmp_ent_get_ima_spill(ent)); + TEST_ASSERT_EQUAL_INT(info.golomb_par_used, cmp_ent_get_ima_golomb_par(ent)); + + free(ent); + + /* raw mode test */ + /* create a raw imagette compression entity */ + info.cmp_mode_used = CMP_MODE_RAW; + size = cmp_ent_create(NULL, DATA_TYPE_IMAGETTE, info.cmp_mode_used == CMP_MODE_RAW, 12); + TEST_ASSERT_NOT_EQUAL_INT(0, size); + ent = malloc(size); TEST_ASSERT_NOT_NULL(ent); + size = cmp_ent_create(ent, DATA_TYPE_IMAGETTE, info.cmp_mode_used == CMP_MODE_RAW, 12); + TEST_ASSERT_NOT_EQUAL_INT(0, size); + + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, NULL); + TEST_ASSERT_FALSE(error); + + TEST_ASSERT_EQUAL_INT(DATA_TYPE_IMAGETTE, cmp_ent_get_data_type(ent)); + TEST_ASSERT_EQUAL_INT(1, cmp_ent_get_data_type_raw_bit(ent)); + TEST_ASSERT_EQUAL_INT(12, cmp_ent_get_cmp_data_size(ent)); + + TEST_ASSERT_EQUAL_INT(cmp_cal_size_of_data(info.samples_used, DATA_TYPE_IMAGETTE), cmp_ent_get_original_size(ent)); + TEST_ASSERT_EQUAL_INT(info.cmp_mode_used, cmp_ent_get_cmp_mode(ent)); + TEST_ASSERT_EQUAL_INT(info.model_value_used, cmp_ent_get_model_value(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_max_used_bits_version(ent)); + TEST_ASSERT_EQUAL_INT(info.round_used, cmp_ent_get_lossy_cmp_par(ent)); + + free(ent); + + /* adaptive configuration */ + info.cmp_mode_used = CMP_MODE_MODEL_MULTI; + cfg.ap1_golomb_par = 0xFF; + cfg.ap1_spill = 1; + cfg.ap2_golomb_par = 0x32; + cfg.ap2_spill = 201; + + /* create a adaptive imagette compression entity */ + size = cmp_ent_create(NULL, DATA_TYPE_IMAGETTE_ADAPTIVE, info.cmp_mode_used == CMP_MODE_RAW, 12); + TEST_ASSERT_NOT_EQUAL_INT(0, size); + ent = malloc(size); TEST_ASSERT_NOT_NULL(ent); + size = cmp_ent_create(ent, DATA_TYPE_IMAGETTE_ADAPTIVE, info.cmp_mode_used == CMP_MODE_RAW, 12); + TEST_ASSERT_NOT_EQUAL_INT(0, size); + + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_FALSE(error); + + TEST_ASSERT_EQUAL_INT(DATA_TYPE_IMAGETTE_ADAPTIVE, cmp_ent_get_data_type(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_data_type_raw_bit(ent)); + TEST_ASSERT_EQUAL_INT(12, cmp_ent_get_cmp_data_size(ent)); + + TEST_ASSERT_EQUAL_INT(cmp_cal_size_of_data(info.samples_used, DATA_TYPE_IMAGETTE_ADAPTIVE), cmp_ent_get_original_size(ent)); + TEST_ASSERT_EQUAL_INT(info.cmp_mode_used, cmp_ent_get_cmp_mode(ent)); + TEST_ASSERT_EQUAL_INT(info.model_value_used, cmp_ent_get_model_value(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_max_used_bits_version(ent)); + TEST_ASSERT_EQUAL_INT(info.round_used, cmp_ent_get_lossy_cmp_par(ent)); + + TEST_ASSERT_EQUAL_INT(info.spill_used, cmp_ent_get_ima_spill(ent)); + TEST_ASSERT_EQUAL_INT(info.golomb_par_used, cmp_ent_get_ima_golomb_par(ent)); + TEST_ASSERT_EQUAL_INT(cfg.ap1_spill, cmp_ent_get_ima_ap1_spill(ent)); + TEST_ASSERT_EQUAL_INT(cfg.ap1_golomb_par, cmp_ent_get_ima_ap1_golomb_par(ent)); + TEST_ASSERT_EQUAL_INT(cfg.ap2_spill, cmp_ent_get_ima_ap2_spill(ent)); + TEST_ASSERT_EQUAL_INT(cfg.ap2_golomb_par, cmp_ent_get_ima_ap2_golomb_par(ent)); + + + /** error cases **/ + + /* ent = NULL */ + error = cmp_ent_write_rdcu_cmp_pars(NULL, &info, &cfg); + TEST_ASSERT_TRUE(error); + + /* info = NULL */ + error = cmp_ent_write_rdcu_cmp_pars(ent, NULL, &cfg); + TEST_ASSERT_TRUE(error); + + /* cfg = NULL and adaptive data type */ + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, NULL); + TEST_ASSERT_TRUE(error); + + /* compressed data are to big for the compression entity */ + info.cmp_size = 12*8 + 1; + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_TRUE(error); + info.cmp_size = 1; + + /* wrong data_type */ + cmp_ent_set_data_type(ent, DATA_TYPE_S_FX, 0); + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_TRUE(error); + cmp_ent_set_data_type(ent, DATA_TYPE_F_CAM_IMAGETTE_ADAPTIVE, 0); + /* this should work */ + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_FALSE(error); + + /* original_size to high */ + info.samples_used = 0x800000; + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_TRUE(error); + info.samples_used = 0x7FFFFF; + /* this should work */ + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_FALSE(error); + + /* cmp_mode to high */ + info.cmp_mode_used = 0x100; + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_TRUE(error); + info.cmp_mode_used = 0xFF; + /* this should work */ + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_FALSE(error); + + TEST_ASSERT_EQUAL_INT(1, sizeof(info.model_value_used)); + TEST_ASSERT_EQUAL_INT(1, sizeof(info.round_used)); +#if 0 + /* max model_value to high */ + info.model_value_used = 0x100; + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_TRUE(error); + info.model_value_used = 0xFF; + /* this should work */ + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_FALSE(error); + + /* max lossy_cmp_par to high */ + info.round = 0x10000; + error = cmp_ent_write_cmp_pars(ent, &cfg, cmp_size_bits); + TEST_ASSERT_TRUE(error); + info.round = 0xFFFF; + /* this should work */ + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_FALSE(error); +#endif + + /* spill to high */ + info.spill_used = 0x10000; + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_TRUE(error); + info.spill_used = 0xFFFF; + /* this should work */ + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_FALSE(error); + + /* golomb_par to high */ + info.golomb_par_used = 0x100; + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_TRUE(error); + info.golomb_par_used = 0xFF; + /* this should work */ + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_FALSE(error); + + /* adaptive 1 spill to high */ + cfg.ap1_spill = 0x10000; + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_TRUE(error); + cfg.ap1_spill = 0xFFFF; + /* this should work */ + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_FALSE(error); + + /* adaptive 1 golomb_par to high */ + cfg.ap1_golomb_par = 0x100; + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_TRUE(error); + cfg.ap1_golomb_par = 0xFF; + /* this should work */ + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_FALSE(error); + + /* adaptive 2 spill to high */ + cfg.ap2_spill = 0x10000; + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_TRUE(error); + cfg.ap2_spill = 0xFFFF; + /* this should work */ + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_FALSE(error); + + /* adaptive 2 golomb_par to high */ + cfg.ap2_golomb_par = 0x100; + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_TRUE(error); + cfg.ap2_golomb_par = 0xFF; + /* this should work */ + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_FALSE(error); + + /* The entity's raw data bit is not set, but the configuration contains raw data */ + info.cmp_mode_used = CMP_MODE_RAW; + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_TRUE(error); + info.cmp_mode_used = CMP_MODE_MODEL_MULTI; + /* this should work */ + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_FALSE(error); + + /* The entity's raw data bit is set, but the configuration contains no raw data */ + cmp_ent_set_data_type(ent, DATA_TYPE_IMAGETTE_ADAPTIVE, 1); /* set raw bit */ + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_TRUE(error); + cmp_ent_set_data_type(ent, DATA_TYPE_F_CAM_IMAGETTE_ADAPTIVE, 0); + /* this should work */ + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_FALSE(error); + + /* compression error set */ + info.cmp_err = 1; + error = cmp_ent_write_rdcu_cmp_pars(ent, &info, &cfg); + TEST_ASSERT_TRUE(error); + info.cmp_err = 0; + + free(ent); +} + + +/** + * @test cmp_ent_create + */ + +void test_cmp_ent_create(void) +{ + + uint32_t size; + struct cmp_entity *ent; + enum cmp_data_type data_type; + int raw_mode_flag; + uint32_t cmp_size_byte; + + /* create a empty compression entity */ + data_type = DATA_TYPE_IMAGETTE; + raw_mode_flag = 0; + cmp_size_byte = 0; + size = cmp_ent_create(NULL, data_type, raw_mode_flag, cmp_size_byte); + TEST_ASSERT_EQUAL_UINT32(sizeof(struct cmp_entity), size); + ent = malloc(size); TEST_ASSERT_NOT_NULL(ent); + size = cmp_ent_create(ent, data_type, raw_mode_flag, cmp_size_byte); + TEST_ASSERT_EQUAL_UINT32(sizeof(struct cmp_entity), size); + + TEST_ASSERT_EQUAL_INT(DATA_TYPE_IMAGETTE, cmp_ent_get_data_type(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_data_type_raw_bit(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_cmp_data_size(ent)); + + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_original_size(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_cmp_mode(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_model_value(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_max_used_bits_version(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_lossy_cmp_par(ent)); + + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_ima_spill(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_ima_golomb_par(ent)); + free(ent); + + /* create a compression entity */ + data_type = DATA_TYPE_IMAGETTE; + raw_mode_flag = 0; + cmp_size_byte = 100; + size = cmp_ent_create(NULL, data_type, raw_mode_flag, cmp_size_byte); + TEST_ASSERT_EQUAL_UINT32(IMAGETTE_HEADER_SIZE + cmp_size_byte, size); + ent = malloc(size); TEST_ASSERT_NOT_NULL(ent); + size = cmp_ent_create(ent, data_type, raw_mode_flag, cmp_size_byte); + TEST_ASSERT_EQUAL_UINT32(IMAGETTE_HEADER_SIZE + cmp_size_byte, size); + + TEST_ASSERT_EQUAL_INT(DATA_TYPE_IMAGETTE, cmp_ent_get_data_type(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_data_type_raw_bit(ent)); + TEST_ASSERT_EQUAL_INT(100, cmp_ent_get_cmp_data_size(ent)); + + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_original_size(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_cmp_mode(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_model_value(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_max_used_bits_version(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_lossy_cmp_par(ent)); + + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_ima_spill(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_ima_golomb_par(ent)); + free(ent); + + /* create a raw compression entity */ + data_type = DATA_TYPE_SMEARING; + raw_mode_flag = 1; + cmp_size_byte = 100; + size = cmp_ent_create(NULL, data_type, raw_mode_flag, cmp_size_byte); + TEST_ASSERT_EQUAL_UINT32(GENERIC_HEADER_SIZE + cmp_size_byte, size); + ent = malloc(size); TEST_ASSERT_NOT_NULL(ent); + size = cmp_ent_create(ent, data_type, raw_mode_flag, cmp_size_byte); + TEST_ASSERT_EQUAL_UINT32(GENERIC_HEADER_SIZE + cmp_size_byte, size); + + TEST_ASSERT_EQUAL_INT(DATA_TYPE_SMEARING, cmp_ent_get_data_type(ent)); + TEST_ASSERT_EQUAL_INT(1, cmp_ent_get_data_type_raw_bit(ent)); + TEST_ASSERT_EQUAL_INT(100, cmp_ent_get_cmp_data_size(ent)); + + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_original_size(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_cmp_mode(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_model_value(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_max_used_bits_version(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_lossy_cmp_par(ent)); + free(ent); + + /** error cases **/ + /* unknown data type */ + data_type = DATA_TYPE_UNKNOWN; + raw_mode_flag = 1; + cmp_size_byte = 100; + size = cmp_ent_create(NULL, data_type, raw_mode_flag, cmp_size_byte); + TEST_ASSERT_EQUAL_UINT32(0, size); + data_type = 0xFFF; + raw_mode_flag = 1; + cmp_size_byte = 100; + size = cmp_ent_create(NULL, data_type, raw_mode_flag, cmp_size_byte); + TEST_ASSERT_EQUAL_UINT32(0, size); + + /* cmp_size_byte to high */ + data_type = DATA_TYPE_S_FX; + raw_mode_flag = 0; + cmp_size_byte = CMP_ENTITY_MAX_SIZE+1; + size = cmp_ent_create(NULL, data_type, raw_mode_flag, cmp_size_byte); + TEST_ASSERT_EQUAL_UINT32(0, size); + cmp_size_byte = CMP_ENTITY_MAX_SIZE; + size = cmp_ent_create(NULL, data_type, raw_mode_flag, cmp_size_byte); + TEST_ASSERT_EQUAL_UINT32(0, size); + /* this should work */ + cmp_size_byte = CMP_ENTITY_MAX_SIZE - NON_IMAGETTE_HEADER_SIZE; + size = cmp_ent_create(NULL, data_type, raw_mode_flag, cmp_size_byte); + TEST_ASSERT_EQUAL_UINT32(NON_IMAGETTE_HEADER_SIZE + cmp_size_byte, size); +} + + +/** + * @test cmp_ent_build + */ + +void test_cmp_ent_build(void) +{ + size_t size; + struct cmp_entity *ent; + uint32_t version_id; + uint64_t start_time, end_time; + uint16_t model_id; + uint8_t model_counter; + struct cmp_cfg cfg; + int cmp_size_bits; + struct cmp_max_used_bits max_used_bits = {0}; + + /* set up max used bit version */ + max_used_bits.version = 42; + cmp_set_max_used_bits(&max_used_bits); + + version_id = 42; + start_time = 100; + end_time = 200; + model_id = 12; + model_counter = 23; + cfg.data_type = DATA_TYPE_F_CAM_IMAGETTE_ADAPTIVE; + cfg.cmp_mode = CMP_MODE_MODEL_MULTI; + cfg.model_value = 11; + cfg.round = 2; + cfg.samples = 9; + cfg.spill = MIN_IMA_SPILL; + cfg.golomb_par = MAX_IMA_GOLOMB_PAR; + cfg.ap1_spill = 555; + cfg.ap1_golomb_par = 14; + cfg.ap2_spill = 333; + cfg.ap2_golomb_par = 43; + cmp_size_bits = 60*8; + + size = cmp_ent_build(NULL, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(IMAGETTE_ADAPTIVE_HEADER_SIZE+60, size); + ent = malloc(size); TEST_ASSERT_NOT_NULL(ent); + size = cmp_ent_build(ent, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(IMAGETTE_ADAPTIVE_HEADER_SIZE+60, size); + + TEST_ASSERT_EQUAL_INT(version_id, cmp_ent_get_version_id(ent)); + TEST_ASSERT_EQUAL_INT(60, cmp_ent_get_cmp_data_size(ent)); + TEST_ASSERT_EQUAL_INT(cmp_cal_size_of_data(cfg.samples, cfg.data_type), cmp_ent_get_original_size(ent)); + TEST_ASSERT_EQUAL_INT(start_time, cmp_ent_get_start_timestamp(ent)); + TEST_ASSERT_EQUAL_INT(end_time, cmp_ent_get_end_timestamp(ent)); + TEST_ASSERT_EQUAL_INT(0, cmp_ent_get_data_type_raw_bit(ent)); + TEST_ASSERT_EQUAL_INT(cfg.data_type, cmp_ent_get_data_type(ent)); + + TEST_ASSERT_EQUAL_INT(cfg.cmp_mode, cmp_ent_get_cmp_mode(ent)); + TEST_ASSERT_EQUAL_INT(cfg.model_value, cmp_ent_get_model_value(ent)); + TEST_ASSERT_EQUAL_INT(model_id, cmp_ent_get_model_id(ent)); + TEST_ASSERT_EQUAL_INT(model_counter, cmp_ent_get_model_counter(ent)); + TEST_ASSERT_EQUAL_INT(max_used_bits.version, cmp_ent_get_max_used_bits_version(ent)); + TEST_ASSERT_EQUAL_INT(cfg.round, cmp_ent_get_lossy_cmp_par(ent)); + + TEST_ASSERT_EQUAL_INT(cfg.spill, cmp_ent_get_ima_spill(ent)); + TEST_ASSERT_EQUAL_INT(cfg.golomb_par, cmp_ent_get_ima_golomb_par(ent)); + TEST_ASSERT_EQUAL_INT(cfg.ap1_spill, cmp_ent_get_ima_ap1_spill(ent)); + TEST_ASSERT_EQUAL_INT(cfg.ap1_golomb_par, cmp_ent_get_ima_ap1_golomb_par(ent)); + TEST_ASSERT_EQUAL_INT(cfg.ap2_spill, cmp_ent_get_ima_ap2_spill(ent)); + TEST_ASSERT_EQUAL_INT(cfg.ap2_golomb_par, cmp_ent_get_ima_ap2_golomb_par(ent)); + + /** error cases **/ + /* cfg = NULL */ + size = cmp_ent_build(NULL, version_id, start_time, end_time, model_id, + model_counter, NULL, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(0, size); + + /* cmp_size_bits negative */ + cmp_size_bits = -1; + size = cmp_ent_build(NULL, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(0, size); + cmp_size_bits = 60*8; + + /* unknown data type */ + cfg.data_type = DATA_TYPE_UNKNOWN; + size = cmp_ent_build(NULL, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(0, size); + cfg.data_type = DATA_TYPE_F_CAM_IMAGETTE_ADAPTIVE; + +#if 0 + /* version id to high */ + version_id = 0x100000000; + size = cmp_ent_build(NULL, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(0, size); +#endif + + /* start_time to high */ + start_time = 0x1000000000000; + size = cmp_ent_build(ent, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(0, size); + /* this should work */ + start_time = 0xFFFFFFFFFFFF; + size = cmp_ent_build(ent, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(IMAGETTE_ADAPTIVE_HEADER_SIZE+60, size); + + /* end_time to high */ + end_time = 0x1000000000000; + size = cmp_ent_build(ent, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(0, size); + /* this should work */ + end_time = 0xFFFFFFFFFFFF; + size = cmp_ent_build(ent, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(IMAGETTE_ADAPTIVE_HEADER_SIZE+60, size); + + /* golomb_par to high */ + cfg.golomb_par = 0x100; + size = cmp_ent_build(ent, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(0, size); + /* this should work */ + cfg.golomb_par = 0xFF; + size = cmp_ent_build(ent, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(IMAGETTE_ADAPTIVE_HEADER_SIZE+60, size); + + free(ent); +} + + +/** + * @test cmp_ent_read_header + */ + +void test_cmp_ent_read_header_error_cases(void) + +{ + int error; + uint32_t size; + struct cmp_entity *ent; + struct cmp_cfg cfg; + + /* create a entity */ + size = cmp_ent_create(NULL, DATA_TYPE_IMAGETTE, 1, 10); + TEST_ASSERT_EQUAL_UINT32(sizeof(struct cmp_entity), size); + ent = malloc(size); TEST_ASSERT_NOT_NULL(ent); + size = cmp_ent_create(ent, DATA_TYPE_IMAGETTE, 1, 10); + TEST_ASSERT_EQUAL_UINT32(sizeof(struct cmp_entity), size); + + /* ent = NULL */ + error = cmp_ent_read_header(NULL, &cfg); + TEST_ASSERT_TRUE(error); + /* this should work */ + error = cmp_ent_read_header(ent, &cfg); + TEST_ASSERT_FALSE(error); + + /* cfg = NULL */ + error = cmp_ent_read_header(ent, NULL); + TEST_ASSERT_TRUE(error); + /* this should work */ + error = cmp_ent_read_header(ent, &cfg); + TEST_ASSERT_FALSE(error); + + /* unknown data type */ + cmp_ent_set_data_type(ent, DATA_TYPE_UNKNOWN, 1); + error = cmp_ent_read_header(ent, &cfg); + TEST_ASSERT_TRUE(error); + /* unknown data type */ + cmp_ent_set_data_type(ent, DATA_TYPE_F_CAM_BACKGROUND+1, 1); + error = cmp_ent_read_header(ent, &cfg); + TEST_ASSERT_TRUE(error); + /* this should work */ + cmp_ent_set_data_type(ent, DATA_TYPE_IMAGETTE, 1); + error = cmp_ent_read_header(ent, &cfg); + TEST_ASSERT_FALSE(error); + + /* cmp_mode CMP_MODE_RAW and no raw data bit */ + cmp_ent_set_data_type(ent, DATA_TYPE_IMAGETTE, 0); + error = cmp_ent_read_header(ent, &cfg); + TEST_ASSERT_TRUE(error); + /* this should work */ + cmp_ent_set_data_type(ent, DATA_TYPE_IMAGETTE, 1); + error = cmp_ent_read_header(ent, &cfg); + TEST_ASSERT_FALSE(error); + + /* original_size and data product type not compatible */ + cmp_ent_set_original_size(ent, 11); + error = cmp_ent_read_header(ent, &cfg); + TEST_ASSERT_TRUE(error); + /* this should work */ + cmp_ent_set_original_size(ent, 12); + error = cmp_ent_read_header(ent, &cfg); + TEST_ASSERT_FALSE(error); + + free(ent); +} + + +/** + * @test cmp_ent_create_timestamp + */ + +void test_cmp_ent_create_timestamp(void) +{ +#ifdef HAS_TIME_H + uint64_t timestamp, timestamp1, timestamp2; + struct timespec ts; + const time_t EPOCH = 1577836800; + + ts.tv_sec = EPOCH; + ts.tv_nsec = 0; + timestamp1 = cmp_ent_create_timestamp(&ts); + ts.tv_sec = EPOCH + 1; + ts.tv_nsec = 15258; + timestamp2 = cmp_ent_create_timestamp(&ts); + TEST_ASSERT_EQUAL_HEX(0x10001, timestamp2-timestamp1); + + /* create a current time */ + timestamp = cmp_ent_create_timestamp(NULL); + TEST_ASSERT_NOT_EQUAL_INT(0, timestamp); + +#if !defined(_WIN32) && !defined(_WIN64) + /* test my_timegm function */ + setenv("TZ", "/etc/localtime", 0); + timestamp = cmp_ent_create_timestamp(NULL); + TEST_ASSERT_NOT_EQUAL_INT(0, timestamp); + TEST_ASSERT_EQUAL_STRING("/etc/localtime", getenv("TZ")); + unsetenv("TZ"); +#endif + + /* error cases */ + /* ts before epoch */ + ts.tv_sec = 0; + ts.tv_nsec = 0; + timestamp = cmp_ent_create_timestamp(&ts); + TEST_ASSERT_EQUAL(0, timestamp); +#endif +} + + +/** + * @test cmp_ent_print + */ + +void test_cmp_ent_print(void) +{ + size_t size; + struct cmp_entity *ent; + uint32_t version_id; + uint64_t start_time, end_time; + uint16_t model_id; + uint8_t model_counter; + struct cmp_cfg cfg; + int cmp_size_bits; + struct cmp_max_used_bits max_used_bits = {0}; + + /* set up max used bit version */ + max_used_bits.version = 42; + cmp_set_max_used_bits(&max_used_bits); + + version_id = 42; + start_time = 100; + end_time = 200; + model_id = 12; + model_counter = 23; + cfg.data_type = DATA_TYPE_F_CAM_IMAGETTE_ADAPTIVE; + cfg.cmp_mode = CMP_MODE_MODEL_MULTI; + cfg.model_value = 11; + cfg.round = 2; + cfg.samples = 9; + cfg.spill = MIN_IMA_SPILL; + cfg.golomb_par = MAX_IMA_GOLOMB_PAR; + cfg.ap1_spill = 555; + cfg.ap1_golomb_par = 14; + cfg.ap2_spill = 333; + cfg.ap2_golomb_par = 43; + cmp_size_bits = 60*8; + + size = cmp_ent_build(NULL, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(IMAGETTE_ADAPTIVE_HEADER_SIZE+60, size); + ent = calloc(1, size); TEST_ASSERT_NOT_NULL(ent); + size = cmp_ent_build(ent, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(IMAGETTE_ADAPTIVE_HEADER_SIZE+60, size); + + cmp_ent_print(ent); + + /* error case */ + cmp_ent_print(NULL); + + free(ent); +} + + +/** + * @test cmp_ent_parse + */ + +void test_cmp_ent_parse(void) +{ + size_t size; + struct cmp_entity *ent; + uint32_t version_id; + uint64_t start_time, end_time; + uint16_t model_id; + uint8_t model_counter; + struct cmp_cfg cfg = {0}; + int cmp_size_bits; + struct cmp_max_used_bits max_used_bits = {0}; + + /* set up max used bit version */ + max_used_bits.version = 42; + cmp_set_max_used_bits(&max_used_bits); + + version_id = 42; + start_time = 100; + end_time = 200; + model_id = 12; + model_counter = 23; + cfg.data_type = DATA_TYPE_F_CAM_IMAGETTE_ADAPTIVE; + cfg.cmp_mode = CMP_MODE_MODEL_MULTI; + cfg.model_value = 11; + cfg.round = 2; + cfg.samples = 9; + cfg.spill = MIN_IMA_SPILL; + cfg.golomb_par = MAX_IMA_GOLOMB_PAR; + cfg.ap1_spill = 555; + cfg.ap1_golomb_par = 14; + cfg.ap2_spill = 333; + cfg.ap2_golomb_par = 43; + cmp_size_bits = 60*8; + + size = cmp_ent_build(NULL, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(IMAGETTE_ADAPTIVE_HEADER_SIZE+60, size); + ent = calloc(1, size); TEST_ASSERT_NOT_NULL(ent); + size = cmp_ent_build(ent, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(IMAGETTE_ADAPTIVE_HEADER_SIZE+60, size); + + cmp_ent_parse(ent); + + free(ent); + + + cfg.data_type = DATA_TYPE_IMAGETTE; + size = cmp_ent_build(NULL, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(IMAGETTE_HEADER_SIZE+60, size); + ent = calloc(1, size); TEST_ASSERT_NOT_NULL(ent); + size = cmp_ent_build(ent, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(IMAGETTE_HEADER_SIZE+60, size); + + cmp_ent_parse(ent); + + free(ent); + + cfg.data_type = DATA_TYPE_IMAGETTE; + cfg.cmp_mode = CMP_MODE_RAW; + version_id = 0x800F0003; + size = cmp_ent_build(NULL, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(GENERIC_HEADER_SIZE+60, size); + ent = calloc(1, size); TEST_ASSERT_NOT_NULL(ent); + size = cmp_ent_build(ent, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(GENERIC_HEADER_SIZE+60, size); + + cmp_ent_parse(ent); + + free(ent); + + cfg.data_type = DATA_TYPE_S_FX; + cfg.cmp_mode = CMP_MODE_MODEL_ZERO; + version_id = 0x800F0003; + size = cmp_ent_build(NULL, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(NON_IMAGETTE_HEADER_SIZE+60, size); + ent = calloc(1, size); TEST_ASSERT_NOT_NULL(ent); + size = cmp_ent_build(ent, version_id, start_time, end_time, model_id, + model_counter, &cfg, cmp_size_bits); + TEST_ASSERT_EQUAL_UINT(NON_IMAGETTE_HEADER_SIZE+60, size); + + cmp_ent_parse(ent); + + free(ent); +} diff --git a/test/cmp_icu/meson.build b/test/cmp_icu/meson.build index 7c9b356ed371262c44ba3ef897861ee4c7d25cd2..9c06d726172c0e6e65e9b0b52cc70608a11a86cc 100644 --- a/test/cmp_icu/meson.build +++ b/test/cmp_icu/meson.build @@ -12,20 +12,6 @@ test_cmp_icu = executable('test_cmp_icu', test('cmp_icu Unit Tests', test_cmp_icu) -test_case = files('test_cmp_decmp.c') -test_runner = test_runner_generator.process(test_case) - -test_cmp_decmp = executable('test_cmp_decmp', - test_case, test_runner, - include_directories : incdir, - link_with : cmp_lib, - dependencies : unity_dep, - build_by_default : false -) - -test('Compression Decompression Unit Tests', test_cmp_decmp) - - test_case = files('test_decmp.c') test_runner = test_runner_generator.process(test_case) diff --git a/test/cmp_icu/test_cmp_icu.c b/test/cmp_icu/test_cmp_icu.c index 65ab54581940e79ad902c1c272bd76c51604ab30..a78041f6085e8546fa899f37514fa7610cf33184 100644 --- a/test/cmp_icu/test_cmp_icu.c +++ b/test/cmp_icu/test_cmp_icu.c @@ -1,3 +1,22 @@ +/** + * @file test_cmp_icu.c + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) + * @date 2022 + * + * @copyright GPLv2 + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * @brief software compression tests + */ + + #include <stdlib.h> #if defined __has_include @@ -412,6 +431,27 @@ void test_cmp_cfg_icu_buffers(void) TEST_ASSERT_EQUAL(cmp_data, cfg.icu_output_buf); TEST_ASSERT_EQUAL_INT(4, cfg.buffer_length); + /* error case: compressed data buffer bigger than max compression entity + * data size */ + cfg = cmp_cfg_icu_create(DATA_TYPE_IMAGETTE, CMP_MODE_DIFF_ZERO, 16, CMP_LOSSLESS); + s = cmp_cfg_icu_buffers(&cfg, data_to_compress, data_samples, + model_of_data, updated_model, compressed_data, + 0x7FFFED+1); + TEST_ASSERT_EQUAL_size_t(0, s); + + cfg = cmp_cfg_icu_create(DATA_TYPE_IMAGETTE, CMP_MODE_DIFF_ZERO, 16, CMP_LOSSLESS); + s = cmp_cfg_icu_buffers(&cfg, data_to_compress, data_samples, + model_of_data, updated_model, compressed_data, + 0x7FFFFFFF); + TEST_ASSERT_EQUAL_size_t(0, s); + + /* this should also now work */ + cfg = cmp_cfg_icu_create(DATA_TYPE_IMAGETTE, CMP_MODE_DIFF_ZERO, 16, CMP_LOSSLESS); + s = cmp_cfg_icu_buffers(&cfg, data_to_compress, data_samples, + model_of_data, updated_model, compressed_data, + 0x7FFFED); + TEST_ASSERT_EQUAL_size_t(0xFFFFDA, s); + /* error case: cfg = NULL */ s = cmp_cfg_icu_buffers(NULL, data_to_compress, data_samples, model_of_data, updated_model, compressed_data, @@ -505,7 +545,7 @@ void test_cmp_cfg_icu_imagette(void) /* spillover_par to small */ cfg = cmp_cfg_icu_create(DATA_TYPE_IMAGETTE, CMP_MODE_DIFF_ZERO, 0, CMP_LOSSLESS); cmp_par = MAX_IMA_GOLOMB_PAR; - spillover_par = MIN_IMA_SPILL -1 ; + spillover_par = MIN_IMA_SPILL-1; error = cmp_cfg_icu_imagette(&cfg, cmp_par, spillover_par); TEST_ASSERT_TRUE(error); /* ignore in RAW MODE */ @@ -514,24 +554,24 @@ void test_cmp_cfg_icu_imagette(void) TEST_ASSERT_FALSE(error); /* CMP_MODE_STUFF tests */ - spillover_par = ~0; /* is ignored */ + spillover_par = ~0U; /* is ignored */ /* highest values STUFF MODE */ - cfg = cmp_cfg_icu_create(DATA_TYPE_IMAGETTE, CMP_MODE_STUFF, ~0, CMP_LOSSLESS); + cfg = cmp_cfg_icu_create(DATA_TYPE_IMAGETTE, CMP_MODE_STUFF, ~0U, CMP_LOSSLESS); cmp_par = MAX_STUFF_CMP_PAR; error = cmp_cfg_icu_imagette(&cfg, cmp_par, spillover_par); TEST_ASSERT_FALSE(error); TEST_ASSERT_EQUAL_INT(cfg.golomb_par, 32); /* lowest values STUFF MODE */ - cfg = cmp_cfg_icu_create(DATA_TYPE_IMAGETTE, CMP_MODE_STUFF, ~0, CMP_LOSSLESS); + cfg = cmp_cfg_icu_create(DATA_TYPE_IMAGETTE, CMP_MODE_STUFF, ~0U, CMP_LOSSLESS); cmp_par = 0; error = cmp_cfg_icu_imagette(&cfg, cmp_par, spillover_par); TEST_ASSERT_FALSE(error); TEST_ASSERT_EQUAL_INT(cfg.golomb_par, 0); /* cmp_par to big */ - cfg = cmp_cfg_icu_create(DATA_TYPE_SAT_IMAGETTE, CMP_MODE_STUFF, ~0, CMP_LOSSLESS); + cfg = cmp_cfg_icu_create(DATA_TYPE_SAT_IMAGETTE, CMP_MODE_STUFF, ~0U, CMP_LOSSLESS); cmp_par = MAX_STUFF_CMP_PAR+1; error = cmp_cfg_icu_imagette(&cfg, cmp_par, spillover_par); TEST_ASSERT_TRUE(error); @@ -541,7 +581,7 @@ void test_cmp_cfg_icu_imagette(void) TEST_ASSERT_TRUE(error); /* invalid compression mode test*/ - cfg = cmp_cfg_icu_create(DATA_TYPE_SAT_IMAGETTE, CMP_MODE_STUFF+1, ~0, CMP_LOSSLESS); + cfg = cmp_cfg_icu_create(DATA_TYPE_SAT_IMAGETTE, CMP_MODE_STUFF+1, ~0U, CMP_LOSSLESS); cmp_par = MAX_STUFF_CMP_PAR+1; error = cmp_cfg_icu_imagette(&cfg, cmp_par, spillover_par); TEST_ASSERT_TRUE(error); @@ -618,18 +658,18 @@ void test_cmp_cfg_fx_cob(void) /* test DATA_TYPE_S_FX */ cfg = cmp_cfg_icu_create(DATA_TYPE_S_FX, CMP_MODE_MODEL_ZERO, 16, CMP_LOSSLESS); - cmp_par_exp_flags = MAX_ICU_GOLOMB_PAR; + cmp_par_exp_flags = MAX_NON_IMA_GOLOMB_PAR; spillover_exp_flags = cmp_icu_max_spill(cmp_par_exp_flags); - cmp_par_fx = MIN_ICU_GOLOMB_PAR; - spillover_fx = MIN_ICU_SPILL; - cmp_par_ncob = ~0; /* invalid parameter */ - spillover_ncob = ~0; /* invalid parameter */ - cmp_par_efx = ~0; /* invalid parameter */ - spillover_efx = ~0; /* invalid parameter */ - cmp_par_ecob = ~0; /* invalid parameter */ - spillover_ecob = ~0; /* invalid parameter */ - cmp_par_fx_cob_variance = ~0; /* invalid parameter */ - spillover_fx_cob_variance = ~0; /* invalid parameter */ + cmp_par_fx = MIN_NON_IMA_GOLOMB_PAR; + spillover_fx = MIN_NON_IMA_SPILL; + cmp_par_ncob = ~0U; /* invalid parameter */ + spillover_ncob = ~0U; /* invalid parameter */ + cmp_par_efx = ~0U; /* invalid parameter */ + spillover_efx = ~0U; /* invalid parameter */ + cmp_par_ecob = ~0U; /* invalid parameter */ + spillover_ecob = ~0U; /* invalid parameter */ + cmp_par_fx_cob_variance = ~0U; /* invalid parameter */ + spillover_fx_cob_variance = ~0U; /* invalid parameter */ error = cmp_cfg_fx_cob(&cfg, cmp_par_exp_flags, spillover_exp_flags, cmp_par_fx, spillover_fx, cmp_par_ncob, spillover_ncob, @@ -642,7 +682,7 @@ void test_cmp_cfg_fx_cob(void) TEST_ASSERT_EQUAL_INT(spillover_exp_flags, cfg.spill_exp_flags); /* invalid spillover_exp_flags parameter */ - cmp_par_exp_flags = MAX_ICU_GOLOMB_PAR; + cmp_par_exp_flags = MAX_NON_IMA_GOLOMB_PAR; spillover_exp_flags = cmp_icu_max_spill(cmp_par_exp_flags)+1; error = cmp_cfg_fx_cob(&cfg, cmp_par_exp_flags, spillover_exp_flags, cmp_par_fx, spillover_fx, cmp_par_ncob, spillover_ncob, @@ -651,10 +691,10 @@ void test_cmp_cfg_fx_cob(void) TEST_ASSERT_TRUE(error); /* invalid cmp_par_fx parameter */ - cmp_par_exp_flags = MAX_ICU_GOLOMB_PAR; + cmp_par_exp_flags = MAX_NON_IMA_GOLOMB_PAR; spillover_exp_flags = cmp_icu_max_spill(cmp_par_exp_flags); - cmp_par_fx = MIN_ICU_GOLOMB_PAR - 1; - spillover_fx = MIN_ICU_SPILL; + cmp_par_fx = MIN_NON_IMA_GOLOMB_PAR - 1; + spillover_fx = MIN_NON_IMA_SPILL; error = cmp_cfg_fx_cob(&cfg, cmp_par_exp_flags, spillover_exp_flags, cmp_par_fx, spillover_fx, cmp_par_ncob, spillover_ncob, cmp_par_efx, spillover_efx, cmp_par_ecob, spillover_ecob, @@ -664,18 +704,18 @@ void test_cmp_cfg_fx_cob(void) /* test DATA_TYPE_S_FX_EFX */ cfg = cmp_cfg_icu_create(DATA_TYPE_S_FX_EFX, CMP_MODE_MODEL_ZERO, 0, 1); - cmp_par_exp_flags = MAX_ICU_GOLOMB_PAR; + cmp_par_exp_flags = MAX_NON_IMA_GOLOMB_PAR; spillover_exp_flags = cmp_icu_max_spill(cmp_par_exp_flags); - cmp_par_fx = MIN_ICU_GOLOMB_PAR; - spillover_fx = MIN_ICU_SPILL; - cmp_par_ncob = ~0; /* invalid parameter */ - spillover_ncob = ~0; /* invalid parameter */ + cmp_par_fx = MIN_NON_IMA_GOLOMB_PAR; + spillover_fx = MIN_NON_IMA_SPILL; + cmp_par_ncob = ~0U; /* invalid parameter */ + spillover_ncob = ~0U; /* invalid parameter */ cmp_par_efx = 23; spillover_efx = 42; - cmp_par_ecob = ~0; /* invalid parameter */ - spillover_ecob = ~0; /* invalid parameter */ - cmp_par_fx_cob_variance = ~0; /* invalid parameter */ - spillover_fx_cob_variance = ~0; /* invalid parameter */ + cmp_par_ecob = ~0U; /* invalid parameter */ + spillover_ecob = ~0U; /* invalid parameter */ + cmp_par_fx_cob_variance = ~0U; /* invalid parameter */ + spillover_fx_cob_variance = ~0U; /* invalid parameter */ error = cmp_cfg_fx_cob(&cfg, cmp_par_exp_flags, spillover_exp_flags, cmp_par_fx, spillover_fx, cmp_par_ncob, spillover_ncob, cmp_par_efx, spillover_efx, cmp_par_ecob, spillover_ecob, @@ -699,18 +739,18 @@ void test_cmp_cfg_fx_cob(void) /* test DATA_TYPE_S_FX_NCOB */ cfg = cmp_cfg_icu_create(DATA_TYPE_S_FX_NCOB, CMP_MODE_MODEL_ZERO, 0, 1); - cmp_par_exp_flags = MAX_ICU_GOLOMB_PAR; + cmp_par_exp_flags = MAX_NON_IMA_GOLOMB_PAR; spillover_exp_flags = cmp_icu_max_spill(cmp_par_exp_flags); - cmp_par_fx = MIN_ICU_GOLOMB_PAR; - spillover_fx = MIN_ICU_SPILL; + cmp_par_fx = MIN_NON_IMA_GOLOMB_PAR; + spillover_fx = MIN_NON_IMA_SPILL; cmp_par_ncob = 19; spillover_ncob = 5; - cmp_par_efx = ~0; /* invalid parameter */ - spillover_efx = ~0; /* invalid parameter */ - cmp_par_ecob = ~0; /* invalid parameter */ - spillover_ecob = ~0; /* invalid parameter */ - cmp_par_fx_cob_variance = ~0; /* invalid parameter */ - spillover_fx_cob_variance = ~0; /* invalid parameter */ + cmp_par_efx = ~0U; /* invalid parameter */ + spillover_efx = ~0U; /* invalid parameter */ + cmp_par_ecob = ~0U; /* invalid parameter */ + spillover_ecob = ~0U; /* invalid parameter */ + cmp_par_fx_cob_variance = ~0U; /* invalid parameter */ + spillover_fx_cob_variance = ~0U; /* invalid parameter */ error = cmp_cfg_fx_cob(&cfg, cmp_par_exp_flags, spillover_exp_flags, cmp_par_fx, spillover_fx, cmp_par_ncob, spillover_ncob, cmp_par_efx, spillover_efx, cmp_par_ecob, spillover_ecob, @@ -734,18 +774,18 @@ void test_cmp_cfg_fx_cob(void) /* test DATA_TYPE_S_FX_EFX_NCOB_ECOB */ cfg = cmp_cfg_icu_create(DATA_TYPE_S_FX_EFX_NCOB_ECOB, CMP_MODE_DIFF_ZERO, 7, CMP_LOSSLESS); - cmp_par_exp_flags = MAX_ICU_GOLOMB_PAR; + cmp_par_exp_flags = MAX_NON_IMA_GOLOMB_PAR; spillover_exp_flags = cmp_icu_max_spill(cmp_par_exp_flags); - cmp_par_fx = MIN_ICU_GOLOMB_PAR; - spillover_fx = MIN_ICU_SPILL; + cmp_par_fx = MIN_NON_IMA_GOLOMB_PAR; + spillover_fx = MIN_NON_IMA_SPILL; cmp_par_ncob = 19; spillover_ncob = 5; cmp_par_efx = 23; spillover_efx = 42; - cmp_par_ecob = MAX_ICU_GOLOMB_PAR; - spillover_ecob = MIN_ICU_SPILL; - cmp_par_fx_cob_variance = ~0; /* invalid parameter */ - spillover_fx_cob_variance = ~0; /* invalid parameter */ + cmp_par_ecob = MAX_NON_IMA_GOLOMB_PAR; + spillover_ecob = MIN_NON_IMA_SPILL; + cmp_par_fx_cob_variance = ~0U; /* invalid parameter */ + spillover_fx_cob_variance = ~0U; /* invalid parameter */ error = cmp_cfg_fx_cob(&cfg, cmp_par_exp_flags, spillover_exp_flags, cmp_par_fx, spillover_fx, cmp_par_ncob, spillover_ncob, cmp_par_efx, spillover_efx, cmp_par_ecob, spillover_ecob, @@ -773,16 +813,16 @@ void test_cmp_cfg_fx_cob(void) /* DATA_TYPE_L_FX */ cfg = cmp_cfg_icu_create(DATA_TYPE_L_FX, CMP_MODE_DIFF_ZERO, 7, CMP_LOSSLESS); - cmp_par_exp_flags = MAX_ICU_GOLOMB_PAR; + cmp_par_exp_flags = MAX_NON_IMA_GOLOMB_PAR; spillover_exp_flags = cmp_icu_max_spill(cmp_par_exp_flags); - cmp_par_fx = MIN_ICU_GOLOMB_PAR; - spillover_fx = MIN_ICU_SPILL; - cmp_par_ncob = ~0; /* invalid parameter */ - spillover_ncob = ~0; /* invalid parameter */ - cmp_par_efx = ~0; /* invalid parameter */ - spillover_efx = ~0; /* invalid parameter */ - cmp_par_ecob = ~0; /* invalid parameter */ - spillover_ecob = ~0; /* invalid parameter */ + cmp_par_fx = MIN_NON_IMA_GOLOMB_PAR; + spillover_fx = MIN_NON_IMA_SPILL; + cmp_par_ncob = ~0U; /* invalid parameter */ + spillover_ncob = ~0U; /* invalid parameter */ + cmp_par_efx = ~0U; /* invalid parameter */ + spillover_efx = ~0U; /* invalid parameter */ + cmp_par_ecob = ~0U; /* invalid parameter */ + spillover_ecob = ~0U; /* invalid parameter */ cmp_par_fx_cob_variance = 30; spillover_fx_cob_variance = 8; @@ -809,16 +849,16 @@ void test_cmp_cfg_fx_cob(void) /* DATA_TYPE_L_FX_EFX */ cfg = cmp_cfg_icu_create(DATA_TYPE_L_FX_EFX, CMP_MODE_DIFF_ZERO, 7, CMP_LOSSLESS); - cmp_par_exp_flags = MAX_ICU_GOLOMB_PAR; + cmp_par_exp_flags = MAX_NON_IMA_GOLOMB_PAR; spillover_exp_flags = cmp_icu_max_spill(cmp_par_exp_flags); - cmp_par_fx = MIN_ICU_GOLOMB_PAR; - spillover_fx = MIN_ICU_SPILL; - cmp_par_ncob = ~0; /* invalid parameter */ - spillover_ncob = ~0; /* invalid parameter */ + cmp_par_fx = MIN_NON_IMA_GOLOMB_PAR; + spillover_fx = MIN_NON_IMA_SPILL; + cmp_par_ncob = ~0U; /* invalid parameter */ + spillover_ncob = ~0U; /* invalid parameter */ cmp_par_efx = 23; spillover_efx = 42; - cmp_par_ecob = ~0; /* invalid parameter */ - spillover_ecob = ~0; /* invalid parameter */ + cmp_par_ecob = ~0U; /* invalid parameter */ + spillover_ecob = ~0U; /* invalid parameter */ cmp_par_fx_cob_variance = 30; spillover_fx_cob_variance = 8; @@ -839,16 +879,16 @@ void test_cmp_cfg_fx_cob(void) /* DATA_TYPE_L_FX_NCOB */ cfg = cmp_cfg_icu_create(DATA_TYPE_L_FX_NCOB, CMP_MODE_DIFF_ZERO, 7, CMP_LOSSLESS); - cmp_par_exp_flags = MAX_ICU_GOLOMB_PAR; + cmp_par_exp_flags = MAX_NON_IMA_GOLOMB_PAR; spillover_exp_flags = cmp_icu_max_spill(cmp_par_exp_flags); - cmp_par_fx = MIN_ICU_GOLOMB_PAR; - spillover_fx = MIN_ICU_SPILL; + cmp_par_fx = MIN_NON_IMA_GOLOMB_PAR; + spillover_fx = MIN_NON_IMA_SPILL; cmp_par_ncob = 19; spillover_ncob = 5; - cmp_par_efx = ~0; /* invalid parameter */ - spillover_efx = ~0; /* invalid parameter */ - cmp_par_ecob = ~0; /* invalid parameter */ - spillover_ecob = ~0; /* invalid parameter */ + cmp_par_efx = ~0U; /* invalid parameter */ + spillover_efx = ~0U; /* invalid parameter */ + cmp_par_ecob = ~0U; /* invalid parameter */ + spillover_ecob = ~0U; /* invalid parameter */ cmp_par_fx_cob_variance = 30; spillover_fx_cob_variance = 8; @@ -869,16 +909,16 @@ void test_cmp_cfg_fx_cob(void) /* DATA_TYPE_L_FX_EFX_NCOB_ECOB */ cfg = cmp_cfg_icu_create(DATA_TYPE_L_FX_EFX_NCOB_ECOB, CMP_MODE_DIFF_ZERO, 7, CMP_LOSSLESS); - cmp_par_exp_flags = MAX_ICU_GOLOMB_PAR; + cmp_par_exp_flags = MAX_NON_IMA_GOLOMB_PAR; spillover_exp_flags = cmp_icu_max_spill(cmp_par_exp_flags); - cmp_par_fx = MIN_ICU_GOLOMB_PAR; - spillover_fx = MIN_ICU_SPILL; + cmp_par_fx = MIN_NON_IMA_GOLOMB_PAR; + spillover_fx = MIN_NON_IMA_SPILL; cmp_par_ncob = 19; spillover_ncob = 5; cmp_par_efx = 23; spillover_efx = 42; - cmp_par_ecob = MAX_ICU_GOLOMB_PAR; - spillover_ecob = MIN_ICU_SPILL; + cmp_par_ecob = MAX_NON_IMA_GOLOMB_PAR; + spillover_ecob = MIN_NON_IMA_SPILL; cmp_par_fx_cob_variance = 30; spillover_fx_cob_variance = 8; @@ -903,18 +943,18 @@ void test_cmp_cfg_fx_cob(void) /* DATA_TYPE_F_FX */ cfg = cmp_cfg_icu_create(DATA_TYPE_F_FX, CMP_MODE_DIFF_ZERO, 7, CMP_LOSSLESS); - cmp_par_exp_flags = ~0; /* invalid parameter */ - spillover_exp_flags = ~0; /* invalid parameter */ - cmp_par_fx = MIN_ICU_GOLOMB_PAR; - spillover_fx = MIN_ICU_SPILL; - cmp_par_ncob = ~0; /* invalid parameter */ - spillover_ncob = ~0; /* invalid parameter */ - cmp_par_efx = ~0; /* invalid parameter */ - spillover_efx = ~0; /* invalid parameter */ - cmp_par_ecob = ~0; /* invalid parameter */ - spillover_ecob = ~0; /* invalid parameter */ - cmp_par_fx_cob_variance = ~0; /* invalid parameter */ - spillover_fx_cob_variance = ~0; /* invalid parameter */ + cmp_par_exp_flags = ~0U; /* invalid parameter */ + spillover_exp_flags = ~0U; /* invalid parameter */ + cmp_par_fx = MIN_NON_IMA_GOLOMB_PAR; + spillover_fx = MIN_NON_IMA_SPILL; + cmp_par_ncob = ~0U; /* invalid parameter */ + spillover_ncob = ~0U; /* invalid parameter */ + cmp_par_efx = ~0U; /* invalid parameter */ + spillover_efx = ~0U; /* invalid parameter */ + cmp_par_ecob = ~0U; /* invalid parameter */ + spillover_ecob = ~0U; /* invalid parameter */ + cmp_par_fx_cob_variance = ~0U; /* invalid parameter */ + spillover_fx_cob_variance = ~0U; /* invalid parameter */ error = cmp_cfg_fx_cob(&cfg, cmp_par_exp_flags, spillover_exp_flags, cmp_par_fx, spillover_fx, cmp_par_ncob, spillover_ncob, @@ -927,18 +967,18 @@ void test_cmp_cfg_fx_cob(void) /* DATA_TYPE_F_FX_EFX */ cfg = cmp_cfg_icu_create(DATA_TYPE_F_FX_EFX, CMP_MODE_DIFF_ZERO, 7, CMP_LOSSLESS); - cmp_par_exp_flags = ~0; /* invalid parameter */ - spillover_exp_flags = ~0; /* invalid parameter */ - cmp_par_fx = MIN_ICU_GOLOMB_PAR; - spillover_fx = MIN_ICU_SPILL; - cmp_par_ncob = ~0; /* invalid parameter */ - spillover_ncob = ~0; /* invalid parameter */ + cmp_par_exp_flags = ~0U; /* invalid parameter */ + spillover_exp_flags = ~0U; /* invalid parameter */ + cmp_par_fx = MIN_NON_IMA_GOLOMB_PAR; + spillover_fx = MIN_NON_IMA_SPILL; + cmp_par_ncob = ~0U; /* invalid parameter */ + spillover_ncob = ~0U; /* invalid parameter */ cmp_par_efx = 23; spillover_efx = 42; - cmp_par_ecob = ~0; /* invalid parameter */ - spillover_ecob = ~0; /* invalid parameter */ - cmp_par_fx_cob_variance = ~0; /* invalid parameter */ - spillover_fx_cob_variance = ~0; /* invalid parameter */ + cmp_par_ecob = ~0U; /* invalid parameter */ + spillover_ecob = ~0U; /* invalid parameter */ + cmp_par_fx_cob_variance = ~0U; /* invalid parameter */ + spillover_fx_cob_variance = ~0U; /* invalid parameter */ error = cmp_cfg_fx_cob(&cfg, cmp_par_exp_flags, spillover_exp_flags, cmp_par_fx, spillover_fx, cmp_par_ncob, spillover_ncob, @@ -953,18 +993,18 @@ void test_cmp_cfg_fx_cob(void) /* DATA_TYPE_F_FX_NCOB */ cfg = cmp_cfg_icu_create(DATA_TYPE_F_FX_NCOB, CMP_MODE_DIFF_ZERO, 7, CMP_LOSSLESS); - cmp_par_exp_flags = ~0; /* invalid parameter */ - spillover_exp_flags = ~0; /* invalid parameter */ - cmp_par_fx = MIN_ICU_GOLOMB_PAR; - spillover_fx = MIN_ICU_SPILL; - cmp_par_ncob = MIN_ICU_GOLOMB_PAR; + cmp_par_exp_flags = ~0U; /* invalid parameter */ + spillover_exp_flags = ~0U; /* invalid parameter */ + cmp_par_fx = MIN_NON_IMA_GOLOMB_PAR; + spillover_fx = MIN_NON_IMA_SPILL; + cmp_par_ncob = MIN_NON_IMA_GOLOMB_PAR; spillover_ncob = cmp_icu_max_spill(cmp_par_ncob); - cmp_par_efx = ~0; /* invalid parameter */ - spillover_efx = ~0; /* invalid parameter */ - cmp_par_ecob = ~0; /* invalid parameter */ - spillover_ecob = ~0; /* invalid parameter */ - cmp_par_fx_cob_variance = ~0; /* invalid parameter */ - spillover_fx_cob_variance = ~0; /* invalid parameter */ + cmp_par_efx = ~0U; /* invalid parameter */ + spillover_efx = ~0U; /* invalid parameter */ + cmp_par_ecob = ~0U; /* invalid parameter */ + spillover_ecob = ~0U; /* invalid parameter */ + cmp_par_fx_cob_variance = ~0U; /* invalid parameter */ + spillover_fx_cob_variance = ~0U; /* invalid parameter */ error = cmp_cfg_fx_cob(&cfg, cmp_par_exp_flags, spillover_exp_flags, cmp_par_fx, spillover_fx, cmp_par_ncob, spillover_ncob, @@ -979,18 +1019,18 @@ void test_cmp_cfg_fx_cob(void) /* DATA_TYPE_F_FX_EFX_NCOB_ECOB */ cfg = cmp_cfg_icu_create(DATA_TYPE_F_FX_EFX_NCOB_ECOB, CMP_MODE_DIFF_ZERO, 7, CMP_LOSSLESS); - cmp_par_exp_flags = ~0; /* invalid parameter */ - spillover_exp_flags = ~0; /* invalid parameter */ - cmp_par_fx = MIN_ICU_GOLOMB_PAR; - spillover_fx = MIN_ICU_SPILL; - cmp_par_ncob = MIN_ICU_GOLOMB_PAR; + cmp_par_exp_flags = ~0U; /* invalid parameter */ + spillover_exp_flags = ~0U; /* invalid parameter */ + cmp_par_fx = MIN_NON_IMA_GOLOMB_PAR; + spillover_fx = MIN_NON_IMA_SPILL; + cmp_par_ncob = MIN_NON_IMA_GOLOMB_PAR; spillover_ncob = cmp_icu_max_spill(cmp_par_ncob); cmp_par_efx = 23; spillover_efx = 42; - cmp_par_ecob = MAX_ICU_GOLOMB_PAR; - spillover_ecob = MIN_ICU_SPILL; - cmp_par_fx_cob_variance = ~0; /* invalid parameter */ - spillover_fx_cob_variance = ~0; /* invalid parameter */ + cmp_par_ecob = MAX_NON_IMA_GOLOMB_PAR; + spillover_ecob = MIN_NON_IMA_SPILL; + cmp_par_fx_cob_variance = ~0U; /* invalid parameter */ + spillover_fx_cob_variance = ~0U; /* invalid parameter */ error = cmp_cfg_fx_cob(&cfg, cmp_par_exp_flags, spillover_exp_flags, cmp_par_fx, spillover_fx, cmp_par_ncob, spillover_ncob, @@ -1056,24 +1096,24 @@ void test_cmp_cfg_aux(void) /* DATA_TYPE_OFFSET */ cfg = cmp_cfg_icu_create(DATA_TYPE_OFFSET, CMP_MODE_DIFF_ZERO, 7, CMP_LOSSLESS); - cmp_par_mean = MIN_ICU_GOLOMB_PAR; - spillover_mean = cmp_icu_max_spill(MIN_ICU_GOLOMB_PAR); - cmp_par_variance = MIN_ICU_GOLOMB_PAR; - spillover_variance = MIN_ICU_SPILL; - cmp_par_pixels_error = ~0; - spillover_pixels_error = ~0; + cmp_par_mean = MIN_NON_IMA_GOLOMB_PAR; + spillover_mean = cmp_icu_max_spill(MIN_NON_IMA_GOLOMB_PAR); + cmp_par_variance = MIN_NON_IMA_GOLOMB_PAR; + spillover_variance = MIN_NON_IMA_SPILL; + cmp_par_pixels_error = ~0U; + spillover_pixels_error = ~0U; error = cmp_cfg_aux(&cfg, cmp_par_mean, spillover_mean, cmp_par_variance, spillover_variance, cmp_par_pixels_error, spillover_pixels_error); TEST_ASSERT_FALSE(error); - TEST_ASSERT_EQUAL_INT(MIN_ICU_GOLOMB_PAR, cfg.cmp_par_mean); - TEST_ASSERT_EQUAL_INT(cmp_icu_max_spill(MIN_ICU_GOLOMB_PAR), cfg.spill_mean); - TEST_ASSERT_EQUAL_INT(MIN_ICU_GOLOMB_PAR, cfg.cmp_par_variance); + TEST_ASSERT_EQUAL_INT(MIN_NON_IMA_GOLOMB_PAR, cfg.cmp_par_mean); + TEST_ASSERT_EQUAL_INT(cmp_icu_max_spill(MIN_NON_IMA_GOLOMB_PAR), cfg.spill_mean); + TEST_ASSERT_EQUAL_INT(MIN_NON_IMA_GOLOMB_PAR, cfg.cmp_par_variance); TEST_ASSERT_EQUAL_INT(2, cfg.spill_variance); /* This should fail */ - cmp_par_mean = MIN_ICU_GOLOMB_PAR-1; + cmp_par_mean = MIN_NON_IMA_GOLOMB_PAR-1; error = cmp_cfg_aux(&cfg, cmp_par_mean, spillover_mean, cmp_par_variance, spillover_variance, cmp_par_pixels_error, spillover_pixels_error); @@ -1082,10 +1122,10 @@ void test_cmp_cfg_aux(void) /* DATA_TYPE_BACKGROUND */ cfg = cmp_cfg_icu_create(DATA_TYPE_BACKGROUND, CMP_MODE_DIFF_ZERO, 7, CMP_LOSSLESS); - cmp_par_mean = MAX_ICU_GOLOMB_PAR; - spillover_mean = cmp_icu_max_spill(MAX_ICU_GOLOMB_PAR); - cmp_par_variance = MIN_ICU_GOLOMB_PAR; - spillover_variance = MIN_ICU_SPILL; + cmp_par_mean = MAX_NON_IMA_GOLOMB_PAR; + spillover_mean = cmp_icu_max_spill(MAX_NON_IMA_GOLOMB_PAR); + cmp_par_variance = MIN_NON_IMA_GOLOMB_PAR; + spillover_variance = MIN_NON_IMA_SPILL; cmp_par_pixels_error = 42; spillover_pixels_error = 23; @@ -1093,15 +1133,15 @@ void test_cmp_cfg_aux(void) cmp_par_variance, spillover_variance, cmp_par_pixels_error, spillover_pixels_error); TEST_ASSERT_FALSE(error); - TEST_ASSERT_EQUAL_INT(MAX_ICU_GOLOMB_PAR, cfg.cmp_par_mean); - TEST_ASSERT_EQUAL_INT(cmp_icu_max_spill(MAX_ICU_GOLOMB_PAR), cfg.spill_mean); - TEST_ASSERT_EQUAL_INT(MIN_ICU_GOLOMB_PAR, cfg.cmp_par_variance); - TEST_ASSERT_EQUAL_INT(MIN_ICU_SPILL, cfg.spill_variance); + TEST_ASSERT_EQUAL_INT(MAX_NON_IMA_GOLOMB_PAR, cfg.cmp_par_mean); + TEST_ASSERT_EQUAL_INT(cmp_icu_max_spill(MAX_NON_IMA_GOLOMB_PAR), cfg.spill_mean); + TEST_ASSERT_EQUAL_INT(MIN_NON_IMA_GOLOMB_PAR, cfg.cmp_par_variance); + TEST_ASSERT_EQUAL_INT(MIN_NON_IMA_SPILL, cfg.spill_variance); TEST_ASSERT_EQUAL_INT(42, cfg.cmp_par_pixels_error); TEST_ASSERT_EQUAL_INT(23, cfg.spill_pixels_error); /* This should fail */ - cmp_par_variance = MIN_ICU_GOLOMB_PAR-1; + cmp_par_variance = MIN_NON_IMA_GOLOMB_PAR-1; error = cmp_cfg_aux(&cfg, cmp_par_mean, spillover_mean, cmp_par_variance, spillover_variance, cmp_par_pixels_error, spillover_pixels_error); @@ -1110,10 +1150,10 @@ void test_cmp_cfg_aux(void) /* DATA_TYPE_SMEARING */ cfg = cmp_cfg_icu_create(DATA_TYPE_SMEARING, CMP_MODE_DIFF_ZERO, 7, CMP_LOSSLESS); - cmp_par_mean = MAX_ICU_GOLOMB_PAR; - spillover_mean = cmp_icu_max_spill(MAX_ICU_GOLOMB_PAR); - cmp_par_variance = MIN_ICU_GOLOMB_PAR; - spillover_variance = MIN_ICU_SPILL; + cmp_par_mean = MAX_NON_IMA_GOLOMB_PAR; + spillover_mean = cmp_icu_max_spill(MAX_NON_IMA_GOLOMB_PAR); + cmp_par_variance = MIN_NON_IMA_GOLOMB_PAR; + spillover_variance = MIN_NON_IMA_SPILL; cmp_par_pixels_error = 42; spillover_pixels_error = 23; @@ -1121,10 +1161,10 @@ void test_cmp_cfg_aux(void) cmp_par_variance, spillover_variance, cmp_par_pixels_error, spillover_pixels_error); TEST_ASSERT_FALSE(error); - TEST_ASSERT_EQUAL_INT(MAX_ICU_GOLOMB_PAR, cfg.cmp_par_mean); - TEST_ASSERT_EQUAL_INT(cmp_icu_max_spill(MAX_ICU_GOLOMB_PAR), cfg.spill_mean); - TEST_ASSERT_EQUAL_INT(MIN_ICU_GOLOMB_PAR, cfg.cmp_par_variance); - TEST_ASSERT_EQUAL_INT(MIN_ICU_SPILL, cfg.spill_variance); + TEST_ASSERT_EQUAL_INT(MAX_NON_IMA_GOLOMB_PAR, cfg.cmp_par_mean); + TEST_ASSERT_EQUAL_INT(cmp_icu_max_spill(MAX_NON_IMA_GOLOMB_PAR), cfg.spill_mean); + TEST_ASSERT_EQUAL_INT(MIN_NON_IMA_GOLOMB_PAR, cfg.cmp_par_variance); + TEST_ASSERT_EQUAL_INT(MIN_NON_IMA_SPILL, cfg.spill_variance); TEST_ASSERT_EQUAL_INT(42, cfg.cmp_par_pixels_error); TEST_ASSERT_EQUAL_INT(23, cfg.spill_pixels_error); @@ -1658,7 +1698,7 @@ void test_rice_encoder(void) const uint32_t MAX_GOLOMB_PAR = 0x80000000; /* test minimum Golomb parameter */ - value = 0; log2_g_par = (uint32_t)ilog_2(MIN_ICU_GOLOMB_PAR); g_par = 1U << log2_g_par; cw = ~0U; + value = 0; log2_g_par = (uint32_t)ilog_2(MIN_NON_IMA_GOLOMB_PAR); g_par = 1U << log2_g_par; cw = ~0U; cw_len = rice_encoder(value, g_par, log2_g_par, &cw); TEST_ASSERT_EQUAL_INT(1, cw_len); TEST_ASSERT_EQUAL_HEX(0x0, cw); @@ -1727,7 +1767,7 @@ void test_golomb_encoder(void) const uint32_t MAX_GOLOMB_PAR = 0x80000000; /* test minimum Golomb parameter */ - value = 0; g_par = MIN_ICU_GOLOMB_PAR; log2_g_par = (uint32_t)ilog_2(g_par); cw = ~0U; + value = 0; g_par = MIN_NON_IMA_GOLOMB_PAR; log2_g_par = (uint32_t)ilog_2(g_par); cw = ~0U; cw_len = golomb_encoder(value, g_par, log2_g_par, &cw); TEST_ASSERT_EQUAL_INT(1, cw_len); TEST_ASSERT_EQUAL_HEX(0x0, cw); @@ -2147,57 +2187,6 @@ void test_encode_value(void) } -/** - * @test cmp_get_max_used_bits - * TODO: move this test - */ - -void test_cmp_get_max_used_bits(void) -{ - struct cmp_max_used_bits max_used_bits = cmp_get_max_used_bits(); - - TEST_ASSERT_EQUAL_INT(max_used_bits.nc_imagette, MAX_USED_NC_IMAGETTE_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.saturated_imagette, MAX_USED_SATURATED_IMAGETTE_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.fc_imagette, MAX_USED_FC_IMAGETTE_BITS); - - TEST_ASSERT_EQUAL_INT(max_used_bits.f_fx, MAX_USED_F_FX_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.f_efx, MAX_USED_F_EFX_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.f_ncob, MAX_USED_F_NCOB_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.f_ecob, MAX_USED_F_ECOB_BITS); - - TEST_ASSERT_EQUAL_INT(max_used_bits.s_exp_flags, MAX_USED_S_FX_EXPOSURE_FLAGS_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.s_fx, MAX_USED_S_FX_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.s_efx, MAX_USED_S_EFX_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.s_ncob, MAX_USED_S_NCOB_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.s_ecob, MAX_USED_S_ECOB_BITS); - - TEST_ASSERT_EQUAL_INT(max_used_bits.l_fx_variance, MAX_USED_L_FX_VARIANCE_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.l_efx, MAX_USED_L_EFX_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.l_ncob, MAX_USED_L_NCOB_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.l_ecob, MAX_USED_L_ECOB_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.l_cob_variance, MAX_USED_L_COB_VARIANCE_BITS); - - TEST_ASSERT_EQUAL_INT(max_used_bits.nc_offset_mean, MAX_USED_NC_OFFSET_MEAN_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.nc_offset_variance, MAX_USED_NC_OFFSET_VARIANCE_BITS); - - TEST_ASSERT_EQUAL_INT(max_used_bits.nc_background_mean, MAX_USED_NC_BACKGROUND_MEAN_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.nc_background_variance, MAX_USED_NC_BACKGROUND_VARIANCE_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.nc_background_outlier_pixels, MAX_USED_NC_BACKGROUND_OUTLIER_PIXELS_BITS); - - TEST_ASSERT_EQUAL_INT(max_used_bits.smearing_mean, MAX_USED_SMEARING_MEAN_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.smearing_variance_mean, MAX_USED_SMEARING_VARIANCE_MEAN_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.smearing_outlier_pixels, MAX_USED_SMEARING_OUTLIER_PIXELS_BITS); - - TEST_ASSERT_EQUAL_INT(max_used_bits.fc_offset_mean, MAX_USED_FC_OFFSET_MEAN_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.fc_offset_variance, MAX_USED_FC_OFFSET_VARIANCE_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.fc_offset_pixel_in_error, MAX_USED_FC_OFFSET_PIXEL_IN_ERROR_BITS); - - TEST_ASSERT_EQUAL_INT(max_used_bits.fc_background_mean, MAX_USED_FC_BACKGROUND_MEAN_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.fc_background_variance, MAX_USED_FC_BACKGROUND_VARIANCE_BITS); - TEST_ASSERT_EQUAL_INT(max_used_bits.fc_background_outlier_pixels, MAX_USED_FC_BACKGROUND_OUTLIER_PIXELS_BITS); -} - - /** * @test configure_encoder_setup */ @@ -2221,7 +2210,7 @@ void test_configure_encoder_setup(void) cfg.cmp_mode = CMP_MODE_MODEL_ZERO; cfg.icu_output_buf = (void *)123; cfg.buffer_length = 2; - error = configure_encoder_setup(&setup, cmp_par, spillover,lossy_par, + error = configure_encoder_setup(&setup, cmp_par, spillover, lossy_par, max_data_bits, &cfg); TEST_ASSERT_FALSE(error); TEST_ASSERT_EQUAL(golomb_encoder, setup.generate_cw_f); /* pointer to the code word encoder */ @@ -2244,7 +2233,7 @@ void test_configure_encoder_setup(void) cfg.cmp_mode = CMP_MODE_DIFF_MULTI; cfg.icu_output_buf = (void *)123; cfg.buffer_length = 2; - error = configure_encoder_setup(&setup, cmp_par, spillover,lossy_par, + error = configure_encoder_setup(&setup, cmp_par, spillover, lossy_par, max_data_bits, &cfg); TEST_ASSERT_FALSE(error); TEST_ASSERT_EQUAL(rice_encoder, setup.generate_cw_f); /* pointer to the code word encoder */ @@ -2260,14 +2249,14 @@ void test_configure_encoder_setup(void) /* test CMP_MODE_STUFF */ cmp_par = 32; - spillover = ~0; + spillover = ~0U; lossy_par = 1; max_data_bits = 32; cfg.data_type = DATA_TYPE_IMAGETTE; cfg.cmp_mode = CMP_MODE_STUFF; cfg.icu_output_buf = (void *)123; cfg.buffer_length = 2; - error = configure_encoder_setup(&setup, cmp_par, spillover,lossy_par, + error = configure_encoder_setup(&setup, cmp_par, spillover, lossy_par, max_data_bits, &cfg); TEST_ASSERT_FALSE(error); TEST_ASSERT_EQUAL(NULL, setup.generate_cw_f); /* pointer to the code word encoder */ @@ -2290,7 +2279,7 @@ void test_configure_encoder_setup(void) cfg.cmp_mode = CMP_MODE_DIFF_MULTI; cfg.icu_output_buf = (void *)123; cfg.buffer_length = 2; - error = configure_encoder_setup(&setup, cmp_par, spillover,lossy_par, + error = configure_encoder_setup(&setup, cmp_par, spillover, lossy_par, max_data_bits, &cfg); TEST_ASSERT_TRUE(error); memset(&setup, 0, sizeof(setup)); @@ -2304,7 +2293,7 @@ void test_configure_encoder_setup(void) cfg.cmp_mode = CMP_MODE_DIFF_MULTI; cfg.icu_output_buf = (void *)123; cfg.buffer_length = 2; - error = configure_encoder_setup(&setup, cmp_par, spillover,lossy_par, + error = configure_encoder_setup(&setup, cmp_par, spillover, lossy_par, max_data_bits, &cfg); TEST_ASSERT_TRUE(error); memset(&setup, 0, sizeof(setup)); @@ -2318,7 +2307,7 @@ void test_configure_encoder_setup(void) cfg.cmp_mode = CMP_MODE_STUFF; cfg.icu_output_buf = (void *)123; cfg.buffer_length = 2; - error = configure_encoder_setup(&setup, cmp_par, spillover,lossy_par, + error = configure_encoder_setup(&setup, cmp_par, spillover, lossy_par, max_data_bits, &cfg); TEST_ASSERT_FALSE(error); TEST_ASSERT_EQUAL(NULL, setup.generate_cw_f); /* pointer to the code word encoder */ @@ -2341,7 +2330,7 @@ void test_configure_encoder_setup(void) cfg.cmp_mode = CMP_MODE_STUFF+1; cfg.icu_output_buf = (void *)123; cfg.buffer_length = 2; - error = configure_encoder_setup(&setup, cmp_par, spillover,lossy_par, + error = configure_encoder_setup(&setup, cmp_par, spillover, lossy_par, max_data_bits, &cfg); TEST_ASSERT_TRUE(error); memset(&setup, 0, sizeof(setup)); @@ -2355,21 +2344,31 @@ void test_configure_encoder_setup(void) cfg.cmp_mode = CMP_MODE_MODEL_ZERO; cfg.icu_output_buf = (void *)123; cfg.buffer_length = 2; - error = configure_encoder_setup(NULL, cmp_par, spillover,lossy_par, + error = configure_encoder_setup(NULL, cmp_par, spillover, lossy_par, max_data_bits, &cfg); TEST_ASSERT_TRUE(error); memset(&setup, 0, sizeof(setup)); - /* cfg = NULL test */ + /* error case: cmp_mode = CMP_MODE_RAW test */ cmp_par = 42; spillover = 23; lossy_par = 0; max_data_bits = 15; cfg.data_type = DATA_TYPE_IMAGETTE; - cfg.cmp_mode = CMP_MODE_MODEL_ZERO; + cfg.cmp_mode = CMP_MODE_RAW; cfg.icu_output_buf = (void *)123; cfg.buffer_length = 2; - error = configure_encoder_setup(&setup, cmp_par, spillover,lossy_par, + error = configure_encoder_setup(&setup, cmp_par, spillover, lossy_par, + max_data_bits, &cfg); + TEST_ASSERT_TRUE(error); + memset(&setup, 0, sizeof(setup)); + + /* cfg = NULL test */ + cmp_par = 42; + spillover = 23; + lossy_par = 0; + max_data_bits = 15; + error = configure_encoder_setup(&setup, cmp_par, spillover, lossy_par, max_data_bits, NULL); TEST_ASSERT_TRUE(error); memset(&setup, 0, sizeof(setup)); @@ -2401,6 +2400,11 @@ void test_compress_imagette_diff(void) TEST_ASSERT_EQUAL_HEX(0xDF6002AB, be32_to_cpu(output_buf[0])); TEST_ASSERT_EQUAL_HEX(0xFEB70000, be32_to_cpu(output_buf[1])); TEST_ASSERT_EQUAL_HEX(0x00000000, be32_to_cpu(output_buf[2])); + + /* test: icu_output_buf = NULL */ + cfg.icu_output_buf = NULL; + cmp_size = icu_compress_data(&cfg); + TEST_ASSERT_EQUAL_INT(66, cmp_size); } @@ -2468,6 +2472,7 @@ void test_compress_imagette_stuff(void) 0x00, 0x23, 0x00, 0x42, 0x80, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0x00, 0x00}; + uint32_t *output_buf_exp_32; cfg.data_type = DATA_TYPE_IMAGETTE; cfg.cmp_mode = CMP_MODE_STUFF; @@ -2479,7 +2484,7 @@ void test_compress_imagette_stuff(void) cmp_size = icu_compress_data(&cfg); - uint32_t *output_buf_exp_32 = (uint32_t *)output_buf_exp; + output_buf_exp_32 = (uint32_t *)output_buf_exp; TEST_ASSERT_EQUAL_INT(7*16, cmp_size); TEST_ASSERT_EQUAL_HEX16(output_buf_exp_32[0], output_buf[0]); TEST_ASSERT_EQUAL_HEX16(output_buf_exp_32[1], output_buf[1]); @@ -2564,6 +2569,7 @@ void test_compress_imagette_error_cases(void) uint32_t output_buf[2] = {0xFFFF, 0xFFFF}; struct cmp_cfg cfg = {0}; int cmp_size; + struct cmp_max_used_bits max_used_bits; cfg.data_type = DATA_TYPE_IMAGETTE; cfg.cmp_mode = CMP_MODE_DIFF_ZERO; @@ -2591,9 +2597,37 @@ void test_compress_imagette_error_cases(void) cmp_size = icu_compress_data(&cfg); TEST_ASSERT_EQUAL_INT(CMP_ERROR_SMALL_BUF, cmp_size); + /* compressed data buffer to small test part 2 */ + cfg.data_type = DATA_TYPE_IMAGETTE; + cfg.cmp_mode = CMP_MODE_DIFF_ZERO; + cfg.input_buf = data; + cfg.samples = 7; + cfg.golomb_par = 1; + cfg.spill = 8; + cfg.icu_output_buf = (uint32_t *)output_buf; + cfg.buffer_length = 1; + + cmp_size = icu_compress_data(&cfg); + TEST_ASSERT_EQUAL_INT(CMP_ERROR_SMALL_BUF, cmp_size); + + /* error invalid data_type */ + cfg.data_type = DATA_TYPE_UNKNOWN; + cfg.cmp_mode = CMP_MODE_DIFF_ZERO; + cfg.input_buf = data; + cfg.samples = 7; + cfg.golomb_par = 1; + cfg.spill = 8; + cfg.icu_output_buf = (uint32_t *)output_buf; + cfg.buffer_length = 4; + cmp_size = icu_compress_data(&cfg); + TEST_ASSERT_EQUAL_INT(-1, cmp_size); + + cfg.data_type = DATA_TYPE_F_CAM_BACKGROUND+1; + cmp_size = icu_compress_data(&cfg); + TEST_ASSERT_EQUAL_INT(-1, cmp_size); /* error in setup */ - struct cmp_max_used_bits max_used_bits = cmp_get_max_used_bits(); + max_used_bits = cmp_get_max_used_bits(); max_used_bits.nc_imagette = 33; cmp_set_max_used_bits(&max_used_bits); cfg.data_type = DATA_TYPE_IMAGETTE; @@ -2607,6 +2641,7 @@ void test_compress_imagette_error_cases(void) cmp_size = icu_compress_data(&cfg); TEST_ASSERT_EQUAL_INT(-1, cmp_size); + } @@ -2699,6 +2734,7 @@ void test_compress_s_fx_raw(void) struct cmp_cfg cfg = {0}; int cmp_size, cmp_size_exp; size_t i; + struct multi_entry_hdr *hdr; cfg.data_type = DATA_TYPE_S_FX; cfg.model_buf = NULL; @@ -2724,7 +2760,7 @@ void test_compress_s_fx_raw(void) data[6].exp_flags = 0x1; data[6].fx = UINT32_MAX; - struct multi_entry_hdr *hdr = cfg.input_buf; + hdr = cfg.input_buf; memset(hdr, 0x42, sizeof(struct multi_entry_hdr)); memcpy(hdr->entry, data, sizeof(data)); @@ -2740,6 +2776,9 @@ void test_compress_s_fx_raw(void) TEST_ASSERT_EQUAL_HEX(data[i].exp_flags, p[i].exp_flags); TEST_ASSERT_EQUAL_HEX(data[i].fx, cpu_to_be32(p[i].fx)); } + + free(cfg.input_buf); + free(cfg.icu_output_buf); } @@ -3023,7 +3062,7 @@ void test_compress_s_fx_error_cases(void) { int error, cmp_bits, compressed_data_size; struct cmp_cfg cfg = {0}; - uint32_t cmp_par_exp_flags = MAX_ICU_GOLOMB_PAR; + uint32_t cmp_par_exp_flags = MAX_NON_IMA_GOLOMB_PAR; uint32_t spillover_exp_flags = 6; uint32_t cmp_par_fx = 2; uint32_t spillover_fx = 8; @@ -3057,7 +3096,7 @@ void test_compress_s_fx_error_cases(void) /* compressed data are to small for the compressed_data buffer */ max_used_bits.s_exp_flags = 8; - max_used_bits.s_fx= 32; + max_used_bits.s_fx = 32; cmp_set_max_used_bits(&max_used_bits); memset(data_to_compress, 0xff, sizeof(data_to_compress)); cmp_bits = icu_compress_data(&cfg); @@ -3069,7 +3108,7 @@ void test_compress_s_fx_error_cases(void) TEST_ASSERT_EQUAL_INT(-1, cmp_bits); max_used_bits.s_exp_flags = 32; - max_used_bits.s_fx= 33; /* more than 32 bits are not allowed */ + max_used_bits.s_fx = 33; /* more than 32 bits are not allowed */ cmp_set_max_used_bits(&max_used_bits); cmp_bits = icu_compress_data(&cfg); TEST_ASSERT_EQUAL_INT(-1, cmp_bits); @@ -3088,12 +3127,12 @@ void test_compress_s_fx_efx_error_cases(void) uint32_t spillover_exp_flags = 6; uint32_t cmp_par_fx = 1; uint32_t spillover_fx = 8; - uint32_t cmp_par_efx = MAX_ICU_GOLOMB_PAR; - uint32_t spillover_efx = cmp_icu_max_spill(MAX_ICU_GOLOMB_PAR); + uint32_t cmp_par_efx = MAX_NON_IMA_GOLOMB_PAR; + uint32_t spillover_efx = cmp_icu_max_spill(MAX_NON_IMA_GOLOMB_PAR); uint8_t data_to_compress[MULTI_ENTRY_HDR_SIZE+2*sizeof(struct s_fx_efx)] = {0}; uint8_t compressed_data[MULTI_ENTRY_HDR_SIZE+1*sizeof(struct s_fx_efx)] = {0}; struct cmp_max_used_bits max_used_bits = {0}; - struct s_fx_efx *data_p= (struct s_fx_efx *)&data_to_compress[MULTI_ENTRY_HDR_SIZE]; + struct s_fx_efx *data_p = (struct s_fx_efx *)&data_to_compress[MULTI_ENTRY_HDR_SIZE]; max_used_bits.s_exp_flags = 2; max_used_bits.s_fx = 21; @@ -3163,8 +3202,8 @@ void test_compress_s_fx_ncob_error_cases(void) uint32_t spillover_exp_flags = 6; uint32_t cmp_par_fx = 1; uint32_t spillover_fx = 8; - uint32_t cmp_par_ncob = MAX_ICU_GOLOMB_PAR; - uint32_t spillover_ncob = cmp_icu_max_spill(MAX_ICU_GOLOMB_PAR); + uint32_t cmp_par_ncob = MAX_NON_IMA_GOLOMB_PAR; + uint32_t spillover_ncob = cmp_icu_max_spill(MAX_NON_IMA_GOLOMB_PAR); uint8_t data_to_compress[MULTI_ENTRY_HDR_SIZE+3*sizeof(struct s_fx_ncob)] = {0}; uint8_t model_data[MULTI_ENTRY_HDR_SIZE+3*sizeof(struct s_fx_ncob)] = {0}; uint8_t compressed_data[MULTI_ENTRY_HDR_SIZE+1*sizeof(struct s_fx_ncob)] = {0}; @@ -3244,10 +3283,10 @@ void test_compress_s_fx_efx_ncob_ecob_error_cases(void) uint32_t spillover_exp_flags = 6; uint32_t cmp_par_fx = 1; uint32_t spillover_fx = 8; - uint32_t cmp_par_ncob = MAX_ICU_GOLOMB_PAR; - uint32_t spillover_ncob = cmp_icu_max_spill(MAX_ICU_GOLOMB_PAR); - uint32_t cmp_par_efx = MAX_ICU_GOLOMB_PAR; - uint32_t spillover_efx = cmp_icu_max_spill(MAX_ICU_GOLOMB_PAR); + uint32_t cmp_par_ncob = MAX_NON_IMA_GOLOMB_PAR; + uint32_t spillover_ncob = cmp_icu_max_spill(MAX_NON_IMA_GOLOMB_PAR); + uint32_t cmp_par_efx = MAX_NON_IMA_GOLOMB_PAR; + uint32_t spillover_efx = cmp_icu_max_spill(MAX_NON_IMA_GOLOMB_PAR); uint32_t cmp_par_ecob = 23; uint32_t spillover_ecob = cmp_icu_max_spill(23); uint8_t data_to_compress[MULTI_ENTRY_HDR_SIZE+3*sizeof(struct s_fx_efx_ncob_ecob)] = {0}; @@ -3356,7 +3395,7 @@ void test_compress_f_fx_error_cases(void) { int error, cmp_bits, compressed_data_size; struct cmp_cfg cfg = {0}; - uint32_t cmp_par_fx = MAX_ICU_GOLOMB_PAR; + uint32_t cmp_par_fx = MAX_NON_IMA_GOLOMB_PAR; uint32_t spillover_fx = 8; uint8_t data_to_compress[MULTI_ENTRY_HDR_SIZE+3*sizeof(struct f_fx)] = {0}; uint8_t compressed_data[MULTI_ENTRY_HDR_SIZE+1*sizeof(struct f_fx)] = {0}; @@ -3382,7 +3421,7 @@ void test_compress_f_fx_error_cases(void) cmp_bits = icu_compress_data(&cfg); TEST_ASSERT_EQUAL_INT(CMP_ERROR_SMALL_BUF, cmp_bits); - max_used_bits.f_fx= 33; /* more than 32 bits are not allowed */ + max_used_bits.f_fx = 33; /* more than 32 bits are not allowed */ cmp_set_max_used_bits(&max_used_bits); cmp_bits = icu_compress_data(&cfg); TEST_ASSERT_EQUAL_INT(-1, cmp_bits); @@ -3437,13 +3476,13 @@ void test_compress_f_fx_efx_error_cases(void) TEST_ASSERT_EQUAL_INT(CMP_ERROR_HIGH_VALUE, cmp_bits); data_p[0].efx = 0x7FFFFFFF; - max_used_bits.f_fx= 33; /* more than 32 bits are not allowed */ + max_used_bits.f_fx = 33; /* more than 32 bits are not allowed */ cmp_set_max_used_bits(&max_used_bits); cmp_bits = icu_compress_data(&cfg); TEST_ASSERT_EQUAL_INT(-1, cmp_bits); - max_used_bits.f_fx= 32; - max_used_bits.f_efx= 33; /* more than 32 bits are not allowed */ + max_used_bits.f_fx = 32; + max_used_bits.f_efx = 33; /* more than 32 bits are not allowed */ cmp_set_max_used_bits(&max_used_bits); cmp_bits = icu_compress_data(&cfg); TEST_ASSERT_EQUAL_INT(-1, cmp_bits); @@ -3458,7 +3497,7 @@ void test_compress_f_fx_ncob_error_cases(void) { int error, cmp_bits, compressed_data_size; struct cmp_cfg cfg = {0}; - uint32_t cmp_par_fx = MAX_ICU_GOLOMB_PAR; + uint32_t cmp_par_fx = MAX_NON_IMA_GOLOMB_PAR; uint32_t spillover_fx = 8; uint32_t cmp_par_ncob = 1; uint32_t spillover_ncob = 8; @@ -3501,13 +3540,13 @@ void test_compress_f_fx_ncob_error_cases(void) TEST_ASSERT_EQUAL_INT(CMP_ERROR_HIGH_VALUE, cmp_bits); data_p[0].ncob_y = 0x7FFFFF; - max_used_bits.f_fx= 33; /* more than 32 bits are not allowed */ + max_used_bits.f_fx = 33; /* more than 32 bits are not allowed */ cmp_set_max_used_bits(&max_used_bits); cmp_bits = icu_compress_data(&cfg); TEST_ASSERT_EQUAL_INT(-1, cmp_bits); - max_used_bits.f_fx= 32; - max_used_bits.f_ncob= 33; /* more than 32 bits are not allowed */ + max_used_bits.f_fx = 32; + max_used_bits.f_ncob = 33; /* more than 32 bits are not allowed */ cmp_set_max_used_bits(&max_used_bits); cmp_bits = icu_compress_data(&cfg); TEST_ASSERT_EQUAL_INT(-1, cmp_bits); @@ -3692,7 +3731,7 @@ void test_compress_l_fx_efx_error_cases(void) { int error, cmp_bits, compressed_data_size; struct cmp_cfg cfg = {0}; - uint32_t cmp_par_exp_flags = MAX_ICU_GOLOMB_PAR; + uint32_t cmp_par_exp_flags = MAX_NON_IMA_GOLOMB_PAR; uint32_t spillover_exp_flags = cmp_icu_max_spill(cmp_par_exp_flags); uint32_t cmp_par_fx = 1; uint32_t spillover_fx = 8; @@ -3779,7 +3818,7 @@ void test_compress_l_fx_ncob_error_cases(void) { int error, cmp_bits, compressed_data_size; struct cmp_cfg cfg = {0}; - uint32_t cmp_par_exp_flags = MAX_ICU_GOLOMB_PAR; + uint32_t cmp_par_exp_flags = MAX_NON_IMA_GOLOMB_PAR; uint32_t spillover_exp_flags = cmp_icu_max_spill(cmp_par_exp_flags); uint32_t cmp_par_fx = 1; uint32_t spillover_fx = 8; @@ -3888,7 +3927,7 @@ void test_compress_l_fx_efx_ncob_ecob_error_cases(void) { int error, cmp_bits, compressed_data_size; struct cmp_cfg cfg = {0}; - uint32_t cmp_par_exp_flags = MAX_ICU_GOLOMB_PAR; + uint32_t cmp_par_exp_flags = MAX_NON_IMA_GOLOMB_PAR; uint32_t spillover_exp_flags = cmp_icu_max_spill(cmp_par_exp_flags); uint32_t cmp_par_fx = 1; uint32_t spillover_fx = 8; @@ -4032,8 +4071,8 @@ void test_compress_nc_offset_error_cases(void) struct cmp_cfg cfg = {0}; uint32_t cmp_par_mean = 1; uint32_t spillover_mean = 2; - uint32_t cmp_par_variance = MAX_ICU_GOLOMB_PAR; - uint32_t spillover_variance = cmp_icu_max_spill(MAX_ICU_GOLOMB_PAR); + uint32_t cmp_par_variance = MAX_NON_IMA_GOLOMB_PAR; + uint32_t spillover_variance = cmp_icu_max_spill(MAX_NON_IMA_GOLOMB_PAR); uint8_t data_to_compress[MULTI_ENTRY_HDR_SIZE+3*sizeof(struct nc_offset)] = {0}; uint8_t compressed_data[MULTI_ENTRY_HDR_SIZE+1*sizeof(struct nc_offset)] = {0}; struct cmp_max_used_bits max_used_bits = {0}; @@ -4090,8 +4129,8 @@ void test_compress_nc_background_error_cases(void) struct cmp_cfg cfg = {0}; uint32_t cmp_par_mean = 1; uint32_t spillover_mean = 2; - uint32_t cmp_par_variance = MAX_ICU_GOLOMB_PAR; - uint32_t spillover_variance = cmp_icu_max_spill(MAX_ICU_GOLOMB_PAR); + uint32_t cmp_par_variance = MAX_NON_IMA_GOLOMB_PAR; + uint32_t spillover_variance = cmp_icu_max_spill(MAX_NON_IMA_GOLOMB_PAR); uint32_t cmp_par_pixels_error = 23; uint32_t spillover_pixels_error = 42; uint8_t data_to_compress[MULTI_ENTRY_HDR_SIZE+3*sizeof(struct nc_background)] = {0}; @@ -4162,8 +4201,8 @@ void test_compress_smearing_error_cases(void) struct cmp_cfg cfg = {0}; uint32_t cmp_par_mean = 1; uint32_t spillover_mean = 2; - uint32_t cmp_par_variance = MAX_ICU_GOLOMB_PAR; - uint32_t spillover_variance = cmp_icu_max_spill(MAX_ICU_GOLOMB_PAR); + uint32_t cmp_par_variance = MAX_NON_IMA_GOLOMB_PAR; + uint32_t spillover_variance = cmp_icu_max_spill(MAX_NON_IMA_GOLOMB_PAR); uint32_t cmp_par_pixels_error = 23; uint32_t spillover_pixels_error = 42; uint8_t data_to_compress[MULTI_ENTRY_HDR_SIZE+3*sizeof(struct smearing)] = {0}; @@ -4374,3 +4413,60 @@ void test_icu_compress_data_error_cases(void) TEST_ASSERT_EQUAL(0, cmp_size); } + +/** + * @test zero_escape_mech_is_used + */ + +void test_zero_escape_mech_is_used(void) +{ + int cmp_mode; + + for (cmp_mode = 0; cmp_mode <= CMP_MODE_STUFF; cmp_mode++) { + int res = zero_escape_mech_is_used(cmp_mode); + + if (cmp_mode == CMP_MODE_DIFF_ZERO || + cmp_mode == CMP_MODE_MODEL_ZERO) + TEST_ASSERT_TRUE(res); + else + TEST_ASSERT_FALSE(res); + } +} + + +void test_support_function_call_NULL(void) +{ + TEST_ASSERT_TRUE(cmp_cfg_gen_par_is_invalid(NULL, ICU_CHECK)); + TEST_ASSERT_TRUE(cmp_cfg_icu_buffers_is_invalid(NULL)); + TEST_ASSERT_TRUE(cmp_cfg_imagette_is_invalid(NULL, ICU_CHECK)); + TEST_ASSERT_TRUE(cmp_cfg_fx_cob_is_invalid(NULL)); + TEST_ASSERT_TRUE(cmp_cfg_aux_is_invalid(NULL)); + TEST_ASSERT_TRUE(cmp_cfg_icu_is_invalid(NULL)); + TEST_ASSERT_TRUE(cmp_cfg_fx_cob_get_need_pars(DATA_TYPE_S_FX, NULL)); +} + + +/** + * @test test_print_cmp_info + */ + +void test_print_cmp_info(void) +{ + struct cmp_info info; + + info.cmp_mode_used = 1; + info.spill_used = 2; + info.golomb_par_used = 3; + info.samples_used = 4; + info.cmp_size = 5; + info.ap1_cmp_size = 6; + info.ap2_cmp_size = 7; + info.rdcu_new_model_adr_used = 8; + info.rdcu_cmp_adr_used = 9; + info.model_value_used = 10; + info.round_used = 11; + info.cmp_err = 12; + + print_cmp_info(&info); + print_cmp_info(NULL); +} diff --git a/test/cmp_icu/test_decmp.c b/test/cmp_icu/test_decmp.c index 6f2fe2df2451f456793b1017b548ce04ed01950c..b00c09c6e2f2c192d324d6a93eecc4d95177cce2 100644 --- a/test/cmp_icu/test_decmp.c +++ b/test/cmp_icu/test_decmp.c @@ -1,6 +1,33 @@ +/** + * @file test_decmp.c + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) + * @date 2022 + * + * @copyright GPLv2 + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * @brief decompression tests + */ + + #include <string.h> #include <stdlib.h> +#if defined __has_include +# if __has_include(<time.h>) +# include <time.h> +# include <unistd.h> +# define HAS_TIME_H 1 +# endif +#endif + #include "unity.h" #include "compiler.h" @@ -13,6 +40,7 @@ #define IMAX_BITS(m) ((m)/((m)%255+1) / 255%255*8 + 7-86/((m)%255+12)) #define RAND_MAX_WIDTH IMAX_BITS(RAND_MAX) +/* TODO: clean up this file */ /** * @brief generate a uint32_t random number @@ -123,10 +151,9 @@ void test_cmp_decmp_n_imagette_raw(void) s = decompress_cmp_entiy(ent, NULL, NULL, decompressed_data); TEST_ASSERT_EQUAL_INT(sizeof(data), s); - for (i = 0; i < ARRAY_SIZE(data); ++i) { + for (i = 0; i < ARRAY_SIZE(data); ++i) TEST_ASSERT_EQUAL_INT(data[i], decompressed_data[i]); - } free(compressed_data); free(ent); @@ -183,7 +210,7 @@ void test_rice_decoder(void) uint32_t code_word; unsigned int m = ~0; /* we don't need this value */ unsigned int log2_m; - unsigned int decoded_cw; + uint32_t decoded_cw; /* test log_2 to big */ code_word = 0xE0000000; @@ -234,6 +261,7 @@ void test_re_map_to_pos(void) for (j = INT16_MIN; j < INT16_MAX; j++) { uint32_t map_val = map_to_pos(j, 16) & 0xFFFF; + result = re_map_to_pos(map_val); TEST_ASSERT_EQUAL_INT32(j, result); } @@ -251,7 +279,7 @@ void test_decode_normal(void) uint32_t decoded_value = ~0; int stream_pos, sample; /* compressed data from 0 to 6; */ - uint32_t cmp_data[] = {0x5BBDF7E0}; + uint32_t cmp_data[1] = {0x5BBDF7E0}; struct decoder_setup setup = {0}; cpu_to_be32s(cmp_data); @@ -310,6 +338,7 @@ void test_decode_multi(void) uint32_t cmp_data[] = {0x16B66DF8, 0x84360000}; struct decoder_setup setup = {0}; struct cmp_cfg cfg = {0}; + int err; cpu_to_be32s(&cmp_data[0]); cpu_to_be32s(&cmp_data[1]); @@ -319,7 +348,7 @@ void test_decode_multi(void) cfg.icu_output_buf = cmp_data; cfg.buffer_length = 8; - int err = configure_decoder_setup(&setup, 3, 8, CMP_LOSSLESS, 16, &cfg); + err = configure_decoder_setup(&setup, 3, 8, CMP_LOSSLESS, 16, &cfg); TEST_ASSERT_FALSE(err); stream_pos = 0; @@ -390,7 +419,7 @@ void test_cmp_decmp_s_fx_diff(void) struct cmp_entity *ent; const uint32_t MAX_VALUE = ~(~0U << MAX_USED_S_FX_BITS); struct s_fx data_entry[DATA_SAMPLES] = { - {0,0}, {1,23}, {2,42}, {3,MAX_VALUE}, {3,MAX_VALUE>>1} }; + {0, 0}, {1, 23}, {2, 42}, {3, MAX_VALUE}, {3, MAX_VALUE>>1} }; uint8_t data_to_compress[MULTI_ENTRY_HDR_SIZE + sizeof(data_entry)]; struct s_fx *decompressed_data = NULL; /* uint32_t *compressed_data = NULL; */ @@ -437,6 +466,8 @@ void test_cmp_decmp_s_fx_diff(void) /* if (up_model[i] != de_up_model[i]) */ /* TEST_ASSERT(0); */ /* } */ + free(ent); + free(decompressed_data); } #undef DATA_SAMPLES @@ -512,7 +543,7 @@ int my_random(unsigned int min, unsigned int max) void test_imagette_random(void) { - unsigned int seed = time(NULL) * getpid(); + unsigned int seed; size_t i, s, cmp_data_size; int error; struct cmp_cfg cfg; @@ -526,6 +557,11 @@ void test_imagette_random(void) uint16_t *data, *model = NULL, *up_model = NULL, *de_up_model = NULL; /* Seeds the pseudo-random number generator used by rand() */ +#if HAS_TIME_H + seed = time(NULL) * getpid(); +#else + seed = 1; +#endif srand(seed); printf("seed: %u\n", seed); @@ -629,6 +665,7 @@ void test_s_fx_diff(void) for (i = 0; i < s; ++i) { TEST_ASSERT_EQUAL(result_data[i], decompressed_data[i]); } + free(decompressed_data); } @@ -640,7 +677,7 @@ void test_s_fx_model(void) 0x00, 0x00, 0x0A, 0x00, 0x01, 0x00, 0x00, 0x0A, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x3B, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0x5B, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0x5D, 0x80, 0x00, 0x00, }; - struct cmp_entity * cmp_entity = (struct cmp_entity *)compressed_data_buf; + struct cmp_entity *cmp_entity = (struct cmp_entity *)compressed_data_buf; uint8_t model_buf[32]; uint8_t decompressed_data[32]; @@ -700,7 +737,7 @@ void test_s_fx_model(void) void generate_random_test_data(void *data, int samples, enum cmp_data_type data_type) { - int s = cmp_cal_size_of_data(samples, data_type); + uint32_t s = cmp_cal_size_of_data(samples, data_type); memset(data, 0x0, s); } @@ -720,7 +757,7 @@ void test_random_compression_decompression(void) /* cfg.data_type < DATA_TYPE_F_CAM_BACKGROUND+1; cfg.data_type++) { */ for (cfg.data_type = DATA_TYPE_IMAGETTE; cfg.data_type < DATA_TYPE_F_CAM_IMAGETTE_ADAPTIVE+1; cfg.data_type++) { - cfg.samples = my_random(1,0x30000); + cfg.samples = my_random(1, 0x30000); if (cfg.data_type == DATA_TYPE_OFFSET) puts("FADF"); @@ -743,36 +780,36 @@ void test_random_compression_decompression(void) generate_random_test_data(cfg.input_buf, cfg.samples, cfg.data_type); generate_random_test_data(cfg.model_buf, cfg.samples, cfg.data_type); - cfg.model_value = my_random(0,16); + cfg.model_value = my_random(0, 16); /* cfg.round = my_random(0,3); /1* XXX *1/ */ cfg.round = 0; cfg.golomb_par = my_random(MIN_IMA_GOLOMB_PAR, MAX_IMA_GOLOMB_PAR); cfg.ap1_golomb_par = my_random(MIN_IMA_GOLOMB_PAR, MAX_IMA_GOLOMB_PAR); cfg.ap2_golomb_par = my_random(MIN_IMA_GOLOMB_PAR, MAX_IMA_GOLOMB_PAR); - cfg.cmp_par_exp_flags = my_random(MIN_ICU_GOLOMB_PAR, MAX_ICU_GOLOMB_PAR); - cfg.cmp_par_fx = my_random(MIN_ICU_GOLOMB_PAR, MAX_ICU_GOLOMB_PAR); - cfg.cmp_par_ncob = my_random(MIN_ICU_GOLOMB_PAR, MAX_ICU_GOLOMB_PAR); - cfg.cmp_par_efx = my_random(MIN_ICU_GOLOMB_PAR, MAX_ICU_GOLOMB_PAR); - cfg.cmp_par_ecob = my_random(MIN_ICU_GOLOMB_PAR, MAX_ICU_GOLOMB_PAR); - cfg.cmp_par_fx_cob_variance = my_random(MIN_ICU_GOLOMB_PAR, MAX_ICU_GOLOMB_PAR); - cfg.cmp_par_mean = my_random(MIN_ICU_GOLOMB_PAR, MAX_ICU_GOLOMB_PAR); - cfg.cmp_par_variance = my_random(MIN_ICU_GOLOMB_PAR, MAX_ICU_GOLOMB_PAR); - cfg.cmp_par_pixels_error = my_random(MIN_ICU_GOLOMB_PAR, MAX_ICU_GOLOMB_PAR); + cfg.cmp_par_exp_flags = my_random(MIN_NON_IMA_GOLOMB_PAR, MAX_NON_IMA_GOLOMB_PAR); + cfg.cmp_par_fx = my_random(MIN_NON_IMA_GOLOMB_PAR, MAX_NON_IMA_GOLOMB_PAR); + cfg.cmp_par_ncob = my_random(MIN_NON_IMA_GOLOMB_PAR, MAX_NON_IMA_GOLOMB_PAR); + cfg.cmp_par_efx = my_random(MIN_NON_IMA_GOLOMB_PAR, MAX_NON_IMA_GOLOMB_PAR); + cfg.cmp_par_ecob = my_random(MIN_NON_IMA_GOLOMB_PAR, MAX_NON_IMA_GOLOMB_PAR); + cfg.cmp_par_fx_cob_variance = my_random(MIN_NON_IMA_GOLOMB_PAR, MAX_NON_IMA_GOLOMB_PAR); + cfg.cmp_par_mean = my_random(MIN_NON_IMA_GOLOMB_PAR, MAX_NON_IMA_GOLOMB_PAR); + cfg.cmp_par_variance = my_random(MIN_NON_IMA_GOLOMB_PAR, MAX_NON_IMA_GOLOMB_PAR); + cfg.cmp_par_pixels_error = my_random(MIN_NON_IMA_GOLOMB_PAR, MAX_NON_IMA_GOLOMB_PAR); cfg.spill = my_random(MIN_IMA_SPILL, cmp_ima_max_spill(cfg.golomb_par)); cfg.ap1_spill = my_random(MIN_IMA_SPILL, cmp_ima_max_spill(cfg.ap1_golomb_par)); cfg.ap2_spill = my_random(MIN_IMA_SPILL, cmp_ima_max_spill(cfg.ap2_golomb_par)); if (!rdcu_supported_data_type_is_used(cfg.data_type)) { - cfg.spill_exp_flags = my_random(MIN_ICU_SPILL, cmp_icu_max_spill(cfg.cmp_par_exp_flags)); - cfg.spill_fx = my_random(MIN_ICU_SPILL, cmp_icu_max_spill(cfg.cmp_par_fx)); - cfg.spill_ncob = my_random(MIN_ICU_SPILL, cmp_icu_max_spill(cfg.cmp_par_ncob)); - cfg.spill_efx = my_random(MIN_ICU_SPILL, cmp_icu_max_spill(cfg.cmp_par_efx)); - cfg.spill_ecob = my_random(MIN_ICU_SPILL, cmp_icu_max_spill(cfg.cmp_par_ecob)); - cfg.spill_fx_cob_variance = my_random(MIN_ICU_SPILL, cmp_icu_max_spill(cfg.cmp_par_fx_cob_variance)); - cfg.spill_mean = my_random(MIN_ICU_SPILL, cmp_icu_max_spill(cfg.cmp_par_mean)); - cfg.spill_variance = my_random(MIN_ICU_SPILL, cmp_icu_max_spill(cfg.cmp_par_variance)); - cfg.spill_pixels_error = my_random(MIN_ICU_SPILL, cmp_icu_max_spill(cfg.cmp_par_pixels_error)); + cfg.spill_exp_flags = my_random(MIN_NON_IMA_SPILL, cmp_icu_max_spill(cfg.cmp_par_exp_flags)); + cfg.spill_fx = my_random(MIN_NON_IMA_SPILL, cmp_icu_max_spill(cfg.cmp_par_fx)); + cfg.spill_ncob = my_random(MIN_NON_IMA_SPILL, cmp_icu_max_spill(cfg.cmp_par_ncob)); + cfg.spill_efx = my_random(MIN_NON_IMA_SPILL, cmp_icu_max_spill(cfg.cmp_par_efx)); + cfg.spill_ecob = my_random(MIN_NON_IMA_SPILL, cmp_icu_max_spill(cfg.cmp_par_ecob)); + cfg.spill_fx_cob_variance = my_random(MIN_NON_IMA_SPILL, cmp_icu_max_spill(cfg.cmp_par_fx_cob_variance)); + cfg.spill_mean = my_random(MIN_NON_IMA_SPILL, cmp_icu_max_spill(cfg.cmp_par_mean)); + cfg.spill_variance = my_random(MIN_NON_IMA_SPILL, cmp_icu_max_spill(cfg.cmp_par_variance)); + cfg.spill_pixels_error = my_random(MIN_NON_IMA_SPILL, cmp_icu_max_spill(cfg.cmp_par_pixels_error)); } for (cfg.cmp_mode = CMP_MODE_RAW; cfg.cmp_mode < CMP_MODE_STUFF; cfg.cmp_mode++) { @@ -781,7 +818,7 @@ void test_random_compression_decompression(void) cmp_size = icu_compress_data_entity(cmp_ent, &cfg); if (cmp_size <= 0) { printf("cmp_size: %i\n", cmp_size); - print_cfg(&cfg, 0); + cmp_cfg_print(&cfg); } TEST_ASSERT_GREATER_THAN(0, cmp_size); @@ -791,7 +828,7 @@ void test_random_compression_decompression(void) TEST_ASSERT_EQUAL_INT(s, decompress_size); if (memcmp(cfg.input_buf, decompressed_data, s)) { - print_cfg(&cfg, 0); + cmp_cfg_print(&cfg); TEST_ASSERT_FALSE(memcmp(cfg.input_buf, decompressed_data, s)); } if (model_mode_is_used(cfg.cmp_mode)) diff --git a/test/cmp_rdcu_cfg/meson.build b/test/cmp_rdcu_cfg/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..3d01fd0297b23c01ac0c08ee604daecca97e2b6c --- /dev/null +++ b/test/cmp_rdcu_cfg/meson.build @@ -0,0 +1,12 @@ +test_case = files('test_cmp_rdcu_cfg.c') +test_runner = test_runner_generator.process(test_case) + +test_cmp_rdcu_cfg = executable('test_cmp_rdcu_cfg', + test_case, test_runner, + include_directories : incdir, + link_with : cmp_lib, + dependencies : unity_dep, + build_by_default : false +) + +test('Hardware Compressor Configuration Tests', test_cmp_rdcu_cfg) diff --git a/test/cmp_rdcu_cfg/test_cmp_rdcu_cfg.c b/test/cmp_rdcu_cfg/test_cmp_rdcu_cfg.c new file mode 100644 index 0000000000000000000000000000000000000000..a59ecfdd0ee68af4f063abd13a2bc70c7ac4ef82 --- /dev/null +++ b/test/cmp_rdcu_cfg/test_cmp_rdcu_cfg.c @@ -0,0 +1,768 @@ +/** + * @file test_cmp_rdcu_cfg.c + * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) + * @date 2022 + * + * @copyright GPLv2 + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * @brief hardware compressor configuration tests + */ + +#include <stdint.h> + +#include <unity.h> +#include <cmp_rdcu_cfg.h> +#include <rdcu_cmd.h> + + +/** + * @test rdcu_cfg_create + */ + +void test_rdcu_cfg_create(void) +{ + struct cmp_cfg cfg; + enum cmp_data_type data_type; + enum cmp_mode cmp_mode; + uint32_t model_value, lossy_par; + + /* wrong data type tests */ + data_type = DATA_TYPE_UNKNOWN; /* not valid data type */ + cmp_mode = CMP_MODE_RAW; + model_value = 0; + lossy_par = CMP_LOSSLESS; + cfg = rdcu_cfg_create(data_type, cmp_mode, model_value, lossy_par); + TEST_ASSERT_EQUAL(DATA_TYPE_UNKNOWN, cfg.data_type); + + /* data_type not supported by RDCU */ + data_type = DATA_TYPE_OFFSET; + cfg = rdcu_cfg_create(data_type, cmp_mode, model_value, lossy_par); + TEST_ASSERT_EQUAL(DATA_TYPE_UNKNOWN, cfg.data_type); + + data_type = -1U; /* not valid data type */ + cfg = rdcu_cfg_create(data_type, cmp_mode, model_value, lossy_par); + TEST_ASSERT_EQUAL(DATA_TYPE_UNKNOWN, cfg.data_type); + + /*now it should work */ + data_type = DATA_TYPE_F_CAM_IMAGETTE_ADAPTIVE; + cfg = rdcu_cfg_create(data_type, cmp_mode, model_value, lossy_par); + TEST_ASSERT_EQUAL(data_type, cfg.data_type); + TEST_ASSERT_EQUAL(cmp_mode, cfg.cmp_mode); + TEST_ASSERT_EQUAL(model_value, cfg.model_value); + TEST_ASSERT_EQUAL(lossy_par, cfg.round); + + + /* wrong compression mode tests */ + cmp_mode = CMP_MODE_STUFF; /* not a RDCU compression mode */ + cfg = rdcu_cfg_create(data_type, cmp_mode, model_value, lossy_par); + TEST_ASSERT_EQUAL(DATA_TYPE_UNKNOWN, cfg.data_type); + + cmp_mode = -1U; + cfg = rdcu_cfg_create(data_type, cmp_mode, model_value, lossy_par); + TEST_ASSERT_EQUAL(DATA_TYPE_UNKNOWN, cfg.data_type); + + /* this should work */ + cmp_mode = 4; + cfg = rdcu_cfg_create(data_type, cmp_mode, model_value, lossy_par); + TEST_ASSERT_EQUAL(data_type, cfg.data_type); + TEST_ASSERT_EQUAL(cmp_mode, cfg.cmp_mode); + TEST_ASSERT_EQUAL(model_value, cfg.model_value); + TEST_ASSERT_EQUAL(lossy_par, cfg.round); + + + /* wrong model_value tests */ + cmp_mode = CMP_MODE_DIFF_ZERO; + model_value = MAX_MODEL_VALUE + 1; + cfg = rdcu_cfg_create(data_type, cmp_mode, model_value, lossy_par); + TEST_ASSERT_EQUAL(DATA_TYPE_UNKNOWN, cfg.data_type); + + cmp_mode = CMP_MODE_RAW; + model_value = -1U; + cfg = rdcu_cfg_create(data_type, cmp_mode, model_value, lossy_par); + TEST_ASSERT_EQUAL(DATA_TYPE_UNKNOWN, cfg.data_type); + + /* this should work */ + model_value = MAX_MODEL_VALUE; + cfg = rdcu_cfg_create(data_type, cmp_mode, model_value, lossy_par); + TEST_ASSERT_EQUAL(data_type, cfg.data_type); + TEST_ASSERT_EQUAL(cmp_mode, cfg.cmp_mode); + TEST_ASSERT_EQUAL(model_value, cfg.model_value); + TEST_ASSERT_EQUAL(lossy_par, cfg.round); + + + /* wrong lossy_par tests */ + lossy_par = MAX_RDCU_ROUND + 1; + cfg = rdcu_cfg_create(data_type, cmp_mode, model_value, lossy_par); + TEST_ASSERT_EQUAL(DATA_TYPE_UNKNOWN, cfg.data_type); + + lossy_par = -1U; + cfg = rdcu_cfg_create(data_type, cmp_mode, model_value, lossy_par); + TEST_ASSERT_EQUAL(DATA_TYPE_UNKNOWN, cfg.data_type); + + /* this should work */ + lossy_par = MAX_RDCU_ROUND; + cfg = rdcu_cfg_create(data_type, cmp_mode, model_value, lossy_par); + TEST_ASSERT_EQUAL(data_type, cfg.data_type); + TEST_ASSERT_EQUAL(cmp_mode, cfg.cmp_mode); + TEST_ASSERT_EQUAL(model_value, cfg.model_value); + TEST_ASSERT_EQUAL(lossy_par, cfg.round); + + + /* wrong data type test */ + for (data_type = 0; data_type <= DATA_TYPE_F_CAM_BACKGROUND; data_type++) { + cfg = rdcu_cfg_create(data_type, CMP_MODE_DIFF_MULTI, MAX_MODEL_VALUE, CMP_LOSSLESS); + if (data_type == DATA_TYPE_IMAGETTE || + data_type == DATA_TYPE_IMAGETTE_ADAPTIVE || + data_type == DATA_TYPE_SAT_IMAGETTE || + data_type == DATA_TYPE_SAT_IMAGETTE_ADAPTIVE || + data_type == DATA_TYPE_F_CAM_IMAGETTE || + data_type == DATA_TYPE_F_CAM_IMAGETTE_ADAPTIVE) { + TEST_ASSERT_EQUAL(data_type, cfg.data_type); + TEST_ASSERT_EQUAL(CMP_MODE_DIFF_MULTI, cfg.cmp_mode); + TEST_ASSERT_EQUAL(MAX_MODEL_VALUE, cfg.model_value); + TEST_ASSERT_EQUAL(CMP_LOSSLESS, cfg.round); + } else { + TEST_ASSERT_EQUAL(DATA_TYPE_UNKNOWN, cfg.data_type); + } + } +} + + +/** + * @test rdcu_cfg_buffers + */ + +void test_rdcu_cfg_buffers_raw_diff(void) +{ + int error; + struct cmp_cfg cfg; + uint16_t data_to_compress[4] = {0x23, 0x42, 0xFF, 0x32}; + uint32_t data_samples = 4; + uint32_t rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr; + uint32_t rdcu_buffer_adr, rdcu_buffer_lenght; + + + /* test a RAW mode buffer configuration */ + cfg = rdcu_cfg_create(DATA_TYPE_IMAGETTE_ADAPTIVE, CMP_MODE_RAW, + MAX_MODEL_VALUE, CMP_LOSSLESS); + + rdcu_model_adr = 0x0; + rdcu_new_model_adr = 0x0; + rdcu_data_adr = 0x0; + rdcu_buffer_adr = 0x8; + rdcu_buffer_lenght = 4; + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, NULL, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_FALSE(error); + TEST_ASSERT_EQUAL(data_to_compress, cfg.input_buf); + TEST_ASSERT_EQUAL(data_samples, cfg.samples); + TEST_ASSERT_EQUAL(NULL, cfg.model_buf); + TEST_ASSERT_EQUAL(rdcu_data_adr, cfg.rdcu_data_adr); + TEST_ASSERT_EQUAL(rdcu_model_adr, cfg.rdcu_model_adr); + TEST_ASSERT_EQUAL(rdcu_new_model_adr, cfg.rdcu_new_model_adr); + TEST_ASSERT_EQUAL(rdcu_buffer_adr, cfg.rdcu_buffer_adr); + TEST_ASSERT_EQUAL(rdcu_buffer_lenght, cfg.buffer_length); + + /* set input buffer to NULL */ + error = rdcu_cfg_buffers(&cfg, NULL, data_samples, NULL, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_FALSE(error); + + /* error: destination buffer to small */ + rdcu_data_adr = 0x0; + rdcu_buffer_adr = 0x8; + rdcu_buffer_lenght = 3; + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, NULL, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_EQUAL(1, error); + + /* error: data and compressed buffer overlap */ + rdcu_data_adr = 0x0; + rdcu_buffer_adr = 0x4; + rdcu_buffer_lenght = 4; + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, NULL, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_EQUAL(1, error); + + /* get a diff config */ + cfg = rdcu_cfg_create(DATA_TYPE_IMAGETTE, CMP_MODE_DIFF_MULTI, + MAX_MODEL_VALUE, CMP_LOSSLESS); + rdcu_data_adr = 0x4; + rdcu_buffer_adr = 0x0; + rdcu_buffer_lenght = 4; + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, NULL, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_EQUAL(1, error); + + /* error: data or SRAM addresses out of allowed range */ + rdcu_data_adr = RDCU_SRAM_END & ~0x3UL; + rdcu_buffer_adr = 0x8; + rdcu_buffer_lenght = 4; + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, NULL, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_EQUAL(1, error); + + rdcu_data_adr = 0x0; + rdcu_buffer_adr = 0x8; + rdcu_buffer_lenght = RDCU_SRAM_SIZE; + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, NULL, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_EQUAL(1, error); + + rdcu_data_adr = 0xFFFFFFFC; + rdcu_buffer_adr = 0x8; + rdcu_buffer_lenght = 4; + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, NULL, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_EQUAL(1, error); + + rdcu_data_adr = 0x0; + rdcu_buffer_adr = 0x8; + rdcu_buffer_lenght = UINT32_MAX; + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, NULL, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_EQUAL(1, error); + + /* error: data and buffer addresses are not 4 byte aligned */ + rdcu_data_adr = 0x2; + rdcu_buffer_adr = 0x10; + rdcu_buffer_lenght = 4; + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, NULL, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_EQUAL(1, error); + + rdcu_data_adr = 0x0; + rdcu_buffer_adr = 0x9; + rdcu_buffer_lenght = 4; + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, NULL, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_EQUAL(1, error); + + /* error: cfg = NULL */ + error = rdcu_cfg_buffers(NULL, data_to_compress, data_samples, NULL, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_EQUAL(-1, error); +} + + +/** + * @test rdcu_cfg_buffers + */ + +void test_rdcu_cfg_buffers_model(void) +{ + int error; + struct cmp_cfg cfg; + uint16_t data_to_compress[4] = {0x23, 0x42, 0xFF, 0x32}; + uint16_t model_of_data[4] = {0xFF, 0x12, 0x34, 0xAB}; + uint32_t data_samples = 4; + uint32_t rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr; + uint32_t rdcu_buffer_adr, rdcu_buffer_lenght; + + + /* test a RAW mode buffer configuration */ + cfg = rdcu_cfg_create(DATA_TYPE_IMAGETTE, CMP_MODE_MODEL_MULTI, + MAX_MODEL_VALUE, CMP_LOSSLESS); + + rdcu_data_adr = 0x0; + rdcu_model_adr = 0x8; + rdcu_new_model_adr = 0x10; + rdcu_buffer_adr = 0x18; + rdcu_buffer_lenght = 4; + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, model_of_data, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_FALSE(error); + TEST_ASSERT_EQUAL(data_to_compress, cfg.input_buf); + TEST_ASSERT_EQUAL(data_samples, cfg.samples); + TEST_ASSERT_EQUAL(model_of_data, cfg.model_buf); + TEST_ASSERT_EQUAL(rdcu_data_adr, cfg.rdcu_data_adr); + TEST_ASSERT_EQUAL(rdcu_model_adr, cfg.rdcu_model_adr); + TEST_ASSERT_EQUAL(rdcu_new_model_adr, cfg.rdcu_new_model_adr); + TEST_ASSERT_EQUAL(rdcu_buffer_adr, cfg.rdcu_buffer_adr); + TEST_ASSERT_EQUAL(rdcu_buffer_lenght, cfg.buffer_length); + + /* data and model buffers are NULL */ + rdcu_new_model_adr = rdcu_model_adr; + error = rdcu_cfg_buffers(&cfg, NULL, data_samples, NULL, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_FALSE(error); + + /* error: data and model buffer are the same */ + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, data_to_compress, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_EQUAL(1, error); + + /* error: model address not 4 byte aligned */ + rdcu_data_adr = 0x0; + rdcu_model_adr = 0xA; /* not 4 byte aligned */ + rdcu_new_model_adr = rdcu_model_adr; + rdcu_buffer_adr = 0x14; + rdcu_buffer_lenght = 4; + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, model_of_data, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_EQUAL(1, error); + + /* error: model address not in SRAM range */ + rdcu_data_adr = 0x0; + rdcu_model_adr = 0xFFFFFFFC; /* not in SRAM range */ + rdcu_new_model_adr = rdcu_model_adr; + rdcu_buffer_adr = 0x10; + rdcu_buffer_lenght = 4; + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, model_of_data, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_EQUAL(1, error); + + /* error: data and model rdcu buffers overlaps */ + rdcu_data_adr = 0x0; + rdcu_model_adr = 0x4; /* overlaps with data buffer */ + rdcu_new_model_adr = rdcu_model_adr; + rdcu_buffer_adr = 0x10; + rdcu_buffer_lenght = 4; + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, model_of_data, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_EQUAL(1, error); + + /* error: compressed buffer and model rdcu buffers overlaps */ + rdcu_data_adr = 0x0; + rdcu_model_adr = 0xC; /* overlaps with compressed data buffer */ + rdcu_new_model_adr = rdcu_model_adr; + rdcu_buffer_adr = 0x10; + rdcu_buffer_lenght = 4; + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, model_of_data, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_EQUAL(1, error); + + /** test with the updated_model buffer **/ + + /* error: updated_model address not 4 byte aligned */ + rdcu_data_adr = 0x0; + rdcu_model_adr = 0x8; + rdcu_new_model_adr = 0x11; /* not 4 byte aligned */ + rdcu_buffer_adr = 0x1C; + rdcu_buffer_lenght = 4; + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, model_of_data, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_EQUAL(1, error); + + /* error: updated_model address not in SRAM range */ + rdcu_data_adr = 0x0; + rdcu_model_adr = 0x8; + rdcu_new_model_adr = 0xFFFFFFFC; /* not in SRAM range */ + rdcu_buffer_adr = 0x18; + rdcu_buffer_lenght = 4; + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, model_of_data, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_EQUAL(1, error); + + /* error: data and updated model rdcu buffers overlaps */ + rdcu_data_adr = 0x8; + rdcu_model_adr = 0x0; + rdcu_new_model_adr = 0xC; /* overlaps with data buffer */ + rdcu_buffer_adr = 0x18; + rdcu_buffer_lenght = 4; + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, model_of_data, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_EQUAL(1, error); + + /* error: compressed buffer and updated_model rdcu buffers overlaps */ + rdcu_data_adr = 0x0; + rdcu_model_adr = 0x8; + rdcu_new_model_adr = 0x14; /* overlaps with compressed data buffer */ + rdcu_buffer_adr = 0x18; + rdcu_buffer_lenght = 4; + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, model_of_data, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_EQUAL(1, error); + + /* error: model and updated_model rdcu buffers overlaps */ + rdcu_data_adr = 0x0; + rdcu_model_adr = 0x8; + rdcu_new_model_adr = 0xC; /* overlaps with model buffer */ + rdcu_buffer_adr = 0x18; + rdcu_buffer_lenght = 4; + error = rdcu_cfg_buffers(&cfg, data_to_compress, data_samples, model_of_data, + rdcu_data_adr, rdcu_model_adr, rdcu_new_model_adr, + rdcu_buffer_adr, rdcu_buffer_lenght); + TEST_ASSERT_EQUAL(1, error); + +} + + +/** + * @test rdcu_cfg_imagette + */ + +void test_rdcu_cfg_imagette(void) +{ + int error; + struct cmp_cfg cfg = rdcu_cfg_create(DATA_TYPE_IMAGETTE, CMP_MODE_RAW, + 10, CMP_LOSSLESS); + uint32_t golomb_par, spillover_par, ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par; + + golomb_par = MIN_IMA_GOLOMB_PAR; + spillover_par = MIN_IMA_SPILL; + ap1_golomb_par = MIN_IMA_GOLOMB_PAR; + ap1_spillover_par = MIN_IMA_SPILL; + ap2_golomb_par = MIN_IMA_GOLOMB_PAR; + ap2_spillover_par = MIN_IMA_SPILL; + + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_FALSE(error); + TEST_ASSERT_EQUAL(golomb_par, cfg.golomb_par); + TEST_ASSERT_EQUAL(spillover_par, cfg.spill); + TEST_ASSERT_EQUAL(ap1_golomb_par, cfg.ap1_golomb_par); + TEST_ASSERT_EQUAL(ap1_spillover_par, cfg.ap1_spill); + TEST_ASSERT_EQUAL(ap2_golomb_par, cfg.ap2_golomb_par); + TEST_ASSERT_EQUAL(ap2_spillover_par, cfg.ap2_spill); + + + /* wrong golomb_par */ + golomb_par = MIN_IMA_GOLOMB_PAR - 1; + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_TRUE(error); + + golomb_par = MAX_IMA_GOLOMB_PAR + 1; + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_TRUE(error); + + /* this should work */ + golomb_par = MAX_IMA_GOLOMB_PAR; + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_FALSE(error); + TEST_ASSERT_EQUAL(golomb_par, cfg.golomb_par); + TEST_ASSERT_EQUAL(spillover_par, cfg.spill); + TEST_ASSERT_EQUAL(ap1_golomb_par, cfg.ap1_golomb_par); + TEST_ASSERT_EQUAL(ap1_spillover_par, cfg.ap1_spill); + TEST_ASSERT_EQUAL(ap2_golomb_par, cfg.ap2_golomb_par); + TEST_ASSERT_EQUAL(ap2_spillover_par, cfg.ap2_spill); + + + /* wrong ap1_golomb_par */ + ap1_golomb_par = MIN_IMA_GOLOMB_PAR - 1; + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_TRUE(error); + + ap1_golomb_par = MAX_IMA_GOLOMB_PAR + 1; + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_TRUE(error); + + /* this should work */ + ap1_golomb_par = MAX_IMA_GOLOMB_PAR; + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_FALSE(error); + TEST_ASSERT_EQUAL(golomb_par, cfg.golomb_par); + TEST_ASSERT_EQUAL(spillover_par, cfg.spill); + TEST_ASSERT_EQUAL(ap1_golomb_par, cfg.ap1_golomb_par); + TEST_ASSERT_EQUAL(ap1_spillover_par, cfg.ap1_spill); + TEST_ASSERT_EQUAL(ap2_golomb_par, cfg.ap2_golomb_par); + TEST_ASSERT_EQUAL(ap2_spillover_par, cfg.ap2_spill); + + + /* wrong ap2_golomb_par */ + cfg.cmp_mode = CMP_MODE_DIFF_ZERO; + ap2_golomb_par = MIN_IMA_GOLOMB_PAR - 1; + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_TRUE(error); + + ap2_golomb_par = MAX_IMA_GOLOMB_PAR + 1; + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_TRUE(error); + + /* this should work */ + ap2_golomb_par = MAX_IMA_GOLOMB_PAR; + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_FALSE(error); + TEST_ASSERT_EQUAL(golomb_par, cfg.golomb_par); + TEST_ASSERT_EQUAL(spillover_par, cfg.spill); + TEST_ASSERT_EQUAL(ap1_golomb_par, cfg.ap1_golomb_par); + TEST_ASSERT_EQUAL(ap1_spillover_par, cfg.ap1_spill); + TEST_ASSERT_EQUAL(ap2_golomb_par, cfg.ap2_golomb_par); + TEST_ASSERT_EQUAL(ap2_spillover_par, cfg.ap2_spill); + + + /* wrong spillover_par */ + golomb_par = MIN_IMA_GOLOMB_PAR; + spillover_par = cmp_ima_max_spill(golomb_par)+1; + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_EQUAL(1, error); + golomb_par = MAX_IMA_GOLOMB_PAR; + spillover_par = cmp_ima_max_spill(golomb_par)+1; + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_EQUAL(1, error); + + golomb_par = MIN_IMA_GOLOMB_PAR; + spillover_par = MIN_IMA_SPILL - 1; + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_EQUAL(1, error); + + /* this should work */ + golomb_par = MAX_IMA_GOLOMB_PAR; + spillover_par = cmp_ima_max_spill(golomb_par); + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_FALSE(error); + TEST_ASSERT_EQUAL(golomb_par, cfg.golomb_par); + TEST_ASSERT_EQUAL(spillover_par, cfg.spill); + TEST_ASSERT_EQUAL(ap1_golomb_par, cfg.ap1_golomb_par); + TEST_ASSERT_EQUAL(ap1_spillover_par, cfg.ap1_spill); + TEST_ASSERT_EQUAL(ap2_golomb_par, cfg.ap2_golomb_par); + TEST_ASSERT_EQUAL(ap2_spillover_par, cfg.ap2_spill); + + + /* wrong ap1_spillover_par */ + ap1_golomb_par = MIN_IMA_GOLOMB_PAR; + ap1_spillover_par = cmp_ima_max_spill(golomb_par)+1; + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_EQUAL(1, error); + ap1_golomb_par = MAX_IMA_GOLOMB_PAR; + ap1_spillover_par = cmp_ima_max_spill(golomb_par)+1; + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_EQUAL(1, error); + + ap1_golomb_par = MIN_IMA_GOLOMB_PAR; + ap1_spillover_par = MIN_IMA_SPILL - 1; + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_EQUAL(1, error); + + /* this should work */ + ap1_golomb_par = MAX_IMA_GOLOMB_PAR; + ap1_spillover_par = cmp_ima_max_spill(golomb_par); + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_FALSE(error); + TEST_ASSERT_EQUAL(golomb_par, cfg.golomb_par); + TEST_ASSERT_EQUAL(spillover_par, cfg.spill); + TEST_ASSERT_EQUAL(ap1_golomb_par, cfg.ap1_golomb_par); + TEST_ASSERT_EQUAL(ap1_spillover_par, cfg.ap1_spill); + TEST_ASSERT_EQUAL(ap2_golomb_par, cfg.ap2_golomb_par); + TEST_ASSERT_EQUAL(ap2_spillover_par, cfg.ap2_spill); + + + /* wrong ap2_spillover_par */ + ap2_golomb_par = MIN_IMA_GOLOMB_PAR; + ap2_spillover_par = cmp_ima_max_spill(golomb_par)+1; + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_EQUAL(1, error); + ap2_golomb_par = MAX_IMA_GOLOMB_PAR; + ap2_spillover_par = cmp_ima_max_spill(golomb_par)+1; + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_EQUAL(1, error); + + ap2_golomb_par = MIN_IMA_GOLOMB_PAR; + ap2_spillover_par = MIN_IMA_SPILL - 1; + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_EQUAL(1, error); + + /* this should work */ + ap2_golomb_par = MAX_IMA_GOLOMB_PAR; + ap2_spillover_par = cmp_ima_max_spill(golomb_par); + error = rdcu_cfg_imagette(&cfg, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, + ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_FALSE(error); + TEST_ASSERT_EQUAL(golomb_par, cfg.golomb_par); + TEST_ASSERT_EQUAL(spillover_par, cfg.spill); + TEST_ASSERT_EQUAL(ap1_golomb_par, cfg.ap1_golomb_par); + TEST_ASSERT_EQUAL(ap1_spillover_par, cfg.ap1_spill); + TEST_ASSERT_EQUAL(ap2_golomb_par, cfg.ap2_golomb_par); + TEST_ASSERT_EQUAL(ap2_spillover_par, cfg.ap2_spill); /* cfg = NULL test */ error = rdcu_cfg_imagette(NULL, golomb_par, spillover_par, + ap1_golomb_par, ap1_spillover_par, ap2_golomb_par, ap2_spillover_par); + TEST_ASSERT_EQUAL(-1, error); +} + + +/** + * @test rdcu_cmp_cfg_is_invalid + */ + +void test_rdcu_cmp_cfg_is_invalid(void) +{ + int error; + struct cmp_cfg cfg; + uint16_t data[1] = {1}; + uint16_t model[1] = {2}; + + /* diff test */ + cfg = rdcu_cfg_create(DATA_TYPE_IMAGETTE, CMP_DEF_IMA_DIFF_CMP_MODE, + CMP_DEF_IMA_DIFF_MODEL_VALUE, CMP_DEF_IMA_DIFF_LOSSY_PAR); + error = rdcu_cfg_buffers(&cfg, data, 1, 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, 1); + TEST_ASSERT_FALSE(error); + error = 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); + TEST_ASSERT_FALSE(error); + error = rdcu_cmp_cfg_is_invalid(&cfg); + TEST_ASSERT_FALSE(error); + + /* model test */ + cfg = rdcu_cfg_create(DATA_TYPE_IMAGETTE, CMP_DEF_IMA_MODEL_CMP_MODE, + CMP_DEF_IMA_MODEL_MODEL_VALUE, CMP_DEF_IMA_MODEL_LOSSY_PAR); + error = rdcu_cfg_buffers(&cfg, data, 1, model, 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, 1); + TEST_ASSERT_FALSE(error); + error = 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); + TEST_ASSERT_FALSE(error); + error = rdcu_cmp_cfg_is_invalid(&cfg); + TEST_ASSERT_FALSE(error); + + /* test warnings */ + cfg = rdcu_cfg_create(DATA_TYPE_IMAGETTE, CMP_DEF_IMA_MODEL_CMP_MODE, + CMP_DEF_IMA_MODEL_MODEL_VALUE, CMP_DEF_IMA_MODEL_LOSSY_PAR); + error = 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, 1); + TEST_ASSERT_FALSE(error); + error = 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); + TEST_ASSERT_FALSE(error); + cfg.icu_new_model_buf = data; + cfg.icu_output_buf = (void *)model; + error = rdcu_cmp_cfg_is_invalid(&cfg); + TEST_ASSERT_FALSE(error); + + /* error: cfg is NULL */ + error = rdcu_cmp_cfg_is_invalid(NULL); + TEST_ASSERT_TRUE(error); + + /* error: buffer length = 0 */ + cfg = rdcu_cfg_create(DATA_TYPE_IMAGETTE, CMP_DEF_IMA_MODEL_CMP_MODE, + CMP_DEF_IMA_MODEL_MODEL_VALUE, CMP_DEF_IMA_MODEL_LOSSY_PAR); + error = rdcu_cfg_buffers(&cfg, data, 1, model, 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); + TEST_ASSERT_FALSE(error); + error = 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); + TEST_ASSERT_FALSE(error); + error = rdcu_cmp_cfg_is_invalid(&cfg); + TEST_ASSERT_TRUE(error); + + /* error: wrong gen par */ + cfg = rdcu_cfg_create(DATA_TYPE_IMAGETTE, CMP_DEF_IMA_DIFF_CMP_MODE, + MAX_MODEL_VALUE+1, CMP_DEF_IMA_DIFF_LOSSY_PAR); + cfg.data_type = DATA_TYPE_IMAGETTE; + error = rdcu_cfg_buffers(&cfg, data, 1, 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, 1); + TEST_ASSERT_FALSE(error); + error = 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); + TEST_ASSERT_FALSE(error); + error = rdcu_cmp_cfg_is_invalid(&cfg); + TEST_ASSERT_TRUE(error); + + /* error: wrong buffers config */ + cfg = rdcu_cfg_create(DATA_TYPE_IMAGETTE, CMP_DEF_IMA_DIFF_CMP_MODE, + CMP_DEF_IMA_DIFF_MODEL_VALUE, CMP_DEF_IMA_DIFF_LOSSY_PAR); + error = rdcu_cfg_buffers(&cfg, data, 1, NULL, RDCU_SRAM_END+4, + CMP_DEF_IMA_DIFF_RDCU_MODEL_ADR, CMP_DEF_IMA_DIFF_RDCU_UP_MODEL_ADR, + CMP_DEF_IMA_DIFF_RDCU_BUFFER_ADR, 1); + TEST_ASSERT_TRUE(error); + error = 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); + TEST_ASSERT_FALSE(error); + error = rdcu_cmp_cfg_is_invalid(&cfg); + TEST_ASSERT_TRUE(error); + + /* error: wrong compression parameter test */ + cfg = rdcu_cfg_create(DATA_TYPE_IMAGETTE, CMP_DEF_IMA_DIFF_CMP_MODE, + CMP_DEF_IMA_DIFF_MODEL_VALUE, CMP_DEF_IMA_DIFF_LOSSY_PAR); + error = rdcu_cfg_buffers(&cfg, data, 1, 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, 1); + TEST_ASSERT_FALSE(error); + error = rdcu_cfg_imagette(&cfg, + MAX_IMA_GOLOMB_PAR+1, 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); + TEST_ASSERT_TRUE(error); + error = rdcu_cmp_cfg_is_invalid(&cfg); + TEST_ASSERT_TRUE(error); +} diff --git a/test/cmp_tool/cmp_tool_lib_test.c b/test/cmp_tool/cmp_tool_lib_test.c deleted file mode 100644 index ebdbaf8cb871fa97086c55d6937fdcbdc9ea4d46..0000000000000000000000000000000000000000 --- a/test/cmp_tool/cmp_tool_lib_test.c +++ /dev/null @@ -1,540 +0,0 @@ -/** - * @file test_cmp_tool_lib.c - * @author Dominik Loidolt (dominik.loidolt@univie.ac.at) - * @date 2020 - * - * @copyright GPLv2 - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * @brief unit tests for cmp_tool_lib.c - */ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> - -#include <CUnit/CUnit.h> -#include <CUnit/TestDB.h> -#include <CUnit/Basic.h> -#include <CUnit/Console.h> - -#include "../../include/cmp_tool_lib.h" -#include "../../include/cmp_guess.h" - -#define PROGRAM_NAME "cmp_tool" - -/* used to redirect stdout to file */ -int fd; - -/* used to redirect stdout to file */ -fpos_t pos; - -/* @brief The init cmp_tool test suite cleanup functionr. Redirect stdout to - * file - * @see: http://c-faq.com/stdio/undofreopen.html - * @returns zero on success, non-zero otherwise. - */ -static int init_cmp_tool(void) -{ - fflush(stderr); - fgetpos(stderr, &pos); - fd = dup(fileno(stderr)); - if (freopen("tmp_stderr.log", "w", stderr) == NULL) { - perror("freopen() failed"); - return -1; - } - - return 0; -} - - -/* @brief The cmp_tool test suite cleanup function. Closes the temporary file - * used by the tests. - * @returns zero on success, non-zero otherwise. - */ -static int clean_cmp_tool(void) -{ - fflush(stderr); - dup2(fd, fileno(stderr)); - close(fd); - clearerr(stderr); - fsetpos(stderr, &pos); /* for C9X */ - - return 0; -} - - -/* returnd memory must be freed after use */ -char *read_std_err_log(void) -{ - char *response = NULL; - size_t len = 0; - FILE *fp = fopen("tmp_stderr.log", "r"); - static int n_lines_read =0; - int i; - - if (!fp) { - puts("File opening failed"); - abort(); - } - - fflush(stderr); - for (i=0; getline(&response, &len, fp) != -1; i++) { - if (i == n_lines_read) { - n_lines_read++; - /* printf("%zu %s\n",len, response); */ - fclose(fp); - return response; - } else { - free(response); - response = NULL; - } - } - free(response); - response = malloc(1); - if (!response) - abort(); - response[0] = '\0'; - - fclose(fp); - return response; -} - - -/* tests */ - -/** - * @test cmp_tool - */ - -void test_read_file8(void) -{ - void *file_name; - uint8_t *buf; - uint32_t n_word; - ssize_t i, size; - uint8_t array[33] = {0}; - char *s; - - /* read in a normal data file */ - memset(array, 0, sizeof(array)); - file_name = "test_read_file8_1.txt"; - buf = array; - n_word = 33; - size = read_file8(file_name, buf, n_word, 0); - CU_ASSERT_EQUAL(size, 33); - /* no output on stderr */ - CU_ASSERT_STRING_EQUAL(s=read_std_err_log(), ""); - free(s); - - /* tests counting the size of a file */ - file_name = "test_read_file8_2.txt"; - buf = NULL; - n_word = 0; - size = read_file8(file_name, buf, n_word, 0); - CU_ASSERT_EQUAL(size, 33); - /* no output on stderr */ - CU_ASSERT_STRING_EQUAL(s=read_std_err_log(), ""); - free(s); - - /* test data read in counting comments */ - file_name = "test_read_file8_2.txt"; - buf = array; - n_word = size; - size = read_file8(file_name, buf, n_word, 0); - CU_ASSERT_EQUAL(size, 33); - for (i = 0; i < size; ++i) { - CU_ASSERT_EQUAL(buf[i], i); - } - /* no output on stderr */ - CU_ASSERT_STRING_EQUAL(s=read_std_err_log(), ""); - free(s); - - /* tests partially read in */ - memset(array, 0, sizeof(array)); - file_name = "test_read_file8_2.txt"; - buf = array; - n_word = 32; - size = read_file8(file_name, buf, n_word, 0); - CU_ASSERT_EQUAL(size, 32); - for (i = 0; i < 33; ++i) { - if (i < 32) { - CU_ASSERT_EQUAL(buf[i], i); - } else { - CU_ASSERT_EQUAL(buf[i], 0); - } - } - CU_ASSERT_STRING_EQUAL(s=read_std_err_log(), "cmp_tool: test_read_file8_2.txt: Warning: The file may contain more data than specified by the samples or cmp_size parameter.\n"); - free(s); - - /* tests read 0 words in */ - memset(array, 0, sizeof(array)); - file_name = "test_read_file8_2.txt"; - buf = array; - n_word = 0; - size = read_file8(file_name, buf, n_word, 0); - CU_ASSERT_EQUAL(size, 0); - for (i = 0; i < 33; ++i) { - CU_ASSERT_EQUAL(buf[i], 0); - } - CU_ASSERT_STRING_EQUAL(s=read_std_err_log(), "cmp_tool: test_read_file8_2.txt: Warning: The file may contain more data than specified by the samples or cmp_size parameter.\n"); - free(s); - - /* TODO; tests read in 0 empty file */ - - /* Error cases */ - /***************/ - - /* file does not contain enough data */ - memset(array, 0xFF, sizeof(array)); - file_name = "test_read_file8_2.txt"; - buf = array; - n_word = 34; - size = read_file8(file_name, buf, n_word, 0); - CU_ASSERT_EQUAL(size, -1); - CU_ASSERT_STRING_EQUAL(s=read_std_err_log(), "cmp_tool: test_read_file8_2.txt: Error: The files do not contain enough data as requested.\n"); - free(s); - memset(array, 0xFF, sizeof(array)); - - /* no file_name */ - file_name = NULL; - buf = array; - n_word = 33; - size = read_file8(file_name, buf, n_word, 0); - CU_ASSERT_EQUAL(size, -1); - /* no output on stderr */ - CU_ASSERT_STRING_EQUAL(s=read_std_err_log(), ""); - free(s); - - /* wrong file_name */ - file_name = "file_not_exist.txt"; - buf = array; - n_word = 33; - size = read_file8(file_name, buf, n_word, 0); - CU_ASSERT_EQUAL(size, -1); - CU_ASSERT_STRING_EQUAL(s=read_std_err_log(), "cmp_tool: file_not_exist.txt: No such file or directory\n"); - free(s); - - /* wrong data format part 1/2 */ - file_name = "test_read_file8_3.txt"; - buf = array; - n_word = 33; - size = read_file8(file_name, buf, n_word, 0); - CU_ASSERT_EQUAL(size, -1); - CU_ASSERT_STRING_EQUAL(s=read_std_err_log(), "cmp_tool: test_read_file8_3.txt: Error: The data are not correct formatted. Expected format is like: 12 AB 23 CD .. ..\n"); - free(s); - - /* wrong data format part 2/2 */ - file_name = "test_read_file8_4.txt"; - buf = array; - n_word = 33; - size = read_file8(file_name, buf, n_word, 0); - CU_ASSERT_EQUAL(size, -1); - CU_ASSERT_STRING_EQUAL(s=read_std_err_log(), "cmp_tool: test_read_file8_4.txt: Error: The data are not correct formatted. Expected format is like: 12 AB 23 CD .. ..\n"); - free(s); - - /* file error */ - /* TODO: how to trigger a file error indicator error */ - if (1) { - /* static char fname[] = "test_read_file8_5.txt"; */ - /* FILE *f = fopen(fname, "wb"); */ - /* fputs("\xff\xff\n", f); // not a valid UTF-8 character sequence */ - /* fclose(f); */ - buf = array; - n_word = 33; - size = read_file8("test_read_file8_5.txt", buf, n_word, 0); - CU_ASSERT_EQUAL(size, -1); - CU_ASSERT_STRING_EQUAL(s=read_std_err_log(), "cmp_tool: test_read_file8_5.txt: Error: File error indicator set.\n"); - free(s); - } -} - - -#define CMP_TEST_SAMPLES 5 -void test_cmp_guess(void) -{ - struct cmp_cfg cfg = {0}; - uint16_t data[CMP_TEST_SAMPLES] = {2,4,6,8,10}; - uint16_t data_exp[CMP_TEST_SAMPLES] = {2,4,6,8,10}; - uint16_t model[CMP_TEST_SAMPLES] = {4,6,8,10,12}; - uint16_t model_exp[CMP_TEST_SAMPLES] = {4,6,8,10,12}; - uint32_t cmp_size; - int level; - - - /* test 1d-diff mode */ - cfg.input_buf = data; - cfg.model_buf = NULL; - cfg.samples = CMP_TEST_SAMPLES; - cfg.cmp_mode = MODE_DIFF_MULTI; - level = 2; - cmp_size = cmp_guess(&cfg, level); - CU_ASSERT_TRUE(cmp_size); - - CU_ASSERT_EQUAL(cmp_size, 25); - CU_ASSERT_EQUAL(cfg.cmp_mode, MODE_DIFF_MULTI); - CU_ASSERT_EQUAL(cfg.golomb_par, 1); - CU_ASSERT_EQUAL(cfg.spill, 2); - /* CU_ASSERT_EQUAL(cfg.model_value, ); model_value is not needed */ - CU_ASSERT_EQUAL(cfg.round, 0); - CU_ASSERT_EQUAL(cfg.ap1_golomb_par, 2); - CU_ASSERT_EQUAL(cfg.ap1_spill, 2); - CU_ASSERT_EQUAL(cfg.ap2_golomb_par, 3); - CU_ASSERT_EQUAL(cfg.ap2_spill, 2); - CU_ASSERT_NSTRING_EQUAL(cfg.input_buf, data_exp, CMP_TEST_SAMPLES); - /* CU_ASSERT_NSTRING_EQUAL(cfg.model_buf, model_exp, CMP_TEST_SAMPLES); model is - * not used*/ - CU_ASSERT_EQUAL(cfg.samples, CMP_TEST_SAMPLES); - CU_ASSERT_EQUAL(cfg.buffer_length, 2); - - - /* test model mode */ - memset(&cfg, 0, sizeof(struct cmp_cfg)); - cfg.input_buf = data; - cfg.model_buf = model; - cfg.samples = CMP_TEST_SAMPLES; - cfg.cmp_mode = MODE_MODEL_ZERO; - level =3; - - cmp_guess_set_model_updates(12); - cmp_size = cmp_guess(&cfg, level); - CU_ASSERT_TRUE(cmp_size); - - CU_ASSERT_EQUAL(cmp_size, 20); - CU_ASSERT_EQUAL(cfg.cmp_mode, 1); - CU_ASSERT_EQUAL(cfg.golomb_par, 2); - CU_ASSERT_EQUAL(cfg.spill, 22); - CU_ASSERT_EQUAL(cfg.model_value, 12); - CU_ASSERT_EQUAL(cfg.round, 0); - CU_ASSERT_EQUAL(cfg.ap1_golomb_par, 1); - CU_ASSERT_EQUAL(cfg.ap1_spill, 8); - CU_ASSERT_EQUAL(cfg.ap2_golomb_par, 3); - CU_ASSERT_EQUAL(cfg.ap2_spill, 35); - CU_ASSERT_NSTRING_EQUAL(cfg.input_buf, data_exp, CMP_TEST_SAMPLES); - CU_ASSERT_NSTRING_EQUAL(cfg.model_buf, model_exp, CMP_TEST_SAMPLES); - CU_ASSERT_EQUAL(cfg.samples, CMP_TEST_SAMPLES); - CU_ASSERT_EQUAL(cfg.buffer_length, 2); - - - /* test diff mode without model buffer*/ - cmp_guess_set_model_updates(CMP_GUESS_N_MODEL_UPDATE_DEF); - memset(&cfg, 0, sizeof(struct cmp_cfg)); - cfg.input_buf = data; - cfg.model_buf = model; - cfg.samples = CMP_TEST_SAMPLES; - cfg.cmp_mode = MODE_DIFF_MULTI; - level = 3; - - cmp_size = cmp_guess(&cfg, level); - CU_ASSERT_TRUE(cmp_size); - - CU_ASSERT_EQUAL(cmp_size, 20); - CU_ASSERT_EQUAL(cfg.cmp_mode, MODE_DIFF_MULTI); - CU_ASSERT_EQUAL(cfg.golomb_par, 2); - CU_ASSERT_EQUAL(cfg.spill, 5); - CU_ASSERT_EQUAL(cfg.model_value, 11); - CU_ASSERT_EQUAL(cfg.round, 0); - CU_ASSERT_EQUAL(cfg.ap1_golomb_par, 1); - CU_ASSERT_EQUAL(cfg.ap1_spill, 2); - CU_ASSERT_EQUAL(cfg.ap2_golomb_par, 3); - CU_ASSERT_EQUAL(cfg.ap2_spill, 2); - CU_ASSERT_NSTRING_EQUAL(cfg.input_buf, data_exp, CMP_TEST_SAMPLES); - CU_ASSERT_NSTRING_EQUAL(cfg.model_buf, model_exp, CMP_TEST_SAMPLES); - CU_ASSERT_EQUAL(cfg.samples, CMP_TEST_SAMPLES); - CU_ASSERT_EQUAL(cfg.buffer_length, 2); - - - /* error test cfg = NULL */ - level = 2; - cmp_size = cmp_guess(NULL, level); - CU_ASSERT_FALSE(cmp_size); - - - /* error test unknown guess_level */ - level = 4; - cmp_size = cmp_guess(&cfg, level); - CU_ASSERT_FALSE(cmp_size); - - - /* error test model mode without model buffer*/ - memset(&cfg, 0, sizeof(struct cmp_cfg)); - cfg.input_buf = NULL; - cfg.model_buf = NULL; - cfg.samples = CMP_TEST_SAMPLES; - cfg.cmp_mode = MODE_DIFF_MULTI; - level = 2; - - cmp_size = cmp_guess(&cfg, level); - CU_ASSERT_FALSE(cmp_size); - - - /* error test model mode without model buffer*/ - memset(&cfg, 0, sizeof(struct cmp_cfg)); - cfg.input_buf = data; - cfg.model_buf = NULL; - cfg.samples = CMP_TEST_SAMPLES; - cfg.cmp_mode = MODE_MODEL_MULTI; - level = 2; - - cmp_size = cmp_guess(&cfg, level); - CU_ASSERT_FALSE(cmp_size); - - - /* error test not supported cmp_mode */ - memset(&cfg, 0, sizeof(struct cmp_cfg)); - cfg.input_buf = data; - cfg.model_buf = model; - cfg.samples = CMP_TEST_SAMPLES; - cfg.cmp_mode = 5; - level = 2; - - cmp_size = cmp_guess(&cfg, level); - CU_ASSERT_FALSE(cmp_size); - - - /* error test samples = 0 */ - memset(&cfg, 0, sizeof(struct cmp_cfg)); - cfg.input_buf = data; - cfg.model_buf = model; - cfg.samples = 0; - cfg.cmp_mode = MODE_MODEL_MULTI; - level = 2; - - cmp_size = cmp_guess(&cfg, level); - CU_ASSERT_FALSE(cmp_size); -} - -void test_cmp_guess_model_value(void) -{ - uint16_t model_value; - - model_value = cmp_guess_model_value(0); - CU_ASSERT_EQUAL(model_value, 8); - model_value = cmp_guess_model_value(1); - CU_ASSERT_EQUAL(model_value, 8); - model_value = cmp_guess_model_value(2); - CU_ASSERT_EQUAL(model_value, 8); - model_value = cmp_guess_model_value(3); - CU_ASSERT_EQUAL(model_value, 10); - model_value = cmp_guess_model_value(4); - CU_ASSERT_EQUAL(model_value, 10); - model_value = cmp_guess_model_value(5); - CU_ASSERT_EQUAL(model_value, 10); - model_value = cmp_guess_model_value(6); - CU_ASSERT_EQUAL(model_value, 11); - model_value = cmp_guess_model_value(10); - CU_ASSERT_EQUAL(model_value, 11); - model_value = cmp_guess_model_value(11); - CU_ASSERT_EQUAL(model_value, 11); - model_value = cmp_guess_model_value(12); - CU_ASSERT_EQUAL(model_value, 12); - model_value = cmp_guess_model_value(20); - CU_ASSERT_EQUAL(model_value, 12); - model_value = cmp_guess_model_value(21); - CU_ASSERT_EQUAL(model_value, 12); - model_value = cmp_guess_model_value(22); - CU_ASSERT_EQUAL(model_value, 13); -} - - -void test_cmp_mode_parse(void) -{ - uint32_t cmp_mode = ~0; - int err; - - /* error cases */ - err = cmp_mode_parse(NULL, NULL); - CU_ASSERT_TRUE(err); - - err = cmp_mode_parse(NULL, &cmp_mode); - CU_ASSERT_TRUE(err); - - err = cmp_mode_parse("MODE_RAW", NULL); - CU_ASSERT_TRUE(err); - - err = cmp_mode_parse("UNKNOWN", &cmp_mode); - CU_ASSERT_TRUE(err); - - err = cmp_mode_parse("9999999999999999999", &cmp_mode); - CU_ASSERT_TRUE(err); - - /* mode not defined*/ - err = cmp_mode_parse("424212", &cmp_mode); - CU_ASSERT_TRUE(err); - - /* normal operation */ - err = cmp_mode_parse("MODE_RAW", &cmp_mode); - CU_ASSERT_FALSE(err); - CU_ASSERT_EQUAL(cmp_mode, MODE_RAW); - - err = cmp_mode_parse("0", &cmp_mode); - CU_ASSERT_FALSE(err); - CU_ASSERT_EQUAL(cmp_mode, MODE_RAW); - - err = cmp_mode_parse("0 \n", &cmp_mode); - CU_ASSERT_FALSE(err); - CU_ASSERT_EQUAL(cmp_mode, MODE_RAW); - - err = cmp_mode_parse(" 2 ", &cmp_mode); - CU_ASSERT_FALSE(err); - CU_ASSERT_EQUAL(cmp_mode, 2); - - err = cmp_mode_parse("MODE_DIFF_MULTI", &cmp_mode); - CU_ASSERT_FALSE(err); - CU_ASSERT_EQUAL(cmp_mode, MODE_DIFF_MULTI); -} - -CU_ErrorCode cmp_tool_add_tests(CU_pSuite suite) -{ - CU_pTest __attribute__((unused)) test; - - /* add a suite to the registry */ - suite = CU_add_suite("cmp_tool", init_cmp_tool, clean_cmp_tool); - if (suite == NULL) { - CU_cleanup_registry(); - return CU_get_error(); - } - - /* add the tests to the suite */ - if ((NULL == CU_add_test(suite, "test of read_file8()", test_read_file8)) || - (NULL == CU_add_test(suite, "test of cmp_mode_parse()", test_cmp_mode_parse))|| - (NULL == CU_add_test(suite, "test of cmp_guess_model_value()", test_cmp_guess_model_value))|| - (NULL == CU_add_test(suite, "test of cmp_guess()", test_cmp_guess))) { - CU_cleanup_registry(); - return CU_get_error(); - } - - return CUE_SUCCESS; -} - - -#if (__MAIN__) -int main(void) -{ - CU_pSuite suite = NULL; - - /* initialize the CUnit test registry */ - if (CU_initialize_registry() != CUE_SUCCESS) - return CU_get_error(); - - cmp_tool_add_tests(suite); - - CU_basic_set_mode(CU_BRM_VERBOSE); - CU_basic_run_tests(); - - printf("\n\n\n"); - - CU_basic_show_failures(CU_get_failure_list()); - - CU_cleanup_registry(); - - return CU_get_error(); -} -#endif diff --git a/test/meson.build b/test/meson.build index 36fee6ce08454a4e3db2b9cf0092bbdb9274a460..b6139e5bb3e34a72038783bab4a6c1073cbee79c 100644 --- a/test/meson.build +++ b/test/meson.build @@ -37,5 +37,7 @@ subdir('cmp_tool') unity_dep = dependency('unity', fallback : ['unity', 'unity_dep']) subdir('cmp_icu') +subdir('cmp_decmp') subdir('cmp_data_types') subdir('cmp_entity') +subdir('cmp_rdcu_cfg')