# HG changeset patch # User Mychaela Falconia # Date 1739407281 0 # Node ID 993cb9273f89bd50a919202fdba61fcdb02529f9 # Parent fa81605d83a25f7a9f1279356f38e5cf7dca1e67 libgsmhr1: add function that sets SID codeword at param level diff -r fa81605d83a2 -r 993cb9273f89 libgsmhr1/Makefile --- a/libgsmhr1/Makefile Thu Feb 13 00:14:09 2025 +0000 +++ b/libgsmhr1/Makefile Thu Feb 13 00:41:21 2025 +0000 @@ -1,7 +1,7 @@ OBJS= dhf_packed.o dhf_params.o enc_out_order.o mathdp31.o mathhalf.o \ pack_frame.o paramval_cod.o paramval_common.o paramval_dec.o rtp_in.o \ - rtp_in_direct.o sid_detect.o sid_reset.o sp_rom.o twts002_in.o \ - twts002_out.o unpack_frame.o + rtp_in_direct.o sid_cw_params.o sid_detect.o sid_reset.o sp_rom.o \ + twts002_in.o twts002_out.o unpack_frame.o HDRS= enc_out_order.h mathdp31.h mathhalf.h namespace.h sp_rom.h tw_gsmhr.h \ typedefs.h LIB= libgsmhr1.a diff -r fa81605d83a2 -r 993cb9273f89 libgsmhr1/sid_cw_params.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgsmhr1/sid_cw_params.c Thu Feb 13 00:41:21 2025 +0000 @@ -0,0 +1,32 @@ +/* + * The function in this module fills parameters 4 through 17 of + * generated SID frames, setting them to the required SID codeword. + * It can also be used to transform a speech frame into a SID frame + * with the same R0 and LPC parameters. + */ + +#include +#include "tw_gsmhr.h" + +void gsmhr_set_sid_cw_params(int16_t *params) +{ + /* Int_LPC and Mode */ + params[4] = 1; + params[5] = 3; + /* subframe 1 */ + params[6] = 0xFF; + params[7] = 0x1FF; + params[8] = 0x1F; + /* subframe 2 */ + params[9] = 0xF; + params[10] = 0x1FF; + params[11] = 0x1F; + /* subframe 3 */ + params[12] = 0xF; + params[13] = 0x1FF; + params[14] = 0x1F; + /* subframe 4 */ + params[15] = 0xF; + params[16] = 0x1FF; + params[17] = 0x1F; +} diff -r fa81605d83a2 -r 993cb9273f89 libgsmhr1/tw_gsmhr.h --- a/libgsmhr1/tw_gsmhr.h Thu Feb 13 00:14:09 2025 +0000 +++ b/libgsmhr1/tw_gsmhr.h Thu Feb 13 00:41:21 2025 +0000 @@ -68,6 +68,7 @@ int gsmhr_ts101318_is_perfect_sid(const uint8_t *payload); void gsmhr_ts101318_set_sid_codeword(uint8_t *payload); +void gsmhr_set_sid_cw_params(int16_t *params); /* public const data items */