FreeCalypso > hg > gsm-codec-lib
view libgsmhr1/sid_cw_params.c @ 585:3c6bf0d26ee7
TW-TS-005 reader: fix maximum line length bug
TW-TS-005 section 4.1 states:
The maximum allowed length of each line is 80 characters, not
including the OS-specific newline encoding.
The implementation of this line length limit in the TW-TS-005 hex file
reader function in the present suite was wrong, such that lines of
the full maximum length could not be read. Fix it.
Note that this bug affects comment lines too, not just actual RTP
payloads. Neither Annex A nor Annex B features an RTP payload format
that goes to the maximum of 40 bytes, but if a comment line goes to
the maximum allowed length of 80 characters not including the
terminating newline, the bug will be triggered, necessitating
the present fix.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 25 Feb 2025 07:49:28 +0000 |
parents | 993cb9273f89 |
children |
line wrap: on
line source
/* * 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; }