FreeCalypso > hg > gsm-codec-lib
diff libgsmhr1/sid_cw_params.c @ 574:993cb9273f89
libgsmhr1: add function that sets SID codeword at param level
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 13 Feb 2025 00:41:21 +0000 |
parents | |
children |
line wrap: on
line diff
--- /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 <stdint.h> +#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; +}