FreeCalypso > hg > gsm-codec-lib
view libgsmefr/gsm_efr.h @ 128:a5ffec18e4cd
test programs: use printf %d format for codec parameters
Even though all codec params (both FR and EFR) are small unsigned integers,
we use signed int16_t data type for both, for interface reasons: in the
case of FR it's the gsm_signal type of libgsm, and in the case of EFR
it's the Word16 type of ETSI codec guts. Therefore, the correct printf
format is %d, not %u, when the objective is to see what's in the variables
(what the compiler sees) and catch any bugs.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 11 Dec 2022 04:00:13 +0000 |
parents | 88468d5b3590 |
children | 9499d12d315b |
line wrap: on
line source
/* * This header file is the external public interface to libgsmefr; * it should be installed in the same system include directory * as <gsm.h> and <gsm_fr_preproc.h> for the older FR codec. */ #ifndef __GSM_EFR_H #define __GSM_EFR_H #include <stdint.h> #define EFR_RTP_FRAME_LEN 31 #define EFR_NUM_PARAMS 57 struct EFR_encoder_state; /* opaque to external users */ struct EFR_decoder_state; /* ditto */ extern struct EFR_encoder_state *EFR_encoder_create(int dtx); extern struct EFR_decoder_state *EFR_decoder_create(void); /* use standard free() call to free both afterward */ /* reset state to initial */ extern void EFR_encoder_reset(struct EFR_encoder_state *st, int dtx); extern void EFR_decoder_reset(struct EFR_decoder_state *st); /* encoder public functions */ extern void EFR_encode_params(struct EFR_encoder_state *st, const int16_t *pcm, int16_t *params, int *sp, int *vad); extern void EFR_encode_frame(struct EFR_encoder_state *st, const int16_t *pcm, uint8_t *frame, int *sp, int *vad); /* decoder public functions */ extern void EFR_decode_params(struct EFR_decoder_state *st, const int16_t *params, int bfi, int sid, int taf, int16_t *pcm); extern void EFR_decode_frame(struct EFR_decoder_state *st, const uint8_t *frame, int bfi, int taf, int16_t *pcm); extern void EFR_decode_bfi_nodata(struct EFR_decoder_state *st, int taf, int16_t *pcm); /* stateless utility functions */ extern int EFR_sid_classify(const uint8_t *frame); extern void EFR_frame2params(const uint8_t *frame, int16_t *params); extern void EFR_params2frame(const int16_t *params, uint8_t *frame); extern void EFR_insert_sid_codeword(uint8_t *frame); #endif /* include guard */