FreeCalypso > hg > vband-misc
view pcmu2efr/gen160.c @ 16:17d8ff0944a8
top Makefile: add pcmu2efr
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 16 Apr 2024 23:31:32 +0000 |
parents | 528eef871e23 |
children | f4420403219a |
line wrap: on
line source
/* * The code in this module generates 160 versions of linearized seqsyncu, * shifted by one sample each, intended for feeding to EFR and AMR encoders. */ #include <stdint.h> extern const uint8_t seqsyncu_last_frame[160]; extern const uint16_t pcmu_decode_table[256]; uint16_t linear_inputs[160][160]; static void gen_first_seq(void) { unsigned n; for (n = 0; n < 160; n++) linear_inputs[0][n] = pcmu_decode_table[seqsyncu_last_frame[n]]; } static void gen_sequence_m(unsigned m) { unsigned n, s; for (n = 0; n < m; n++) linear_inputs[m][n] = 0x0008; for (s = 0; n < 160; n++, s++) linear_inputs[m][n] = linear_inputs[0][s]; } void generate_linear_inputs(void) { unsigned m; gen_first_seq(); for (m = 1; m < 160; m++) gen_sequence_m(m); }