annotate pcmu2efr/gen160.c @ 32:baf74dff5368

dhf: generate hex forms of EFR DHF
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 13 May 2024 06:26:22 +0000
parents f4420403219a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * The code in this module generates 160 versions of linearized seqsyncu,
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * shifted by one sample each, intended for feeding to EFR and AMR encoders.
22
f4420403219a pcmu2efr: change linear input gen to support 2nd frame
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
4 *
f4420403219a pcmu2efr: change linear input gen to support 2nd frame
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
5 * Update: the new version generates a linear array of 480 16-bit PCM samples,
f4420403219a pcmu2efr: change linear input gen to support 2nd frame
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
6 * where the first 160 are 0x0008, followed by two copies of linearized
f4420403219a pcmu2efr: change linear input gen to support 2nd frame
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
7 * seqsyncu.
15
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 */
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 #include <stdint.h>
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 extern const uint8_t seqsyncu_last_frame[160];
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 extern const uint16_t pcmu_decode_table[256];
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14
22
f4420403219a pcmu2efr: change linear input gen to support 2nd frame
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
15 uint16_t linear_input_array[480];
15
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 void
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 generate_linear_inputs(void)
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 {
22
f4420403219a pcmu2efr: change linear input gen to support 2nd frame
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
20 unsigned n;
f4420403219a pcmu2efr: change linear input gen to support 2nd frame
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
21 uint16_t lin;
15
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22
22
f4420403219a pcmu2efr: change linear input gen to support 2nd frame
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
23 for (n = 0; n < 160; n++) {
f4420403219a pcmu2efr: change linear input gen to support 2nd frame
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
24 lin = pcmu_decode_table[seqsyncu_last_frame[n]];
f4420403219a pcmu2efr: change linear input gen to support 2nd frame
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
25 linear_input_array[n] = 0x0008;
f4420403219a pcmu2efr: change linear input gen to support 2nd frame
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
26 linear_input_array[160+n] = lin;
f4420403219a pcmu2efr: change linear input gen to support 2nd frame
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
27 linear_input_array[320+n] = lin;
f4420403219a pcmu2efr: change linear input gen to support 2nd frame
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
28 }
15
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 }