diff options
| author | Joshua Bakita <bakitajoshua@gmail.com> | 2019-10-07 19:13:39 -0400 |
|---|---|---|
| committer | Joshua Bakita <bakitajoshua@gmail.com> | 2019-10-07 19:13:39 -0400 |
| commit | 386b7d3366f1359a265da207a9cafa3edf553b64 (patch) | |
| tree | c76120c2c138faed822e4ae386be6ef22a738a78 /baseline/source/gsm_dec | |
| parent | 54a3f7091a2146b29c73a6fdc4b62a5c4ad7a3d8 (diff) | |
Reorganize and commit all the modified TACLeBench code and run scripts
Diffstat (limited to 'baseline/source/gsm_dec')
| -rw-r--r-- | baseline/source/gsm_dec/COPYRIGHT | 16 | ||||
| -rw-r--r-- | baseline/source/gsm_dec/ChangeLog.txt | 87 | ||||
| -rw-r--r-- | baseline/source/gsm_dec/add.h | 55 | ||||
| -rw-r--r-- | baseline/source/gsm_dec/data.h | 865 | ||||
| -rw-r--r-- | baseline/source/gsm_dec/gsm.h | 14 | ||||
| -rw-r--r-- | baseline/source/gsm_dec/gsm_dec.c | 764 | ||||
| -rw-r--r-- | baseline/source/gsm_dec/private.h | 44 |
7 files changed, 1845 insertions, 0 deletions
diff --git a/baseline/source/gsm_dec/COPYRIGHT b/baseline/source/gsm_dec/COPYRIGHT new file mode 100644 index 0000000..eba0e52 --- /dev/null +++ b/baseline/source/gsm_dec/COPYRIGHT | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann, | ||
| 2 | Technische Universitaet Berlin | ||
| 3 | |||
| 4 | Any use of this software is permitted provided that this notice is not | ||
| 5 | removed and that neither the authors nor the Technische Universitaet Berlin | ||
| 6 | are deemed to have made any representations as to the suitability of this | ||
| 7 | software for any purpose nor are held responsible for any defects of | ||
| 8 | this software. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. | ||
| 9 | |||
| 10 | As a matter of courtesy, the authors request to be informed about uses | ||
| 11 | this software has found, about bugs in this software, and about any | ||
| 12 | improvements that may be of general interest. | ||
| 13 | |||
| 14 | Berlin, 28.11.1994 | ||
| 15 | Jutta Degener | ||
| 16 | Carsten Bormann | ||
diff --git a/baseline/source/gsm_dec/ChangeLog.txt b/baseline/source/gsm_dec/ChangeLog.txt new file mode 100644 index 0000000..3d03d86 --- /dev/null +++ b/baseline/source/gsm_dec/ChangeLog.txt | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | File: gsm_dec.c | ||
| 2 | Original provenience: Jutta Degener and Carsten Bormann, | ||
| 3 | Technische Universitaet Berlin | ||
| 4 | |||
| 5 | 2017-04-18: | ||
| 6 | - Annotated gsm_dec_main as entry-point for timing analysis | ||
| 7 | |||
| 8 | 2016-03-07: | ||
| 9 | - Add generic TACLeBench header | ||
| 10 | - Split code into gsm.h, data.h, config.h, private.h, proto.h | ||
| 11 | - Remove code undefined through macros and unnecessay include guards | ||
| 12 | - Rename function 'decode' to 'gsm_decode_main' | ||
| 13 | - Add functions 'gsm_decode_init', 'gsm_decode_return' | ||
| 14 | - Remove line: /* lpc.c */ | ||
| 15 | - Remove line: #undef P | ||
| 16 | 2016-04-27: | ||
| 17 | - Rename benchmark to from 'gsm_decode' to 'gsm_dec' | ||
| 18 | - Remove unused content of proto.h and config.h | ||
| 19 | - Remove usages of prototype macros 'P' and 'GSM_P' and checks if standard | ||
| 20 | prototypes are availables: use standard prototypes | ||
| 21 | - Remove functions only defined for debugging purpose | ||
| 22 | - Remove block around "#ifndef GSM_TABLE_C", since 'GSM_TABLE_C' is defined, | ||
| 23 | remove define of 'GSM_TABLE_C' | ||
| 24 | - Define 'SASR' macro once, remove blocks if 'SASR' is not defined | ||
| 25 | - Remove variables 'f_fast' and 'f_verbose' (both set to 0). Consequently, | ||
| 26 | remove unused 'function gsm_option' and the defines 'GSM_OPT_VERBOSE' and | ||
| 27 | 'GSM_OPT_FAST' only used inside 'gsm_option' | ||
| 28 | - Remove unused variables 'verbose' and 'fast' from 'struct gsm_state' | ||
| 29 | - Remove unused function declarations 'gsm_explode' and 'gsm_implode' | ||
| 30 | - Remove unused defines 'GSM_PATCHLEVEL', 'GSM_MINOR', and 'GSM_MAJOR' | ||
| 31 | - Remove irrelevant comment "// OK" in line calling function 'create' | ||
| 32 | - Remove unused variable 'd' of type 'word*' from 'gsm_dec_main' | ||
| 33 | - Remove unused parameter 'struct gsm_state * S' of function 'Gsm_RPE_Decoding' | ||
| 34 | - Remove block in function 'Gsm_Short_Term_Synthesis_Filter' that is compiled | ||
| 35 | when 'FAST' macro is defined (per default not activated) | ||
| 36 | - Replace macro 'FILTER' by its expanded value 'Short_term_synthesis_filtering' | ||
| 37 | in function 'Gsm_Short_Term_Synthesis_Filter' | ||
| 38 | - Remove unused 'int j' in function 'Short_term_synthesis_filtering' | ||
| 39 | - Make iteration variable 'i' in function 'create' type 'unsigned int' to avoid | ||
| 40 | compiler warnings | ||
| 41 | - Use rewritten Duff's device for WCET analysis, remove commented original | ||
| 42 | varinat, keep comment in code marking this change | ||
| 43 | - Remove unused variable 'temp_sat' of type 'longword' in function | ||
| 44 | 'APCM_inverse_quantization' | ||
| 45 | - Remove unused parameter 'S' of type 'struct gsm_state*' in function | ||
| 46 | 'Gsm_RPE_Decoding' and the respective calls of this function | ||
| 47 | - Remove unused function | ||
| 48 | 'Gsm_Update_of_reconstructed_short_time_residual_signal' | ||
| 49 | - Remove code block activatable by defining 'USE_TABLE_MUL', since macro never | ||
| 50 | defined | ||
| 51 | - Rename global variable 'gsmstate' to 'gsm_dec_state' | ||
| 52 | - Remove lines with #undef GSM_P | ||
| 53 | - Update function 'create': add void parameter to defintion | ||
| 54 | - Introduce 'gsm_dec_state_ptr' that points to 'gsm_dec_state', which is | ||
| 55 | initialized in function 'create'. This is required to maintain the void-void | ||
| 56 | signature for 'gsm_dec_init' and 'gsm_dec_main'. | ||
| 57 | - Remove unused commented version of 'GSM_MULT_R' | ||
| 58 | - Move macros 'GSM_MULT|ADD|SUB' into separate header | ||
| 59 | - Give include guards unique names: prefix with 'GSM_DEC_' | ||
| 60 | - Remove unused functions 'gsm_div', 'gsm_add', 'gsm_mult', 'gsm_mult_r', | ||
| 61 | 'gsm_abs', 'gsm_L_mult', 'gsm_L_add', 'gsm_L_sub', 'gsm_norm' (and array | ||
| 62 | 'bitoff' used in this function), 'gsm_L_asl', 'gsm_L_asr' | ||
| 63 | - Rename 'Gsm_Short_Term_Synthesis_Filter' to | ||
| 64 | 'gsm_dec_Short_Term_Synthesis_Filter' | ||
| 65 | - Rename 'Gsm_RPE_Decoding' to 'gsm_dec_RPE_Decoding' | ||
| 66 | - Rename 'Gsm_Long_Term_Synthesis_Filtering' to | ||
| 67 | 'gsm_dec_Long_Term_Synthesis_Filtering' | ||
| 68 | - Rename 'Gsm_Decoder' to 'gsm_dec_Decoder' | ||
| 69 | - Remove unused function declaration of 'decode' | ||
| 70 | - Prefix all global symbols with benchmark name | ||
| 71 | - Store return value of in introduced variable 'gsm_dec_result', which is | ||
| 72 | volatile to avoid optimizations on this variable | ||
| 73 | - Avoid constant propagation through addition with volatile variable on each | ||
| 74 | element of the 'gsm_dec_state' structure | ||
| 75 | 2016-05-10: | ||
| 76 | - Change coefficients for variable 'B' of 'STEP' macro in function | ||
| 77 | 'gsm_dec_Decoding_of_the_coded_Log_Area_Ratios' from negative to positive, | ||
| 78 | since bit shifts of signed values are undefined | ||
| 79 | - Fix comment why variable 'long ltmp' ist required in function | ||
| 80 | 'gsm_dec_Decoding_of_the_coded_Log_Area_Ratios' | ||
| 81 | - Apply code formatting with with astyle | ||
| 82 | - Manual text formattings: removal of empty lines in function prototypes, | ||
| 83 | - Indent all multi-line block comments by two spaces | ||
| 84 | 2016-05-10: | ||
| 85 | - Remove 'static' declaration of global variables and functions | ||
| 86 | - Remove unused global variables 'gsm_DLB', 'gsm_INVA', 'gsm_MAC', 'gsm_MIC', | ||
| 87 | 'gsm_A', 'gsm_B', 'gsm_H' | ||
diff --git a/baseline/source/gsm_dec/add.h b/baseline/source/gsm_dec/add.h new file mode 100644 index 0000000..ffe79b7 --- /dev/null +++ b/baseline/source/gsm_dec/add.h | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | #ifndef GSM_DEC_ADD_H | ||
| 2 | #define GSM_DEC_ADD_H | ||
| 3 | |||
| 4 | #define GSM_MULT_R(a, b) /* word a, word b, !(a == b == MIN_WORD) */ \ | ||
| 5 | (SASR( ((longword)(a) * (longword)(b) + 16384), 15 )) | ||
| 6 | |||
| 7 | # define GSM_MULT(a,b) /* word a, word b, !(a == b == MIN_WORD) */ \ | ||
| 8 | (SASR( ((longword)(a) * (longword)(b)), 15 )) | ||
| 9 | |||
| 10 | # define GSM_L_MULT(a, b) /* word a, word b */ \ | ||
| 11 | (((longword)(a) * (longword)(b)) << 1) | ||
| 12 | |||
| 13 | # define GSM_L_ADD(a, b) \ | ||
| 14 | ( (a) < 0 ? ( (b) >= 0 ? (a) + (b) \ | ||
| 15 | : (utmp = (ulongword)-((a) + 1) + (ulongword)-((b) + 1)) \ | ||
| 16 | >= MAX_LONGWORD ? MIN_LONGWORD : -(longword)utmp-2 ) \ | ||
| 17 | : ((b) <= 0 ? (a) + (b) \ | ||
| 18 | : (utmp = (ulongword)(a) + (ulongword)(b)) >= MAX_LONGWORD \ | ||
| 19 | ? MAX_LONGWORD : utmp)) | ||
| 20 | |||
| 21 | /* | ||
| 22 | # define GSM_ADD(a, b) \ | ||
| 23 | ((ltmp = (longword)(a) + (longword)(b)) >= MAX_WORD \ | ||
| 24 | ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp) | ||
| 25 | */ | ||
| 26 | /* Nonportable, but faster: */ | ||
| 27 | |||
| 28 | #define GSM_ADD(a, b) \ | ||
| 29 | ((ulongword)((ltmp = (longword)(a) + (longword)(b)) - MIN_WORD) > \ | ||
| 30 | MAX_WORD - MIN_WORD ? (ltmp > 0 ? MAX_WORD : MIN_WORD) : ltmp) | ||
| 31 | |||
| 32 | # define GSM_SUB(a, b) \ | ||
| 33 | ((ltmp = (longword)(a) - (longword)(b)) >= MAX_WORD \ | ||
| 34 | ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp) | ||
| 35 | |||
| 36 | # define GSM_ABS(a) ((a) < 0 ? ((a) == MIN_WORD ? MAX_WORD : -(a)) : (a)) | ||
| 37 | |||
| 38 | #define saturate(x) \ | ||
| 39 | ((x) < MIN_WORD ? MIN_WORD : (x) > MAX_WORD ? MAX_WORD: (x)) | ||
| 40 | |||
| 41 | /* Use these if necessary: | ||
| 42 | |||
| 43 | # define GSM_MULT_R(a, b) gsm_mult_r(a, b) | ||
| 44 | # define GSM_MULT(a, b) gsm_mult(a, b) | ||
| 45 | # define GSM_L_MULT(a, b) gsm_L_mult(a, b) | ||
| 46 | |||
| 47 | # define GSM_L_ADD(a, b) gsm_L_add(a, b) | ||
| 48 | # define GSM_ADD(a, b) gsm_add(a, b) | ||
| 49 | # define GSM_SUB(a, b) gsm_sub(a, b) | ||
| 50 | |||
| 51 | # define GSM_ABS(a) gsm_abs(a) | ||
| 52 | |||
| 53 | */ | ||
| 54 | |||
| 55 | #endif /* GSM_DEC_ADD_H */ | ||
diff --git a/baseline/source/gsm_dec/data.h b/baseline/source/gsm_dec/data.h new file mode 100644 index 0000000..81bf20d --- /dev/null +++ b/baseline/source/gsm_dec/data.h | |||
| @@ -0,0 +1,865 @@ | |||
| 1 | #ifndef GSM_DEC_DATA_H | ||
| 2 | #define GSM_DEC_DATA_H | ||
| 3 | |||
| 4 | gsm_signal gsm_dec_pcmdata[] = { | ||
| 5 | ( short )0x0000, ( short )0x0000, ( short )0x0010, ( short )0x0010, | ||
| 6 | ( short )0x0010, ( short )0x0020, ( short )0x0020, ( short )0x0018, | ||
| 7 | ( short )0x0028, ( short )0x0020, ( short )0x0020, ( short )0x0028, | ||
| 8 | ( short )0x0028, ( short )0x0020, ( short )0x0030, ( short )0x0030, | ||
| 9 | ( short )0x0028, ( short )0x0010, ( short )0x0008, ( short )0x0000, | ||
| 10 | ( short )0x0050, ( short )0x0060, ( short )0x0058, ( short )0x00D0, | ||
| 11 | ( short )0x00E0, ( short )0x00D0, ( short )0x0118, ( short )0x0128, | ||
| 12 | ( short )0x0118, ( short )0x0128, ( short )0x0110, ( short )0x0100, | ||
| 13 | ( short )0x00A0, ( short )0x0058, ( short )0x0048, ( short )0x0058, | ||
| 14 | ( short )0x0060, ( short )0x0058, ( short )0x0050, ( short )0x0048, | ||
| 15 | ( short )0x0040, ( short )0x0030, ( short )0x0020, ( short )0x0010, | ||
| 16 | ( short )0x0008, ( short )0xFFF8, ( short )0xFFE8, ( short )0xFFE0, | ||
| 17 | ( short )0xFFD8, ( short )0xFFC8, ( short )0xFFC0, ( short )0xFFC0, | ||
