# HG changeset patch # User Mychaela Falconia # Date 1712969016 0 # Node ID 573afa985df63dbed348f2c84f6093a57fb89bfe # Parent cfcb3ce9c778cdb0f6dcf1c8d5c6409738eaa3ef libgsmfr2: split pp_state.h from pp_internal.h diff -r cfcb3ce9c778 -r 573afa985df6 libgsmfr2/Makefile --- a/libgsmfr2/Makefile Fri Apr 12 23:29:18 2024 +0000 +++ b/libgsmfr2/Makefile Sat Apr 13 00:43:36 2024 +0000 @@ -3,7 +3,7 @@ OBJS= comfort_noise.o pack_frame.o pack_frame2.o pp_bad.o pp_good.o \ pp_state.o prng.o sidclass.o silence_frame.o unpack_frame.o \ unpack_frame2.o xmaxc_mean.o -HDRS= pp_internal.h tw_gsmfr.h +HDRS= pp_internal.h pp_state.h tw_gsmfr.h typedef.h LIB= libgsmfr2.a INSTALL_PREFIX= /usr/local diff -r cfcb3ce9c778 -r 573afa985df6 libgsmfr2/comfort_noise.c --- a/libgsmfr2/comfort_noise.c Fri Apr 12 23:29:18 2024 +0000 +++ b/libgsmfr2/comfort_noise.c Sat Apr 13 00:43:36 2024 +0000 @@ -6,6 +6,7 @@ #include #include #include "tw_gsmfr.h" +#include "pp_state.h" #include "pp_internal.h" static const uint8_t fold_table_8to6[24] = { diff -r cfcb3ce9c778 -r 573afa985df6 libgsmfr2/pp_bad.c --- a/libgsmfr2/pp_bad.c Fri Apr 12 23:29:18 2024 +0000 +++ b/libgsmfr2/pp_bad.c Sat Apr 13 00:43:36 2024 +0000 @@ -6,6 +6,7 @@ #include #include #include "tw_gsmfr.h" +#include "pp_state.h" #include "pp_internal.h" static int reduce_xmaxc(uint8_t *frame) diff -r cfcb3ce9c778 -r 573afa985df6 libgsmfr2/pp_good.c --- a/libgsmfr2/pp_good.c Fri Apr 12 23:29:18 2024 +0000 +++ b/libgsmfr2/pp_good.c Sat Apr 13 00:43:36 2024 +0000 @@ -5,6 +5,7 @@ #include #include #include "tw_gsmfr.h" +#include "pp_state.h" #include "pp_internal.h" void gsmfr_preproc_good_frame(struct gsmfr_preproc_state *st, uint8_t *frame) diff -r cfcb3ce9c778 -r 573afa985df6 libgsmfr2/pp_internal.h --- a/libgsmfr2/pp_internal.h Fri Apr 12 23:29:18 2024 +0000 +++ b/libgsmfr2/pp_internal.h Sat Apr 13 00:43:36 2024 +0000 @@ -1,30 +1,8 @@ /* - * This header file is internal to libgsmfr2; - * here we define our state structure for the Rx DTX preprocessor component. + * This header file is internal to libgsmfr2; it contains declarations + * of internal functions for the Rx DTX preprocessor component. */ -enum rx_dtx_st { - NO_DATA = 0, - SPEECH, - SPEECH_MUTING, - COMFORT_NOISE, - LOST_SID, - CN_MUTING, -}; - -struct gsmfr_preproc_state { - enum rx_dtx_st rx_state; - uint8_t speech_frame[GSMFR_RTP_FRAME_LEN]; - uint8_t sid_prefix[5]; - uint8_t sid_xmaxc; - uint32_t cn_random_lfsr; - unsigned cn_random_6fold; -}; - -/* we use the same LFSR PRNG for CN as ETSI EFR implementation */ -#define PN_INITIAL_SEED 0x70816958L /* Pseudo noise generator seed value */ - -/* internal functions */ extern void gsmfr_preproc_gen_cn(struct gsmfr_preproc_state *state, uint8_t *frame); extern void gsmfr_preproc_sid2cn(struct gsmfr_preproc_state *state, diff -r cfcb3ce9c778 -r 573afa985df6 libgsmfr2/pp_state.c --- a/libgsmfr2/pp_state.c Fri Apr 12 23:29:18 2024 +0000 +++ b/libgsmfr2/pp_state.c Sat Apr 13 00:43:36 2024 +0000 @@ -7,7 +7,7 @@ #include #include #include "tw_gsmfr.h" -#include "pp_internal.h" +#include "pp_state.h" struct gsmfr_preproc_state *gsmfr_preproc_create(void) { diff -r cfcb3ce9c778 -r 573afa985df6 libgsmfr2/pp_state.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgsmfr2/pp_state.h Sat Apr 13 00:43:36 2024 +0000 @@ -0,0 +1,25 @@ +/* + * This header file is internal to libgsmfr2; + * here we define our state structure for the Rx DTX preprocessor component. + */ + +enum rx_dtx_st { + NO_DATA = 0, + SPEECH, + SPEECH_MUTING, + COMFORT_NOISE, + LOST_SID, + CN_MUTING, +}; + +struct gsmfr_preproc_state { + enum rx_dtx_st rx_state; + uint8_t speech_frame[GSMFR_RTP_FRAME_LEN]; + uint8_t sid_prefix[5]; + uint8_t sid_xmaxc; + uint32_t cn_random_lfsr; + unsigned cn_random_6fold; +}; + +/* we use the same LFSR PRNG for CN as ETSI EFR implementation */ +#define PN_INITIAL_SEED 0x70816958L /* Pseudo noise generator seed value */ diff -r cfcb3ce9c778 -r 573afa985df6 libgsmfr2/prng.c --- a/libgsmfr2/prng.c Fri Apr 12 23:29:18 2024 +0000 +++ b/libgsmfr2/prng.c Sat Apr 13 00:43:36 2024 +0000 @@ -10,6 +10,7 @@ #include #include "tw_gsmfr.h" +#include "pp_state.h" #include "pp_internal.h" uint16_t gsmfr_preproc_prng(struct gsmfr_preproc_state *st, uint16_t no_bits) diff -r cfcb3ce9c778 -r 573afa985df6 libgsmfr2/typedef.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgsmfr2/typedef.h Sat Apr 13 00:43:36 2024 +0000 @@ -0,0 +1,10 @@ +/* + * This internal header file provides adaptation between stdint types + * and those used by GSM 06.10 code from TU-Berlin. + */ + +typedef int16_t word; +typedef int32_t longword; + +typedef uint16_t uword; +typedef uint32_t ulongword;