# HG changeset patch # User Mychaela Falconia # Date 1773296352 0 # Node ID f85ef5c4d0449c5118f457a61c657be83eee6faf # Parent 32cc4b709e0e383bd8f72d50c0a31c561eeaeb67 libgsmhr1: provide sizes of state structures diff -r 32cc4b709e0e -r f85ef5c4d044 libgsmhr1/Makefile --- a/libgsmhr1/Makefile Thu Mar 12 05:59:37 2026 +0000 +++ b/libgsmhr1/Makefile Thu Mar 12 06:19:12 2026 +0000 @@ -2,7 +2,7 @@ dtx_rxfe.o enc_out_order.o enc_state.o err_conc.o mathdp31.o mathhalf.o\ pack_frame.o paramval_cod.o paramval_common.o paramval_dec.o rtp_in.o \ rtp_in_direct.o rxfe.o rxfe_create.o sid_cw_params.o sid_detect.o \ - sid_reset.o sp_dec.o sp_enc.o sp_frm.o sp_rom.o sp_sfrm.o tfo.o \ + sid_reset.o sizes.o sp_dec.o sp_enc.o sp_frm.o sp_rom.o sp_sfrm.o tfo.o\ twts002_in.o twts002_out.o unpack_frame.o vad.o HDRS= dec_func.h dec_state.h dtx_const.h dtx_dec.h dtx_enc.h dtx_rxfe.h \ enc_out_order.h enc_state.h err_conc.h mathdp31.h mathhalf.h \ diff -r 32cc4b709e0e -r f85ef5c4d044 libgsmhr1/sizes.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgsmhr1/sizes.c Thu Mar 12 06:19:12 2026 +0000 @@ -0,0 +1,12 @@ +/* + * This library module provides const "variables" with sizes of + * state structures. + */ + +#include "tw_gsmhr.h" +#include "dec_state.h" +#include "enc_state.h" + +const unsigned gsmhr_encoder_state_size = sizeof(struct gsmhr_encoder_state); +const unsigned gsmhr_decoder_state_size = sizeof(struct gsmhr_decoder_state); +const unsigned gsmhr_rxfe_state_size = sizeof(struct gsmhr_rxfe_state); diff -r 32cc4b709e0e -r f85ef5c4d044 libgsmhr1/tw_gsmhr.h --- a/libgsmhr1/tw_gsmhr.h Thu Mar 12 05:59:37 2026 +0000 +++ b/libgsmhr1/tw_gsmhr.h Thu Mar 12 06:19:12 2026 +0000 @@ -75,4 +75,10 @@ extern const int16_t gsmhr_dhf_params[GSMHR_NUM_PARAMS]; extern const uint8_t gsmhr_dhf_ts101318[GSMHR_FRAME_LEN_RPF]; +/* sizes of state structures, to support alternative malloc schemes */ + +extern const unsigned gsmhr_encoder_state_size; +extern const unsigned gsmhr_decoder_state_size; +extern const unsigned gsmhr_rxfe_state_size; + #endif /* include guard */