FreeCalypso > hg > vband-misc
comparison pcmu2efr/gen-efr.c @ 15:528eef871e23
pcmu2efr project started
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 16 Apr 2024 23:30:49 +0000 |
parents | |
children | f4420403219a |
comparison
equal
deleted
inserted
replaced
14:ec642bde2349 | 15:528eef871e23 |
---|---|
1 /* | |
2 * The code in this module takes linear_inputs[][] from gen160.c | |
3 * and generates standard EFR-encoded frames. | |
4 */ | |
5 | |
6 #include <stdio.h> | |
7 #include <stdint.h> | |
8 #include <stdlib.h> | |
9 #include <gsm_efr.h> | |
10 | |
11 extern uint16_t linear_inputs[160][160]; | |
12 | |
13 uint8_t standard_efr[160][31]; | |
14 | |
15 void | |
16 generate_std_efr(void) | |
17 { | |
18 struct EFR_encoder_state *st; | |
19 unsigned m; | |
20 | |
21 st = EFR_encoder_create(0); | |
22 if (!st) { | |
23 fprintf(stderr, "error: EFR_encoder_create() failed\n"); | |
24 exit(1); | |
25 } | |
26 for (m = 0; m < 160; m++) { | |
27 EFR_encoder_reset(st, 0); | |
28 EFR_encode_frame(st, (const int16_t *) linear_inputs[m], | |
29 standard_efr[m], (int *) 0, (int *) 0); | |
30 } | |
31 free(st); | |
32 } |