comparison pcma2efr/gen-efr.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/gen-efr.c@f4420403219a
children
comparison
equal deleted inserted replaced
27:2095f3c23dad 28:4f47447fd17f
1 /*
2 * The code in this module takes linear_input_array[] 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_input_array[480];
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_input_array+160-m,
29 standard_efr[m], (int *) 0, (int *) 0);
30 }
31 free(st);
32 }