comparison pcma2efr/gen160.c @ 28:4f47447fd17f

pcma2efr: starting with DHF check
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 13 May 2024 02:45:17 +0000
parents pcmu2efr/gen160.c@f4420403219a
children
comparison
equal deleted inserted replaced
27:2095f3c23dad 28:4f47447fd17f
1 /*
2 * The code in this module generates 160 versions of linearized seqsynca,
3 * shifted by one sample each, intended for feeding to EFR and AMR encoders.
4 *
5 * Update: the new version generates a linear array of 480 16-bit PCM samples,
6 * where the first 160 are 0x0008, followed by two copies of linearized
7 * seqsynca.
8 */
9
10 #include <stdint.h>
11
12 extern const uint8_t seqsynca_last_frame[160];
13 extern const uint16_t pcma_decode_table[256];
14
15 uint16_t linear_input_array[480];
16
17 void
18 generate_linear_inputs(void)
19 {
20 unsigned n;
21 uint16_t lin;
22
23 for (n = 0; n < 160; n++) {
24 lin = pcma_decode_table[seqsynca_last_frame[n]];
25 linear_input_array[n] = 0x0008;
26 linear_input_array[160+n] = lin;
27 linear_input_array[320+n] = lin;
28 }
29 }