FreeCalypso > hg > gsm-codec-lib
diff libgsmefr/enc_wrap.c @ 113:269d341db403
libgsmefr: implement main encoder wrapper
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 29 Nov 2022 07:30:39 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgsmefr/enc_wrap.c Tue Nov 29 07:30:39 2022 +0000 @@ -0,0 +1,20 @@ +/* + * This module contains our EFR_encode_frame() function, which is the primary + * (most common, most useful) interface to our EFR encoder. + */ + +#include "gsm_efr.h" + +void EFR_encode_frame(struct EFR_encoder_state *st, const int16_t *pcm_in, + uint8_t *frame, int *sp_out, int *vad_out) +{ + int16_t params[EFR_NUM_PARAMS]; + int sp; + + EFR_encode_params(st, pcm_in, params, &sp, vad_out); + EFR_params2frame(params, frame); + if (!sp) + EFR_insert_sid_codeword(frame); + if (sp_out) + *sp_out = sp; +}