Apply this patch against the patchlevel 7 release, not against the level 8 release; there never was an official patchlevel 8. Before applying this patch, touch (create with size 0) the files tls/sour.c tls/ginger.c tls/sour1.dta tls/sour2.dta These files didn't exist in previous releases. Alternatively, just skip the patches that require them; they're not necessary to compile a working library. --Jutta *** ChangeLog *** 0a1,14 > Tue Jul 2 12:18:20 1996 Jutta Degener (jutta@cs.tu-berlin.de) > > * Release 1.0 Patchlevel 9 > src/long_term.c: in FLOAT_MUL mode, an array was accessed past its end > src/gsm_option.c: three options related to WAV #49 packing > src/gsm_encode.c: support WAV #49-style encoding. > src/gsm_decode.c: support WAV #49-style decoding. > tls/sour.c: generate the WAV bit shifting code, encode > tls/ginger.c: generate the WAV bit shifting code, decode > The WAV code goes back to an inofficial patch #8 that > Jeff Chilton sent us (hence the jump from 7 to 9). > src/toast.c: add _fsetmode() calls to set stdin/stdout to > binary (from an OS/2 port by Arnd Gronenberg.) > 38,40c52,53 < thanks to Dr Alex Lee (alexlee@solomon.technet.sg) < < * removed non-fatal bugs from add-test.dta, private.h --- > thanks to Dr Alex Lee (alexlee@solomon.technet.sg); > removed non-fatal bugs from add-test.dta, private.h 47,49c60,61 < thanks to Raphael Trommer at AT&T Bell Laboratories < < * ANSI C compatibility details --- > thanks to Raphael Trommer at AT&T Bell Laboratories; > various other ANSI C compatibility details *** MANIFEST *** 49a50,53 > gsm-1.0/tls/sour.c > gsm-1.0/tls/sour1.dta > gsm-1.0/tls/sour2.dta > gsm-1.0/tls/ginger.c *** Makefile *** 1c1 < # Copyright 1992 by Jutta Degener and Carsten Bormann, Technische --- > # Copyright 1992-1996 by Jutta Degener and Carsten Bormann, Technische 5c5 < # Machine dependent flags you must configure to port --- > # Machine- or installation dependent flags you should configure to port 24a25,32 > #WAV49 = -DWAV49 > WAV49 = > ######### Define to enable the GSM library's option to pack GSM frames > ######### in the style used by the WAV #49 format. If you want to write > ######### a tool that produces .WAV files which contain GSM-encoded data, > ######### define this, and read about the GSM_OPT_WAV49 option in the > ######### manual page on gsm_option(3). > 125c133 < $(CCINC) -I$(INC) --- > $(WAV49) $(CCINC) -I$(INC) 181a190,193 > $(TLS)/sour.c \ > $(TLS)/ginger.c \ > $(TLS)/sour1.dta \ > $(TLS)/sour2.dta \ 280c292 < misc: $(TLS)/sweet $(TLS)/bitter \ --- > misc: $(TLS)/sweet $(TLS)/bitter $(TLS)/sour $(TLS)/ginger \ 431a444,453 > # A version of the same family that Jeff Chilton used to implement > # the WAV #49 GSM format. > > $(TLS)/ginger: $(TLS)/ginger.o $(TLS)/taste.o > $(LD) $(LFLAGS) -o $(TLS)/ginger \ > $(TLS)/ginger.o $(TLS)/taste.o $(LDLIB) > > $(TLS)/sour: $(TLS)/sour.o $(TLS)/taste.o > $(LD) $(LFLAGS) -o $(TLS)/sour \ > $(TLS)/sour.o $(TLS)/taste.o $(LDLIB) *** inc/config.h *** 7c7 < /*$Header: /home/kbs/jutta/src/gsm/gsm-1.0/inc/RCS/config.h,v 1.3 1994/05/10 20:18:22 jutta Exp $*/ --- > /*$Header: /home/kbs/jutta/src/gsm/gsm-1.0/inc/RCS/config.h,v 1.5 1996/07/02 11:26:20 jutta Exp $*/ 21a22 > #define HAS_CHMOD 1 /* chmod syscall */ 22a24,25 > #define HAS_CHOWN 1 /* chown syscall */ > /*efine HAS__FSETMODE 1 /* _fsetmode -- set file mode */ *** inc/gsm.h *** 7c7 < /*$Header: /home/kbs/jutta/src/gsm/gsm-1.0/inc/RCS/gsm.h,v 1.9 1995/03/07 21:26:16 jutta Exp $*/ --- > /*$Header: /home/kbs/jutta/src/gsm/gsm-1.0/inc/RCS/gsm.h,v 1.10 1996/07/02 10:15:22 jutta Exp $*/ 44c44 < #define GSM_MAGIC 0xD /* 13 kbit/s RPE-LTP */ --- > #define GSM_MAGIC 0xD /* 13 kbit/s RPE-LTP */ 46,52c46,55 < #define GSM_PATCHLEVEL 7 < #define GSM_MINOR 0 < #define GSM_MAJOR 1 < < #define GSM_OPT_VERBOSE 1 < #define GSM_OPT_FAST 2 < #define GSM_OPT_LTP_CUT 3 --- > #define GSM_PATCHLEVEL 9 > #define GSM_MINOR 0 > #define GSM_MAJOR 1 > > #define GSM_OPT_VERBOSE 1 > #define GSM_OPT_FAST 2 > #define GSM_OPT_LTP_CUT 3 > #define GSM_OPT_WAV49 4 > #define GSM_OPT_FRAME_INDEX 5 > #define GSM_OPT_FRAME_CHAIN 6 *** inc/private.h *** 7c7 < /*$Header: /home/kbs/jutta/src/gsm/gsm-1.0/inc/RCS/private.h,v 1.5 1995/03/07 21:26:16 jutta Exp $*/ --- > /*$Header: /home/kbs/jutta/src/gsm/gsm-1.0/inc/RCS/private.h,v 1.6 1996/07/02 10:15:26 jutta Exp $*/ 37a38,40 > char wav_fmt; /* only used if WAV49 defined */ > unsigned char frame_index; /* odd/even chaining */ > unsigned char frame_chain; /* half-byte to carry forward */ 41,42c44,45 < #define MIN_WORD ((-32767)-1) < #define MAX_WORD ( 32767) --- > #define MIN_WORD (-32767 - 1) > #define MAX_WORD 32767 44,45c47,48 < #define MIN_LONGWORD ((-2147483647)-1) < #define MAX_LONGWORD ( 2147483647) --- > #define MIN_LONGWORD (-2147483647 - 1) > #define MAX_LONGWORD 2147483647 47c50 < #ifdef SASR /* >> is a signed arithmetic shift right */ --- > #ifdef SASR /* flag: >> is a signed arithmetic shift right */ 49a53,54 > #else > #define SASR(x, by) ((x) >= 0 ? (x) >> (by) : (~(-((x) + 1) >> (by)))) 51d55 < *** man/gsm_option.3 *** 37c37 < The following options are currently defined: --- > The following options are defined: 49a50 > .PP 96a98,176 > .sp > .PP > .I GSM_OPT_WAV49 > WAV-style byte ordering. > .br > .in+5 > A WAV file of type #49 contains GSM 06.10-encoded frames. > Unfortunately, the framing and code ordering of the WAV version > are incompatible with the native ones of this GSM 06.10 library. > The GSM_OPT_WAV49 option turns on a different packing > algorithm that produces alternating frames of 32 and 33 bytes > (or makes it consume alternating frames of 33 and 32 bytes, note > the opposite order of the two numbers) which, when concatenated, > can be used in the body of a WAV #49 frame. > It is up to the user program to write a WAV header, if any; > neither the library itself nor the toast program produce > complete WAV files. > .br > The value passed to > .br > .nf > gsm_option(handle, GSM_OPT_WAV49, & value) > .fi > .br > functions as a boolean flag; if it is zero, the library's native > framing algorithm will be used, if nonzero, WAV-type packing is in effect. > .br > This option should be used before any frames are encoded. > Whether or not it is supported at all depends on a > compile-time switch, WAV49. > Both option and compile time switch are new to the library > as of patchlevel 9, and are considerably less tested than the > well-worn rest of the it. > .br > Thanks to Jeff Chilton for the detective work and first free > implementation of this version of the GSM 06.10 encoding. > .sp > .PP > .I GSM_OPT_FRAME_CHAIN > Query or set the chaining byte. > .br > .in+5 > Between the two frames of a WAV-style encoding, the GSM 06.10 library > must keep track of one half-byte that is technically part of the first > frame, but will be written as the first four bits of the second. > This half-byte are the lowest four bits of the value returned by, > and optionally set by, > .br > .nf > gsm_option(handle, GSM_OPT_FRAME_CHAIN, & value) > .fi > .br > This option can be queried and set at any time. > .sp > .PP > .I GSM_OPT_FRAME_INDEX > Query or set the current frame's index in a format's > alternating list of frames. > .br > .in+5 > The WAV #49 framing uses two alternating types of frames. > Which type the next GSM-coded frame belongs to can be queried, or, > when decoding, announced, using > .br > .nf > gsm_option(handle, GSM_OPT_FRAME_INDEX, & value) > .fi > .br > For WAV-style framing, the value should be 0 or 1; the first frame > of an encoding has an index of 0. > At library initialization, the index is set to zero. > .br > The frame index can be queried and set at any time. > Used in combination with the > .IR GSM_OPT_FRAME_CHAIN , > option, it can be used to position on arbitrary GSM frames > within a format like WAV #49 (not accounting for the lost > internal GSM state). > .in-5 *** man/toast.1 *** 9d8 < .PU *** src/add.c *** 7c7 < /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/add.c,v 1.5 1994/12/30 22:35:09 jutta Exp $ */ --- > /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/add.c,v 1.6 1996/07/02 09:57:33 jutta Exp $ */ 98c98 < static unsigned char bitoff[ 256 ] = { --- > static unsigned char const bitoff[ 256 ] = { *** src/code.c *** 7c7 < /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/code.c,v 1.2 1994/05/10 20:18:31 jutta Exp $ */ --- > /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/code.c,v 1.3 1996/07/02 09:59:05 jutta Exp $ */ 62c62 < static word e [50] = {0}; --- > static word e[50]; *** src/gsm_create.c *** 7c7 < static char ident[] = "$Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/gsm_create.c,v 1.3 1995/03/07 21:21:24 jutta Exp $"; --- > static char const ident[] = "$Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/gsm_create.c,v 1.4 1996/07/02 09:59:05 jutta Exp $"; *** src/gsm_decode.c *** 7c7 < /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/gsm_decode.c,v 1.1 1992/10/28 00:15:50 jutta Exp $ */ --- > /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/gsm_decode.c,v 1.2 1996/07/02 09:59:05 jutta Exp $ */ 18c18,19 < /* GSM_MAGIC = (*c >> 4) & 0xF; */ --- > #ifdef WAV49 > if (s->wav_fmt) { 20c21 < if (((*c >> 4) & 0x0F) != GSM_MAGIC) return -1; --- > uword sr = 0; 22,120c23,356 < LARc[0] = (*c++ & 0xF) << 2; /* 1 */ < LARc[0] |= (*c >> 6) & 0x3; < LARc[1] = *c++ & 0x3F; < LARc[2] = (*c >> 3) & 0x1F; < LARc[3] = (*c++ & 0x7) << 2; < LARc[3] |= (*c >> 6) & 0x3; < LARc[4] = (*c >> 2) & 0xF; < LARc[5] = (*c++ & 0x3) << 2; < LARc[5] |= (*c >> 6) & 0x3; < LARc[6] = (*c >> 3) & 0x7; < LARc[7] = *c++ & 0x7; < Nc[0] = (*c >> 1) & 0x7F; < bc[0] = (*c++ & 0x1) << 1; < bc[0] |= (*c >> 7) & 0x1; < Mc[0] = (*c >> 5) & 0x3; < xmaxc[0] = (*c++ & 0x1F) << 1; < xmaxc[0] |= (*c >> 7) & 0x1; < xmc[0] = (*c >> 4) & 0x7; < xmc[1] = (*c >> 1) & 0x7; < xmc[2] = (*c++ & 0x1) << 2; < xmc[2] |= (*c >> 6) & 0x3; < xmc[3] = (*c >> 3) & 0x7; < xmc[4] = *c++ & 0x7; < xmc[5] = (*c >> 5) & 0x7; < xmc[6] = (*c >> 2) & 0x7; < xmc[7] = (*c++ & 0x3) << 1; /* 10 */ < xmc[7] |= (*c >> 7) & 0x1; < xmc[8] = (*c >> 4) & 0x7; < xmc[9] = (*c >> 1) & 0x7; < xmc[10] = (*c++ & 0x1) << 2; < xmc[10] |= (*c >> 6) & 0x3; < xmc[11] = (*c >> 3) & 0x7; < xmc[12] = *c++ & 0x7; < Nc[1] = (*c >> 1) & 0x7F; < bc[1] = (*c++ & 0x1) << 1; < bc[1] |= (*c >> 7) & 0x1; < Mc[1] = (*c >> 5) & 0x3; < xmaxc[1] = (*c++ & 0x1F) << 1; < xmaxc[1] |= (*c >> 7) & 0x1; < xmc[13] = (*c >> 4) & 0x7; < xmc[14] = (*c >> 1) & 0x7; < xmc[15] = (*c++ & 0x1) << 2; < xmc[15] |= (*c >> 6) & 0x3; < xmc[16] = (*c >> 3) & 0x7; < xmc[17] = *c++ & 0x7; < xmc[18] = (*c >> 5) & 0x7; < xmc[19] = (*c >> 2) & 0x7; < xmc[20] = (*c++ & 0x3) << 1; < xmc[20] |= (*c >> 7) & 0x1; < xmc[21] = (*c >> 4) & 0x7; < xmc[22] = (*c >> 1) & 0x7; < xmc[23] = (*c++ & 0x1) << 2; < xmc[23] |= (*c >> 6) & 0x3; < xmc[24] = (*c >> 3) & 0x7; < xmc[25] = *c++ & 0x7; < Nc[2] = (*c >> 1) & 0x7F; < bc[2] = (*c++ & 0x1) << 1; /* 20 */ < bc[2] |= (*c >> 7) & 0x1; < Mc[2] = (*c >> 5) & 0x3; < xmaxc[2] = (*c++ & 0x1F) << 1; < xmaxc[2] |= (*c >> 7) & 0x1; < xmc[26] = (*c >> 4) & 0x7; < xmc[27] = (*c >> 1) & 0x7; < xmc[28] = (*c++ & 0x1) << 2; < xmc[28] |= (*c >> 6) & 0x3; < xmc[29] = (*c >> 3) & 0x7; < xmc[30] = *c++ & 0x7; < xmc[31] = (*c >> 5) & 0x7; < xmc[32] = (*c >> 2) & 0x7; < xmc[33] = (*c++ & 0x3) << 1; < xmc[33] |= (*c >> 7) & 0x1; < xmc[34] = (*c >> 4) & 0x7; < xmc[35] = (*c >> 1) & 0x7; < xmc[36] = (*c++ & 0x1) << 2; < xmc[36] |= (*c >> 6) & 0x3; < xmc[37] = (*c >> 3) & 0x7; < xmc[38] = *c++ & 0x7; < Nc[3] = (*c >> 1) & 0x7F; < bc[3] = (*c++ & 0x1) << 1; < bc[3] |= (*c >> 7) & 0x1; < Mc[3] = (*c >> 5) & 0x3; < xmaxc[3] = (*c++ & 0x1F) << 1; < xmaxc[3] |= (*c >> 7) & 0x1; < xmc[39] = (*c >> 4) & 0x7; < xmc[40] = (*c >> 1) & 0x7; < xmc[41] = (*c++ & 0x1) << 2; < xmc[41] |= (*c >> 6) & 0x3; < xmc[42] = (*c >> 3) & 0x7; < xmc[43] = *c++ & 0x7; /* 30 */ < xmc[44] = (*c >> 5) & 0x7; < xmc[45] = (*c >> 2) & 0x7; < xmc[46] = (*c++ & 0x3) << 1; < xmc[46] |= (*c >> 7) & 0x1; < xmc[47] = (*c >> 4) & 0x7; < xmc[48] = (*c >> 1) & 0x7; < xmc[49] = (*c++ & 0x1) << 2; < xmc[49] |= (*c >> 6) & 0x3; < xmc[50] = (*c >> 3) & 0x7; < xmc[51] = *c & 0x7; /* 33 */ --- > s->frame_index = !s->frame_index; > if (s->frame_index) { > > sr = *c++; > LARc[0] = sr & 0x3f; sr >>= 6; > sr |= (uword)*c++ << 2; > LARc[1] = sr & 0x3f; sr >>= 6; > sr |= (uword)*c++ << 4; > LARc[2] = sr & 0x1f; sr >>= 5; > LARc[3] = sr & 0x1f; sr >>= 5; > sr |= (uword)*c++ << 2; > LARc[4] = sr & 0xf; sr >>= 4; > LARc[5] = sr & 0xf; sr >>= 4; > sr |= (uword)*c++ << 2; /* 5 */ > LARc[6] = sr & 0x7; sr >>= 3; > LARc[7] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 4; > Nc[0] = sr & 0x7f; sr >>= 7; > bc[0] = sr & 0x3; sr >>= 2; > Mc[0] = sr & 0x3; sr >>= 2; > sr |= (uword)*c++ << 1; > xmaxc[0] = sr & 0x3f; sr >>= 6; > xmc[0] = sr & 0x7; sr >>= 3; > sr = *c++; > xmc[1] = sr & 0x7; sr >>= 3; > xmc[2] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; > xmc[3] = sr & 0x7; sr >>= 3; > xmc[4] = sr & 0x7; sr >>= 3; > xmc[5] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; /* 10 */ > xmc[6] = sr & 0x7; sr >>= 3; > xmc[7] = sr & 0x7; sr >>= 3; > xmc[8] = sr & 0x7; sr >>= 3; > sr = *c++; > xmc[9] = sr & 0x7; sr >>= 3; > xmc[10] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; > xmc[11] = sr & 0x7; sr >>= 3; > xmc[12] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 4; > Nc[1] = sr & 0x7f; sr >>= 7; > bc[1] = sr & 0x3; sr >>= 2; > Mc[1] = sr & 0x3; sr >>= 2; > sr |= (uword)*c++ << 1; > xmaxc[1] = sr & 0x3f; sr >>= 6; > xmc[13] = sr & 0x7; sr >>= 3; > sr = *c++; /* 15 */ > xmc[14] = sr & 0x7; sr >>= 3; > xmc[15] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; > xmc[16] = sr & 0x7; sr >>= 3; > xmc[17] = sr & 0x7; sr >>= 3; > xmc[18] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; > xmc[19] = sr & 0x7; sr >>= 3; > xmc[20] = sr & 0x7; sr >>= 3; > xmc[21] = sr & 0x7; sr >>= 3; > sr = *c++; > xmc[22] = sr & 0x7; sr >>= 3; > xmc[23] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; > xmc[24] = sr & 0x7; sr >>= 3; > xmc[25] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 4; /* 20 */ > Nc[2] = sr & 0x7f; sr >>= 7; > bc[2] = sr & 0x3; sr >>= 2; > Mc[2] = sr & 0x3; sr >>= 2; > sr |= (uword)*c++ << 1; > xmaxc[2] = sr & 0x3f; sr >>= 6; > xmc[26] = sr & 0x7; sr >>= 3; > sr = *c++; > xmc[27] = sr & 0x7; sr >>= 3; > xmc[28] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; > xmc[29] = sr & 0x7; sr >>= 3; > xmc[30] = sr & 0x7; sr >>= 3; > xmc[31] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; > xmc[32] = sr & 0x7; sr >>= 3; > xmc[33] = sr & 0x7; sr >>= 3; > xmc[34] = sr & 0x7; sr >>= 3; > sr = *c++; /* 25 */ > xmc[35] = sr & 0x7; sr >>= 3; > xmc[36] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; > xmc[37] = sr & 0x7; sr >>= 3; > xmc[38] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 4; > Nc[3] = sr & 0x7f; sr >>= 7; > bc[3] = sr & 0x3; sr >>= 2; > Mc[3] = sr & 0x3; sr >>= 2; > sr |= (uword)*c++ << 1; > xmaxc[3] = sr & 0x3f; sr >>= 6; > xmc[39] = sr & 0x7; sr >>= 3; > sr = *c++; > xmc[40] = sr & 0x7; sr >>= 3; > xmc[41] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; /* 30 */ > xmc[42] = sr & 0x7; sr >>= 3; > xmc[43] = sr & 0x7; sr >>= 3; > xmc[44] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; > xmc[45] = sr & 0x7; sr >>= 3; > xmc[46] = sr & 0x7; sr >>= 3; > xmc[47] = sr & 0x7; sr >>= 3; > sr = *c++; > xmc[48] = sr & 0x7; sr >>= 3; > xmc[49] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; > xmc[50] = sr & 0x7; sr >>= 3; > xmc[51] = sr & 0x7; sr >>= 3; > > s->frame_chain = sr & 0xf; > } > else { > sr = s->frame_chain; > sr |= (uword)*c++ << 4; /* 1 */ > LARc[0] = sr & 0x3f; sr >>= 6; > LARc[1] = sr & 0x3f; sr >>= 6; > sr = *c++; > LARc[2] = sr & 0x1f; sr >>= 5; > sr |= (uword)*c++ << 3; > LARc[3] = sr & 0x1f; sr >>= 5; > LARc[4] = sr & 0xf; sr >>= 4; > sr |= (uword)*c++ << 2; > LARc[5] = sr & 0xf; sr >>= 4; > LARc[6] = sr & 0x7; sr >>= 3; > LARc[7] = sr & 0x7; sr >>= 3; > sr = *c++; /* 5 */ > Nc[0] = sr & 0x7f; sr >>= 7; > sr |= (uword)*c++ << 1; > bc[0] = sr & 0x3; sr >>= 2; > Mc[0] = sr & 0x3; sr >>= 2; > sr |= (uword)*c++ << 5; > xmaxc[0] = sr & 0x3f; sr >>= 6; > xmc[0] = sr & 0x7; sr >>= 3; > xmc[1] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; > xmc[2] = sr & 0x7; sr >>= 3; > xmc[3] = sr & 0x7; sr >>= 3; > xmc[4] = sr & 0x7; sr >>= 3; > sr = *c++; > xmc[5] = sr & 0x7; sr >>= 3; > xmc[6] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; /* 10 */ > xmc[7] = sr & 0x7; sr >>= 3; > xmc[8] = sr & 0x7; sr >>= 3; > xmc[9] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; > xmc[10] = sr & 0x7; sr >>= 3; > xmc[11] = sr & 0x7; sr >>= 3; > xmc[12] = sr & 0x7; sr >>= 3; > sr = *c++; > Nc[1] = sr & 0x7f; sr >>= 7; > sr |= (uword)*c++ << 1; > bc[1] = sr & 0x3; sr >>= 2; > Mc[1] = sr & 0x3; sr >>= 2; > sr |= (uword)*c++ << 5; > xmaxc[1] = sr & 0x3f; sr >>= 6; > xmc[13] = sr & 0x7; sr >>= 3; > xmc[14] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; /* 15 */ > xmc[15] = sr & 0x7; sr >>= 3; > xmc[16] = sr & 0x7; sr >>= 3; > xmc[17] = sr & 0x7; sr >>= 3; > sr = *c++; > xmc[18] = sr & 0x7; sr >>= 3; > xmc[19] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; > xmc[20] = sr & 0x7; sr >>= 3; > xmc[21] = sr & 0x7; sr >>= 3; > xmc[22] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; > xmc[23] = sr & 0x7; sr >>= 3; > xmc[24] = sr & 0x7; sr >>= 3; > xmc[25] = sr & 0x7; sr >>= 3; > sr = *c++; > Nc[2] = sr & 0x7f; sr >>= 7; > sr |= (uword)*c++ << 1; /* 20 */ > bc[2] = sr & 0x3; sr >>= 2; > Mc[2] = sr & 0x3; sr >>= 2; > sr |= (uword)*c++ << 5; > xmaxc[2] = sr & 0x3f; sr >>= 6; > xmc[26] = sr & 0x7; sr >>= 3; > xmc[27] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; > xmc[28] = sr & 0x7; sr >>= 3; > xmc[29] = sr & 0x7; sr >>= 3; > xmc[30] = sr & 0x7; sr >>= 3; > sr = *c++; > xmc[31] = sr & 0x7; sr >>= 3; > xmc[32] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; > xmc[33] = sr & 0x7; sr >>= 3; > xmc[34] = sr & 0x7; sr >>= 3; > xmc[35] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; /* 25 */ > xmc[36] = sr & 0x7; sr >>= 3; > xmc[37] = sr & 0x7; sr >>= 3; > xmc[38] = sr & 0x7; sr >>= 3; > sr = *c++; > Nc[3] = sr & 0x7f; sr >>= 7; > sr |= (uword)*c++ << 1; > bc[3] = sr & 0x3; sr >>= 2; > Mc[3] = sr & 0x3; sr >>= 2; > sr |= (uword)*c++ << 5; > xmaxc[3] = sr & 0x3f; sr >>= 6; > xmc[39] = sr & 0x7; sr >>= 3; > xmc[40] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; > xmc[41] = sr & 0x7; sr >>= 3; > xmc[42] = sr & 0x7; sr >>= 3; > xmc[43] = sr & 0x7; sr >>= 3; > sr = *c++; /* 30 */ > xmc[44] = sr & 0x7; sr >>= 3; > xmc[45] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; > xmc[46] = sr & 0x7; sr >>= 3; > xmc[47] = sr & 0x7; sr >>= 3; > xmc[48] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; > xmc[49] = sr & 0x7; sr >>= 3; > xmc[50] = sr & 0x7; sr >>= 3; > xmc[51] = sr & 0x7; sr >>= 3; > } > } > else > #endif > { > /* GSM_MAGIC = (*c >> 4) & 0xF; */ > > if (((*c >> 4) & 0x0F) != GSM_MAGIC) return -1; > > LARc[0] = (*c++ & 0xF) << 2; /* 1 */ > LARc[0] |= (*c >> 6) & 0x3; > LARc[1] = *c++ & 0x3F; > LARc[2] = (*c >> 3) & 0x1F; > LARc[3] = (*c++ & 0x7) << 2; > LARc[3] |= (*c >> 6) & 0x3; > LARc[4] = (*c >> 2) & 0xF; > LARc[5] = (*c++ & 0x3) << 2; > LARc[5] |= (*c >> 6) & 0x3; > LARc[6] = (*c >> 3) & 0x7; > LARc[7] = *c++ & 0x7; > Nc[0] = (*c >> 1) & 0x7F; > bc[0] = (*c++ & 0x1) << 1; > bc[0] |= (*c >> 7) & 0x1; > Mc[0] = (*c >> 5) & 0x3; > xmaxc[0] = (*c++ & 0x1F) << 1; > xmaxc[0] |= (*c >> 7) & 0x1; > xmc[0] = (*c >> 4) & 0x7; > xmc[1] = (*c >> 1) & 0x7; > xmc[2] = (*c++ & 0x1) << 2; > xmc[2] |= (*c >> 6) & 0x3; > xmc[3] = (*c >> 3) & 0x7; > xmc[4] = *c++ & 0x7; > xmc[5] = (*c >> 5) & 0x7; > xmc[6] = (*c >> 2) & 0x7; > xmc[7] = (*c++ & 0x3) << 1; /* 10 */ > xmc[7] |= (*c >> 7) & 0x1; > xmc[8] = (*c >> 4) & 0x7; > xmc[9] = (*c >> 1) & 0x7; > xmc[10] = (*c++ & 0x1) << 2; > xmc[10] |= (*c >> 6) & 0x3; > xmc[11] = (*c >> 3) & 0x7; > xmc[12] = *c++ & 0x7; > Nc[1] = (*c >> 1) & 0x7F; > bc[1] = (*c++ & 0x1) << 1; > bc[1] |= (*c >> 7) & 0x1; > Mc[1] = (*c >> 5) & 0x3; > xmaxc[1] = (*c++ & 0x1F) << 1; > xmaxc[1] |= (*c >> 7) & 0x1; > xmc[13] = (*c >> 4) & 0x7; > xmc[14] = (*c >> 1) & 0x7; > xmc[15] = (*c++ & 0x1) << 2; > xmc[15] |= (*c >> 6) & 0x3; > xmc[16] = (*c >> 3) & 0x7; > xmc[17] = *c++ & 0x7; > xmc[18] = (*c >> 5) & 0x7; > xmc[19] = (*c >> 2) & 0x7; > xmc[20] = (*c++ & 0x3) << 1; > xmc[20] |= (*c >> 7) & 0x1; > xmc[21] = (*c >> 4) & 0x7; > xmc[22] = (*c >> 1) & 0x7; > xmc[23] = (*c++ & 0x1) << 2; > xmc[23] |= (*c >> 6) & 0x3; > xmc[24] = (*c >> 3) & 0x7; > xmc[25] = *c++ & 0x7; > Nc[2] = (*c >> 1) & 0x7F; > bc[2] = (*c++ & 0x1) << 1; /* 20 */ > bc[2] |= (*c >> 7) & 0x1; > Mc[2] = (*c >> 5) & 0x3; > xmaxc[2] = (*c++ & 0x1F) << 1; > xmaxc[2] |= (*c >> 7) & 0x1; > xmc[26] = (*c >> 4) & 0x7; > xmc[27] = (*c >> 1) & 0x7; > xmc[28] = (*c++ & 0x1) << 2; > xmc[28] |= (*c >> 6) & 0x3; > xmc[29] = (*c >> 3) & 0x7; > xmc[30] = *c++ & 0x7; > xmc[31] = (*c >> 5) & 0x7; > xmc[32] = (*c >> 2) & 0x7; > xmc[33] = (*c++ & 0x3) << 1; > xmc[33] |= (*c >> 7) & 0x1; > xmc[34] = (*c >> 4) & 0x7; > xmc[35] = (*c >> 1) & 0x7; > xmc[36] = (*c++ & 0x1) << 2; > xmc[36] |= (*c >> 6) & 0x3; > xmc[37] = (*c >> 3) & 0x7; > xmc[38] = *c++ & 0x7; > Nc[3] = (*c >> 1) & 0x7F; > bc[3] = (*c++ & 0x1) << 1; > bc[3] |= (*c >> 7) & 0x1; > Mc[3] = (*c >> 5) & 0x3; > xmaxc[3] = (*c++ & 0x1F) << 1; > xmaxc[3] |= (*c >> 7) & 0x1; > xmc[39] = (*c >> 4) & 0x7; > xmc[40] = (*c >> 1) & 0x7; > xmc[41] = (*c++ & 0x1) << 2; > xmc[41] |= (*c >> 6) & 0x3; > xmc[42] = (*c >> 3) & 0x7; > xmc[43] = *c++ & 0x7; /* 30 */ > xmc[44] = (*c >> 5) & 0x7; > xmc[45] = (*c >> 2) & 0x7; > xmc[46] = (*c++ & 0x3) << 1; > xmc[46] |= (*c >> 7) & 0x1; > xmc[47] = (*c >> 4) & 0x7; > xmc[48] = (*c >> 1) & 0x7; > xmc[49] = (*c++ & 0x1) << 2; > xmc[49] |= (*c >> 6) & 0x3; > xmc[50] = (*c >> 3) & 0x7; > xmc[51] = *c & 0x7; /* 33 */ > } *** src/gsm_encode.c *** 7c7 < /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/gsm_encode.c,v 1.1 1992/10/28 00:15:50 jutta Exp $ */ --- > /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/gsm_encode.c,v 1.2 1996/07/02 09:59:05 jutta Exp $ */ 105a106 > #ifdef WAV49 107,206c108,450 < *c++ = ((GSM_MAGIC & 0xF) << 4) /* 1 */ < | ((LARc[0] >> 2) & 0xF); < *c++ = ((LARc[0] & 0x3) << 6) < | (LARc[1] & 0x3F); < *c++ = ((LARc[2] & 0x1F) << 3) < | ((LARc[3] >> 2) & 0x7); < *c++ = ((LARc[3] & 0x3) << 6) < | ((LARc[4] & 0xF) << 2) < | ((LARc[5] >> 2) & 0x3); < *c++ = ((LARc[5] & 0x3) << 6) < | ((LARc[6] & 0x7) << 3) < | (LARc[7] & 0x7); < *c++ = ((Nc[0] & 0x7F) << 1) < | ((bc[0] >> 1) & 0x1); < *c++ = ((bc[0] & 0x1) << 7) < | ((Mc[0] & 0x3) << 5) < | ((xmaxc[0] >> 1) & 0x1F); < *c++ = ((xmaxc[0] & 0x1) << 7) < | ((xmc[0] & 0x7) << 4) < | ((xmc[1] & 0x7) << 1) < | ((xmc[2] >> 2) & 0x1); < *c++ = ((xmc[2] & 0x3) << 6) < | ((xmc[3] & 0x7) << 3) < | (xmc[4] & 0x7); < *c++ = ((xmc[5] & 0x7) << 5) /* 10 */ < | ((xmc[6] & 0x7) << 2) < | ((xmc[7] >> 1) & 0x3); < *c++ = ((xmc[7] & 0x1) << 7) < | ((xmc[8] & 0x7) << 4) < | ((xmc[9] & 0x7) << 1) < | ((xmc[10] >> 2) & 0x1); < *c++ = ((xmc[10] & 0x3) << 6) < | ((xmc[11] & 0x7) << 3) < | (xmc[12] & 0x7); < *c++ = ((Nc[1] & 0x7F) << 1) < | ((bc[1] >> 1) & 0x1); < *c++ = ((bc[1] & 0x1) << 7) < | ((Mc[1] & 0x3) << 5) < | ((xmaxc[1] >> 1) & 0x1F); < *c++ = ((xmaxc[1] & 0x1) << 7) < | ((xmc[13] & 0x7) << 4) < | ((xmc[14] & 0x7) << 1) < | ((xmc[15] >> 2) & 0x1); < *c++ = ((xmc[15] & 0x3) << 6) < | ((xmc[16] & 0x7) << 3) < | (xmc[17] & 0x7); < *c++ = ((xmc[18] & 0x7) << 5) < | ((xmc[19] & 0x7) << 2) < | ((xmc[20] >> 1) & 0x3); < *c++ = ((xmc[20] & 0x1) << 7) < | ((xmc[21] & 0x7) << 4) < | ((xmc[22] & 0x7) << 1) < | ((xmc[23] >> 2) & 0x1); < *c++ = ((xmc[23] & 0x3) << 6) < | ((xmc[24] & 0x7) << 3) < | (xmc[25] & 0x7); < *c++ = ((Nc[2] & 0x7F) << 1) /* 20 */ < | ((bc[2] >> 1) & 0x1); < *c++ = ((bc[2] & 0x1) << 7) < | ((Mc[2] & 0x3) << 5) < | ((xmaxc[2] >> 1) & 0x1F); < *c++ = ((xmaxc[2] & 0x1) << 7) < | ((xmc[26] & 0x7) << 4) < | ((xmc[27] & 0x7) << 1) < | ((xmc[28] >> 2) & 0x1); < *c++ = ((xmc[28] & 0x3) << 6) < | ((xmc[29] & 0x7) << 3) < | (xmc[30] & 0x7); < *c++ = ((xmc[31] & 0x7) << 5) < | ((xmc[32] & 0x7) << 2) < | ((xmc[33] >> 1) & 0x3); < *c++ = ((xmc[33] & 0x1) << 7) < | ((xmc[34] & 0x7) << 4) < | ((xmc[35] & 0x7) << 1) < | ((xmc[36] >> 2) & 0x1); < *c++ = ((xmc[36] & 0x3) << 6) < | ((xmc[37] & 0x7) << 3) < | (xmc[38] & 0x7); < *c++ = ((Nc[3] & 0x7F) << 1) < | ((bc[3] >> 1) & 0x1); < *c++ = ((bc[3] & 0x1) << 7) < | ((Mc[3] & 0x3) << 5) < | ((xmaxc[3] >> 1) & 0x1F); < *c++ = ((xmaxc[3] & 0x1) << 7) < | ((xmc[39] & 0x7) << 4) < | ((xmc[40] & 0x7) << 1) < | ((xmc[41] >> 2) & 0x1); < *c++ = ((xmc[41] & 0x3) << 6) /* 30 */ < | ((xmc[42] & 0x7) << 3) < | (xmc[43] & 0x7); < *c++ = ((xmc[44] & 0x7) << 5) < | ((xmc[45] & 0x7) << 2) < | ((xmc[46] >> 1) & 0x3); < *c++ = ((xmc[46] & 0x1) << 7) < | ((xmc[47] & 0x7) << 4) < | ((xmc[48] & 0x7) << 1) < | ((xmc[49] >> 2) & 0x1); < *c++ = ((xmc[49] & 0x3) << 6) < | ((xmc[50] & 0x7) << 3) < | (xmc[51] & 0x7); --- > if (s->wav_fmt) { > s->frame_index = !s->frame_index; > if (s->frame_index) { > > uword sr; > > sr = 0; > sr = sr >> 6 | LARc[0] << 10; > sr = sr >> 6 | LARc[1] << 10; > *c++ = sr >> 4; > sr = sr >> 5 | LARc[2] << 11; > *c++ = sr >> 7; > sr = sr >> 5 | LARc[3] << 11; > sr = sr >> 4 | LARc[4] << 12; > *c++ = sr >> 6; > sr = sr >> 4 | LARc[5] << 12; > sr = sr >> 3 | LARc[6] << 13; > *c++ = sr >> 7; > sr = sr >> 3 | LARc[7] << 13; > sr = sr >> 7 | Nc[0] << 9; > *c++ = sr >> 5; > sr = sr >> 2 | bc[0] << 14; > sr = sr >> 2 | Mc[0] << 14; > sr = sr >> 6 | xmaxc[0] << 10; > *c++ = sr >> 3; > sr = sr >> 3 | xmc[0] << 13; > *c++ = sr >> 8; > sr = sr >> 3 | xmc[1] << 13; > sr = sr >> 3 | xmc[2] << 13; > sr = sr >> 3 | xmc[3] << 13; > *c++ = sr >> 7; > sr = sr >> 3 | xmc[4] << 13; > sr = sr >> 3 | xmc[5] << 13; > sr = sr >> 3 | xmc[6] << 13; > *c++ = sr >> 6; > sr = sr >> 3 | xmc[7] << 13; > sr = sr >> 3 | xmc[8] << 13; > *c++ = sr >> 8; > sr = sr >> 3 | xmc[9] << 13; > sr = sr >> 3 | xmc[10] << 13; > sr = sr >> 3 | xmc[11] << 13; > *c++ = sr >> 7; > sr = sr >> 3 | xmc[12] << 13; > sr = sr >> 7 | Nc[1] << 9; > *c++ = sr >> 5; > sr = sr >> 2 | bc[1] << 14; > sr = sr >> 2 | Mc[1] << 14; > sr = sr >> 6 | xmaxc[1] << 10; > *c++ = sr >> 3; > sr = sr >> 3 | xmc[13] << 13; > *c++ = sr >> 8; > sr = sr >> 3 | xmc[14] << 13; > sr = sr >> 3 | xmc[15] << 13; > sr = sr >> 3 | xmc[16] << 13; > *c++ = sr >> 7; > sr = sr >> 3 | xmc[17] << 13; > sr = sr >> 3 | xmc[18] << 13; > sr = sr >> 3 | xmc[19] << 13; > *c++ = sr >> 6; > sr = sr >> 3 | xmc[20] << 13; > sr = sr >> 3 | xmc[21] << 13; > *c++ = sr >> 8; > sr = sr >> 3 | xmc[22] << 13; > sr = sr >> 3 | xmc[23] << 13; > sr = sr >> 3 | xmc[24] << 13; > *c++ = sr >> 7; > sr = sr >> 3 | xmc[25] << 13; > sr = sr >> 7 | Nc[2] << 9; > *c++ = sr >> 5; > sr = sr >> 2 | bc[2] << 14; > sr = sr >> 2 | Mc[2] << 14; > sr = sr >> 6 | xmaxc[2] << 10; > *c++ = sr >> 3; > sr = sr >> 3 | xmc[26] << 13; > *c++ = sr >> 8; > sr = sr >> 3 | xmc[27] << 13; > sr = sr >> 3 | xmc[28] << 13; > sr = sr >> 3 | xmc[29] << 13; > *c++ = sr >> 7; > sr = sr >> 3 | xmc[30] << 13; > sr = sr >> 3 | xmc[31] << 13; > sr = sr >> 3 | xmc[32] << 13; > *c++ = sr >> 6; > sr = sr >> 3 | xmc[33] << 13; > sr = sr >> 3 | xmc[34] << 13; > *c++ = sr >> 8; > sr = sr >> 3 | xmc[35] << 13; > sr = sr >> 3 | xmc[36] << 13; > sr = sr >> 3 | xmc[37] << 13; > *c++ = sr >> 7; > sr = sr >> 3 | xmc[38] << 13; > sr = sr >> 7 | Nc[3] << 9; > *c++ = sr >> 5; > sr = sr >> 2 | bc[3] << 14; > sr = sr >> 2 | Mc[3] << 14; > sr = sr >> 6 | xmaxc[3] << 10; > *c++ = sr >> 3; > sr = sr >> 3 | xmc[39] << 13; > *c++ = sr >> 8; > sr = sr >> 3 | xmc[40] << 13; > sr = sr >> 3 | xmc[41] << 13; > sr = sr >> 3 | xmc[42] << 13; > *c++ = sr >> 7; > sr = sr >> 3 | xmc[43] << 13; > sr = sr >> 3 | xmc[44] << 13; > sr = sr >> 3 | xmc[45] << 13; > *c++ = sr >> 6; > sr = sr >> 3 | xmc[46] << 13; > sr = sr >> 3 | xmc[47] << 13; > *c++ = sr >> 8; > sr = sr >> 3 | xmc[48] << 13; > sr = sr >> 3 | xmc[49] << 13; > sr = sr >> 3 | xmc[50] << 13; > *c++ = sr >> 7; > sr = sr >> 3 | xmc[51] << 13; > sr = sr >> 4; > *c = sr >> 8; > s->frame_chain = *c; > } > else { > uword sr; > > sr = 0; > sr = sr >> 4 | s->frame_chain << 12; > sr = sr >> 6 | LARc[0] << 10; > *c++ = sr >> 6; > sr = sr >> 6 | LARc[1] << 10; > *c++ = sr >> 8; > sr = sr >> 5 | LARc[2] << 11; > sr = sr >> 5 | LARc[3] << 11; > *c++ = sr >> 6; > sr = sr >> 4 | LARc[4] << 12; > sr = sr >> 4 | LARc[5] << 12; > *c++ = sr >> 6; > sr = sr >> 3 | LARc[6] << 13; > sr = sr >> 3 | LARc[7] << 13; > *c++ = sr >> 8; > sr = sr >> 7 | Nc[0] << 9; > sr = sr >> 2 | bc[0] << 14; > *c++ = sr >> 7; > sr = sr >> 2 | Mc[0] << 14; > sr = sr >> 6 | xmaxc[0] << 10; > *c++ = sr >> 7; > sr = sr >> 3 | xmc[0] << 13; > sr = sr >> 3 | xmc[1] << 13; > sr = sr >> 3 | xmc[2] << 13; > *c++ = sr >> 6; > sr = sr >> 3 | xmc[3] << 13; > sr = sr >> 3 | xmc[4] << 13; > *c++ = sr >> 8; > sr = sr >> 3 | xmc[5] << 13; > sr = sr >> 3 | xmc[6] << 13; > sr = sr >> 3 | xmc[7] << 13; > *c++ = sr >> 7; > sr = sr >> 3 | xmc[8] << 13; > sr = sr >> 3 | xmc[9] << 13; > sr = sr >> 3 | xmc[10] << 13; > *c++ = sr >> 6; > sr = sr >> 3 | xmc[11] << 13; > sr = sr >> 3 | xmc[12] << 13; > *c++ = sr >> 8; > sr = sr >> 7 | Nc[1] << 9; > sr = sr >> 2 | bc[1] << 14; > *c++ = sr >> 7; > sr = sr >> 2 | Mc[1] << 14; > sr = sr >> 6 | xmaxc[1] << 10; > *c++ = sr >> 7; > sr = sr >> 3 | xmc[13] << 13; > sr = sr >> 3 | xmc[14] << 13; > sr = sr >> 3 | xmc[15] << 13; > *c++ = sr >> 6; > sr = sr >> 3 | xmc[16] << 13; > sr = sr >> 3 | xmc[17] << 13; > *c++ = sr >> 8; > sr = sr >> 3 | xmc[18] << 13; > sr = sr >> 3 | xmc[19] << 13; > sr = sr >> 3 | xmc[20] << 13; > *c++ = sr >> 7; > sr = sr >> 3 | xmc[21] << 13; > sr = sr >> 3 | xmc[22] << 13; > sr = sr >> 3 | xmc[23] << 13; > *c++ = sr >> 6; > sr = sr >> 3 | xmc[24] << 13; > sr = sr >> 3 | xmc[25] << 13; > *c++ = sr >> 8; > sr = sr >> 7 | Nc[2] << 9; > sr = sr >> 2 | bc[2] << 14; > *c++ = sr >> 7; > sr = sr >> 2 | Mc[2] << 14; > sr = sr >> 6 | xmaxc[2] << 10; > *c++ = sr >> 7; > sr = sr >> 3 | xmc[26] << 13; > sr = sr >> 3 | xmc[27] << 13; > sr = sr >> 3 | xmc[28] << 13; > *c++ = sr >> 6; > sr = sr >> 3 | xmc[29] << 13; > sr = sr >> 3 | xmc[30] << 13; > *c++ = sr >> 8; > sr = sr >> 3 | xmc[31] << 13; > sr = sr >> 3 | xmc[32] << 13; > sr = sr >> 3 | xmc[33] << 13; > *c++ = sr >> 7; > sr = sr >> 3 | xmc[34] << 13; > sr = sr >> 3 | xmc[35] << 13; > sr = sr >> 3 | xmc[36] << 13; > *c++ = sr >> 6; > sr = sr >> 3 | xmc[37] << 13; > sr = sr >> 3 | xmc[38] << 13; > *c++ = sr >> 8; > sr = sr >> 7 | Nc[3] << 9; > sr = sr >> 2 | bc[3] << 14; > *c++ = sr >> 7; > sr = sr >> 2 | Mc[3] << 14; > sr = sr >> 6 | xmaxc[3] << 10; > *c++ = sr >> 7; > sr = sr >> 3 | xmc[39] << 13; > sr = sr >> 3 | xmc[40] << 13; > sr = sr >> 3 | xmc[41] << 13; > *c++ = sr >> 6; > sr = sr >> 3 | xmc[42] << 13; > sr = sr >> 3 | xmc[43] << 13; > *c++ = sr >> 8; > sr = sr >> 3 | xmc[44] << 13; > sr = sr >> 3 | xmc[45] << 13; > sr = sr >> 3 | xmc[46] << 13; > *c++ = sr >> 7; > sr = sr >> 3 | xmc[47] << 13; > sr = sr >> 3 | xmc[48] << 13; > sr = sr >> 3 | xmc[49] << 13; > *c++ = sr >> 6; > sr = sr >> 3 | xmc[50] << 13; > sr = sr >> 3 | xmc[51] << 13; > *c++ = sr >> 8; > } > } > > else > > #endif /* WAV49 */ > { > > *c++ = ((GSM_MAGIC & 0xF) << 4) /* 1 */ > | ((LARc[0] >> 2) & 0xF); > *c++ = ((LARc[0] & 0x3) << 6) > | (LARc[1] & 0x3F); > *c++ = ((LARc[2] & 0x1F) << 3) > | ((LARc[3] >> 2) & 0x7); > *c++ = ((LARc[3] & 0x3) << 6) > | ((LARc[4] & 0xF) << 2) > | ((LARc[5] >> 2) & 0x3); > *c++ = ((LARc[5] & 0x3) << 6) > | ((LARc[6] & 0x7) << 3) > | (LARc[7] & 0x7); > *c++ = ((Nc[0] & 0x7F) << 1) > | ((bc[0] >> 1) & 0x1); > *c++ = ((bc[0] & 0x1) << 7) > | ((Mc[0] & 0x3) << 5) > | ((xmaxc[0] >> 1) & 0x1F); > *c++ = ((xmaxc[0] & 0x1) << 7) > | ((xmc[0] & 0x7) << 4) > | ((xmc[1] & 0x7) << 1) > | ((xmc[2] >> 2) & 0x1); > *c++ = ((xmc[2] & 0x3) << 6) > | ((xmc[3] & 0x7) << 3) > | (xmc[4] & 0x7); > *c++ = ((xmc[5] & 0x7) << 5) /* 10 */ > | ((xmc[6] & 0x7) << 2) > | ((xmc[7] >> 1) & 0x3); > *c++ = ((xmc[7] & 0x1) << 7) > | ((xmc[8] & 0x7) << 4) > | ((xmc[9] & 0x7) << 1) > | ((xmc[10] >> 2) & 0x1); > *c++ = ((xmc[10] & 0x3) << 6) > | ((xmc[11] & 0x7) << 3) > | (xmc[12] & 0x7); > *c++ = ((Nc[1] & 0x7F) << 1) > | ((bc[1] >> 1) & 0x1); > *c++ = ((bc[1] & 0x1) << 7) > | ((Mc[1] & 0x3) << 5) > | ((xmaxc[1] >> 1) & 0x1F); > *c++ = ((xmaxc[1] & 0x1) << 7) > | ((xmc[13] & 0x7) << 4) > | ((xmc[14] & 0x7) << 1) > | ((xmc[15] >> 2) & 0x1); > *c++ = ((xmc[15] & 0x3) << 6) > | ((xmc[16] & 0x7) << 3) > | (xmc[17] & 0x7); > *c++ = ((xmc[18] & 0x7) << 5) > | ((xmc[19] & 0x7) << 2) > | ((xmc[20] >> 1) & 0x3); > *c++ = ((xmc[20] & 0x1) << 7) > | ((xmc[21] & 0x7) << 4) > | ((xmc[22] & 0x7) << 1) > | ((xmc[23] >> 2) & 0x1); > *c++ = ((xmc[23] & 0x3) << 6) > | ((xmc[24] & 0x7) << 3) > | (xmc[25] & 0x7); > *c++ = ((Nc[2] & 0x7F) << 1) /* 20 */ > | ((bc[2] >> 1) & 0x1); > *c++ = ((bc[2] & 0x1) << 7) > | ((Mc[2] & 0x3) << 5) > | ((xmaxc[2] >> 1) & 0x1F); > *c++ = ((xmaxc[2] & 0x1) << 7) > | ((xmc[26] & 0x7) << 4) > | ((xmc[27] & 0x7) << 1) > | ((xmc[28] >> 2) & 0x1); > *c++ = ((xmc[28] & 0x3) << 6) > | ((xmc[29] & 0x7) << 3) > | (xmc[30] & 0x7); > *c++ = ((xmc[31] & 0x7) << 5) > | ((xmc[32] & 0x7) << 2) > | ((xmc[33] >> 1) & 0x3); > *c++ = ((xmc[33] & 0x1) << 7) > | ((xmc[34] & 0x7) << 4) > | ((xmc[35] & 0x7) << 1) > | ((xmc[36] >> 2) & 0x1); > *c++ = ((xmc[36] & 0x3) << 6) > | ((xmc[37] & 0x7) << 3) > | (xmc[38] & 0x7); > *c++ = ((Nc[3] & 0x7F) << 1) > | ((bc[3] >> 1) & 0x1); > *c++ = ((bc[3] & 0x1) << 7) > | ((Mc[3] & 0x3) << 5) > | ((xmaxc[3] >> 1) & 0x1F); > *c++ = ((xmaxc[3] & 0x1) << 7) > | ((xmc[39] & 0x7) << 4) > | ((xmc[40] & 0x7) << 1) > | ((xmc[41] >> 2) & 0x1); > *c++ = ((xmc[41] & 0x3) << 6) /* 30 */ > | ((xmc[42] & 0x7) << 3) > | (xmc[43] & 0x7); > *c++ = ((xmc[44] & 0x7) << 5) > | ((xmc[45] & 0x7) << 2) > | ((xmc[46] >> 1) & 0x3); > *c++ = ((xmc[46] & 0x1) << 7) > | ((xmc[47] & 0x7) << 4) > | ((xmc[48] & 0x7) << 1) > | ((xmc[49] >> 2) & 0x1); > *c++ = ((xmc[49] & 0x3) << 6) > | ((xmc[50] & 0x7) << 3) > | (xmc[51] & 0x7); > > } *** src/gsm_implode.c *** 7c7 < /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/gsm_implode.c,v 1.1 1992/10/28 00:15:50 jutta Exp $ */ --- > /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/gsm_implode.c,v 1.2 1996/07/02 14:32:43 jutta Exp $ */ 101a102,342 > /* There are 76 parameters per frame. The first eight are > * unique. The remaining 68 are four identical subframes of > * 17 parameters each. gsm_implode converts from a representation > * of these parameters as values in one array of signed words > * to the "packed" version of a GSM frame. > */ > > # define LARc source > # define Nc *((gsm_signal (*) [17])(source + 8)) > # define bc *((gsm_signal (*) [17])(source + 9)) > # define Mc *((gsm_signal (*) [17])(source + 10)) > # define xmaxc *((gsm_signal (*) [17])(source + 11)) > > #ifdef WAV49 > if (s->wav_fmt) { > > uword sr = 0; > if (s->frame_index == 0) { > > sr = *c++; > LARc[0] = sr & 0x3f; sr >>= 6; > sr |= (uword)*c++ << 2; > LARc[1] = sr & 0x3f; sr >>= 6; > sr |= (uword)*c++ << 4; > LARc[2] = sr & 0x1f; sr >>= 5; > LARc[3] = sr & 0x1f; sr >>= 5; > sr |= (uword)*c++ << 2; > LARc[4] = sr & 0xf; sr >>= 4; > LARc[5] = sr & 0xf; sr >>= 4; > sr |= (uword)*c++ << 2; /* 5 */ > LARc[6] = sr & 0x7; sr >>= 3; > LARc[7] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 4; > Nc[0] = sr & 0x7f; sr >>= 7; > bc[0] = sr & 0x3; sr >>= 2; > Mc[0] = sr & 0x3; sr >>= 2; > sr |= (uword)*c++ << 1; > xmaxc[0] = sr & 0x3f; sr >>= 6; > #undef xmc > #define xmc (source + 12) > xmc[0] = sr & 0x7; sr >>= 3; > sr = *c++; > xmc[1] = sr & 0x7; sr >>= 3; > xmc[2] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; > xmc[3] = sr & 0x7; sr >>= 3; > xmc[4] = sr & 0x7; sr >>= 3; > xmc[5] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; /* 10 */ > xmc[6] = sr & 0x7; sr >>= 3; > xmc[7] = sr & 0x7; sr >>= 3; > xmc[8] = sr & 0x7; sr >>= 3; > sr = *c++; > xmc[9] = sr & 0x7; sr >>= 3; > xmc[10] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; > xmc[11] = sr & 0x7; sr >>= 3; > xmc[12] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 4; > Nc[1] = sr & 0x7f; sr >>= 7; > bc[1] = sr & 0x3; sr >>= 2; > Mc[1] = sr & 0x3; sr >>= 2; > sr |= (uword)*c++ << 1; > xmaxc[1] = sr & 0x3f; sr >>= 6; > #undef xmc > #define xmc (source + 29 - 13) > xmc[13] = sr & 0x7; sr >>= 3; > sr = *c++; /* 15 */ > xmc[14] = sr & 0x7; sr >>= 3; > xmc[15] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; > xmc[16] = sr & 0x7; sr >>= 3; > xmc[17] = sr & 0x7; sr >>= 3; > xmc[18] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; > xmc[19] = sr & 0x7; sr >>= 3; > xmc[20] = sr & 0x7; sr >>= 3; > xmc[21] = sr & 0x7; sr >>= 3; > sr = *c++; > xmc[22] = sr & 0x7; sr >>= 3; > xmc[23] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; > xmc[24] = sr & 0x7; sr >>= 3; > xmc[25] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 4; /* 20 */ > Nc[2] = sr & 0x7f; sr >>= 7; > bc[2] = sr & 0x3; sr >>= 2; > Mc[2] = sr & 0x3; sr >>= 2; > sr |= (uword)*c++ << 1; > xmaxc[2] = sr & 0x3f; sr >>= 6; > #undef xmc > #define xmc (source + 46 - 26) > xmc[26] = sr & 0x7; sr >>= 3; > sr = *c++; > xmc[27] = sr & 0x7; sr >>= 3; > xmc[28] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; > xmc[29] = sr & 0x7; sr >>= 3; > xmc[30] = sr & 0x7; sr >>= 3; > xmc[31] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; > xmc[32] = sr & 0x7; sr >>= 3; > xmc[33] = sr & 0x7; sr >>= 3; > xmc[34] = sr & 0x7; sr >>= 3; > sr = *c++; /* 25 */ > xmc[35] = sr & 0x7; sr >>= 3; > xmc[36] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; > xmc[37] = sr & 0x7; sr >>= 3; > xmc[38] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 4; > Nc[3] = sr & 0x7f; sr >>= 7; > bc[3] = sr & 0x3; sr >>= 2; > Mc[3] = sr & 0x3; sr >>= 2; > sr |= (uword)*c++ << 1; > xmaxc[3] = sr & 0x3f; sr >>= 6; > #undef xmc > #define xmc (source + 63 - 39) > > xmc[39] = sr & 0x7; sr >>= 3; > sr = *c++; > xmc[40] = sr & 0x7; sr >>= 3; > xmc[41] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; /* 30 */ > xmc[42] = sr & 0x7; sr >>= 3; > xmc[43] = sr & 0x7; sr >>= 3; > xmc[44] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; > xmc[45] = sr & 0x7; sr >>= 3; > xmc[46] = sr & 0x7; sr >>= 3; > xmc[47] = sr & 0x7; sr >>= 3; > sr = *c++; > xmc[48] = sr & 0x7; sr >>= 3; > xmc[49] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; > xmc[50] = sr & 0x7; sr >>= 3; > xmc[51] = sr & 0x7; sr >>= 3; > > s->frame_chain = sr & 0xf; > } > else { > sr = s->frame_chain; > sr |= (uword)*c++ << 4; /* 1 */ > LARc[0] = sr & 0x3f; sr >>= 6; > LARc[1] = sr & 0x3f; sr >>= 6; > sr = *c++; > LARc[2] = sr & 0x1f; sr >>= 5; > sr |= (uword)*c++ << 3; > LARc[3] = sr & 0x1f; sr >>= 5; > LARc[4] = sr & 0xf; sr >>= 4; > sr |= (uword)*c++ << 2; > LARc[5] = sr & 0xf; sr >>= 4; > LARc[6] = sr & 0x7; sr >>= 3; > LARc[7] = sr & 0x7; sr >>= 3; > sr = *c++; /* 5 */ > Nc[0] = sr & 0x7f; sr >>= 7; > sr |= (uword)*c++ << 1; > bc[0] = sr & 0x3; sr >>= 2; > Mc[0] = sr & 0x3; sr >>= 2; > sr |= (uword)*c++ << 5; > xmaxc[0] = sr & 0x3f; sr >>= 6; > #undef xmc > #define xmc (source + 12) > xmc[0] = sr & 0x7; sr >>= 3; > xmc[1] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; > xmc[2] = sr & 0x7; sr >>= 3; > xmc[3] = sr & 0x7; sr >>= 3; > xmc[4] = sr & 0x7; sr >>= 3; > sr = *c++; > xmc[5] = sr & 0x7; sr >>= 3; > xmc[6] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; /* 10 */ > xmc[7] = sr & 0x7; sr >>= 3; > xmc[8] = sr & 0x7; sr >>= 3; > xmc[9] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; > xmc[10] = sr & 0x7; sr >>= 3; > xmc[11] = sr & 0x7; sr >>= 3; > xmc[12] = sr & 0x7; sr >>= 3; > sr = *c++; > Nc[1] = sr & 0x7f; sr >>= 7; > sr |= (uword)*c++ << 1; > bc[1] = sr & 0x3; sr >>= 2; > Mc[1] = sr & 0x3; sr >>= 2; > sr |= (uword)*c++ << 5; > xmaxc[1] = sr & 0x3f; sr >>= 6; > #undef xmc > #define xmc (source + 29 - 13) > xmc[13] = sr & 0x7; sr >>= 3; > xmc[14] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; /* 15 */ > xmc[15] = sr & 0x7; sr >>= 3; > xmc[16] = sr & 0x7; sr >>= 3; > xmc[17] = sr & 0x7; sr >>= 3; > sr = *c++; > xmc[18] = sr & 0x7; sr >>= 3; > xmc[19] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; > xmc[20] = sr & 0x7; sr >>= 3; > xmc[21] = sr & 0x7; sr >>= 3; > xmc[22] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; > xmc[23] = sr & 0x7; sr >>= 3; > xmc[24] = sr & 0x7; sr >>= 3; > xmc[25] = sr & 0x7; sr >>= 3; > sr = *c++; > Nc[2] = sr & 0x7f; sr >>= 7; > sr |= (uword)*c++ << 1; /* 20 */ > bc[2] = sr & 0x3; sr >>= 2; > Mc[2] = sr & 0x3; sr >>= 2; > sr |= (uword)*c++ << 5; > xmaxc[2] = sr & 0x3f; sr >>= 6; > #undef xmc > #define xmc (source + 46 - 26) > xmc[26] = sr & 0x7; sr >>= 3; > xmc[27] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; > xmc[28] = sr & 0x7; sr >>= 3; > xmc[29] = sr & 0x7; sr >>= 3; > xmc[30] = sr & 0x7; sr >>= 3; > sr = *c++; > xmc[31] = sr & 0x7; sr >>= 3; > xmc[32] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; > xmc[33] = sr & 0x7; sr >>= 3; > xmc[34] = sr & 0x7; sr >>= 3; > xmc[35] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; /* 25 */ > xmc[36] = sr & 0x7; sr >>= 3; > xmc[37] = sr & 0x7; sr >>= 3; > xmc[38] = sr & 0x7; sr >>= 3; > sr = *c++; > Nc[3] = sr & 0x7f; sr >>= 7; > sr |= (uword)*c++ << 1; > bc[3] = sr & 0x3; sr >>= 2; > Mc[3] = sr & 0x3; sr >>= 2; > sr |= (uword)*c++ << 5; > xmaxc[3] = sr & 0x3f; sr >>= 6; > #undef xmc > #define xmc (source + 63 - 39) 103c344,365 < #define LARc source --- > xmc[39] = sr & 0x7; sr >>= 3; > xmc[40] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; > xmc[41] = sr & 0x7; sr >>= 3; > xmc[42] = sr & 0x7; sr >>= 3; > xmc[43] = sr & 0x7; sr >>= 3; > sr = *c++; /* 30 */ > xmc[44] = sr & 0x7; sr >>= 3; > xmc[45] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 2; > xmc[46] = sr & 0x7; sr >>= 3; > xmc[47] = sr & 0x7; sr >>= 3; > xmc[48] = sr & 0x7; sr >>= 3; > sr |= (uword)*c++ << 1; > xmc[49] = sr & 0x7; sr >>= 3; > xmc[50] = sr & 0x7; sr >>= 3; > xmc[51] = sr & 0x7; sr >>= 3; > } > } > else > #endif > { 118d379 < #define Nc (source + 8) 122d382 < #define bc (source + 9) 127d386 < #define Mc (source + 10) 131,132d389 < #define xmaxc (source + 11) < 135a393 > #undef xmc 155,156d412 < #undef Nc < #define Nc (source + 25 - 1) 160,161d415 < #undef bc < #define bc (source + 26 - 1) 166,167d419 < #undef Mc < #define Mc (source + 27 - 1) 171,172d422 < #undef xmaxc < #define xmaxc (source + 28 - 1) 197,198d446 < #undef Nc < #define Nc (source + 42 - 2) 202,203d449 < #undef bc < #define bc (source + 43 - 2) 208,209d453 < #undef Mc < #define Mc (source + 44 - 2) 213,214d456 < #undef xmaxc < #define xmaxc (source + 45 - 2) 239,240d480 < #undef Nc < #define Nc (source + 59 - 3) 244,245d483 < #undef bc < #define bc (source + 60 - 3) 250,251d487 < #undef Mc < #define Mc (source + 61 - 3) 255,256d490 < #undef xmaxc < #define xmaxc (source + 62 - 3) 279a514 > } *** src/gsm_option.c *** 7c7 < /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/gsm_option.c,v 1.2 1995/03/07 21:21:24 jutta Exp $ */ --- > /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/gsm_option.c,v 1.3 1996/07/02 09:59:05 jutta Exp $ */ 37a38,61 > #endif > break; > > case GSM_OPT_FRAME_CHAIN: > > #ifdef WAV49 > result = r->frame_chain; > if (val) r->frame_chain = *val; > #endif > break; > > case GSM_OPT_FRAME_INDEX: > > #ifdef WAV49 > result = r->frame_index; > if (val) r->frame_index = *val; > #endif > break; > > case GSM_OPT_WAV49: > > #ifdef WAV49 > result = r->wav_fmt; > if (val) r->wav_fmt = !!*val; *** src/long_term.c *** 7c7 < /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/long_term.c,v 1.4 1995/03/07 21:21:24 jutta Exp $ */ --- > /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/long_term.c,v 1.7 1996/07/02 16:48:43 jutta Exp $ */ 665c665 < for (k = -120; k <= 0; ++k) dp_float[k] = (float)dp[k]; --- > for (k = -120; k < 0; ++k) dp_float[k] = (float)dp[k]; 728c728 < for (k = -120; k <= 0; ++k) dp_float[k] = (float)dp[k]; --- > for (k = -120; k < 0; ++k) dp_float[k] = (float)dp[k]; 910,911c910,911 < register word * erp, /* [0..39] IN */ < register word * drp /* [-120..-1] IN, [0..40] OUT */ --- > register word * erp, /* [0..39] IN */ > register word * drp /* [-120..-1] IN, [-120..40] OUT */ *** src/toast.c *** 7c7 < /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/toast.c,v 1.6 1995/03/07 21:21:24 jutta Exp $ */ --- > /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/toast.c,v 1.8 1996/07/02 10:41:04 jutta Exp $ */ 17,19c17,19 < int f_cat = 0; /* write to stdout, not foo.gsm (-c) */ < int f_force = 0; /* force deletion (-f) */ < int f_precious = 0; /* avoid deletion (-p) */ --- > int f_cat = 0; /* write to stdout; implies -p (-c) */ > int f_force = 0; /* don't ask about replacements (-f) */ > int f_precious = 0; /* avoid deletion of original (-p) */ 328a329 > #ifdef HAS_CHMOD 333a335 > #endif /* HAS_CHMOD */ 342a345 > #ifdef HAS_CHOWN 343a347 > #endif /* HAS_CHOWN */ 461a466,468 > #ifdef HAS__FSETMODE > _fsetmode(in, "b"); > #endif 491a499,501 > #ifdef HAS__FSETMODE > _fsetmode(out, "b"); > #endif 680,682c690 < * Error handling and cleanup: < * - error out: close out, unlink it, close in, free the names. < * - --- > * Error handling and cleanup. 705c713 < "$Id: toast.c,v 1.6 1995/03/07 21:21:24 jutta Exp $" ); --- > "$Id: toast.c,v 1.8 1996/07/02 10:41:04 jutta Exp $" ); *** tls/ginger.c *** 0a1,54 > /* > * Copyright 1996 by Jutta Degener and Carsten Bormann, Technische > * Universitaet Berlin. See the accompanying file "COPYRIGHT" for > * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. > */ > > /*$Header*/ > > /* Generate code to pack a bit array from a name:#bits description */ > > #include > #include "taste.h" > #include "proto.h" > #include > > /* This module is the opposite of sour. Sweet was already taken, > * that's why it's called ginger. (Add one point if that reminds > * you of Gary Larson.) > */ > > #define WORD_BITS 16 /* sizeof(uword) * CHAR_BIT on the > * target architecture---if this isn't 16, > * you're in trouble with this library anyway. > */ > > #define CHAR_BITS 8 /* CHAR_BIT on the target architecture--- > * if this isn't 8, you're in *deep* trouble. > */ > > void write_code P2((s_spex, n_spex), struct spex * s_spex, int n_spex) > { > struct spex * sp = s_spex; > int n_in = 0; > > printf("uword sr = 0;\n"); > > for (; n_spex > 0; n_spex--, sp++) { > > while (n_in < sp->varsize) { > if (n_in) printf("sr |= (uword)*c++ << %d;\n", n_in); > else printf("sr = *c++;\n"); > n_in += CHAR_BITS; > } > > printf("%s = sr & %#x; sr >>= %d;\n", > sp->var, ~(~0U << sp->varsize), sp->varsize); > > n_in -= sp->varsize; > } > > if (n_in > 0) { > fprintf(stderr, "%d bits left over\n", n_in); > } > } *** tls/sour.c *** 0a1,89 > /* > * Copyright 1996 by Jutta Degener and Carsten Bormann, Technische > * Universitaet Berlin. See the accompanying file "COPYRIGHT" for > * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. > */ > > /*$Header*/ > > /* Generate code to pack a bit array from a name:#bits description */ > > #include > #include "taste.h" > #include "proto.h" > #include > > /* This module goes back to one Jeff Chilton used for his implementation > * of the #49 WAV GSM format. (In his original patch 8, it replaced > * bitter.c.) > * > * In Microsoft's WAV #49 version of the GSM format, two 32 1/2 > * byte GSM frames are packed together to make one WAV frame, and > * the GSM parameters are packed into bytes right-to-left rather > * than left-to-right. > * > * That is, where toast's GSM format writes > * > * aaaaaabb bbbbcccc cdddddee ... > * ___1____ ___2____ ___3____ > * > * for parameters a (6 bits), b (6 bits), c (5 bits), d (5 bits), e .. > * the WAV format has > * > * bbaaaaaa ccccbbbb eedddddc ... > * ___1____ ___2____ ___3____ > * > * (This format looks a lot prettier if one pictures octets coming > * in through a fifo queue from the left, rather than waiting in the > * right-hand remainder of a C array.) > */ > > #define WORD_BITS 16 /* sizeof(uword) * CHAR_BIT on the > * target architecture---if this isn't 16, > * you're in trouble with this library anyway. > */ > > #define CHAR_BITS 8 /* CHAR_BIT on the target architecture--- > * if this isn't 8, you're in *deep* trouble. > */ > > void write_code P2((s_spex, n_spex), struct spex * s_spex, int n_spex) > { > struct spex * sp = s_spex; > int n_in = 0; > > printf("uword sr = 0;\n"); > > for (; n_spex > 0; n_spex--, sp++) { > > /* insert old > * new var value unused > * here > * > * [____________xxxxxx**********] > * > * <----- n_in ------> > */ > printf("sr = sr >> %d | %s << %d;\n", > sp->varsize, > sp->var, > WORD_BITS - sp->varsize); > > n_in += sp->varsize; > > while (n_in >= CHAR_BIT) { > printf("*c++ = sr >> %d;\n", > WORD_BITS - n_in); > n_in -= CHAR_BIT; > } > } > > while (n_in >= CHAR_BIT) { > printf("*c++ = sr >> %d;\n", WORD_BITS - n_in); > n_in -= CHAR_BIT; > } > > if (n_in > 0) { > fprintf(stderr, "warning: %d bits left over\n", n_in); > } > } *** tls/sour1.dta *** 0a1,88 > ; > ; Copyright 1992 by Jutta Degener and Carsten Bormann, Technische > ; Universitaet Berlin. See the accompanying file "COPYRIGHT" for > ; details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. > ; > ; > ; Variable Size > > LARc[0] 6 > LARc[1] 6 > LARc[2] 5 > LARc[3] 5 > LARc[4] 4 > LARc[5] 4 > LARc[6] 3 > LARc[7] 3 > > Nc[0] 7 > bc[0] 2 > Mc[0] 2 > xmaxc[0] 6 > xmc[0] 3 > xmc[1] 3 > xmc[2] 3 > xmc[3] 3 > xmc[4] 3 > xmc[5] 3 > xmc[6] 3 > xmc[7] 3 > xmc[8] 3 > xmc[9] 3 > xmc[10] 3 > xmc[11] 3 > xmc[12] 3 > > Nc[1] 7 > bc[1] 2 > Mc[1] 2 > xmaxc[1] 6 > xmc[13] 3 > xmc[14] 3 > xmc[15] 3 > xmc[16] 3 > xmc[17] 3 > xmc[18] 3 > xmc[19] 3 > xmc[20] 3 > xmc[21] 3 > xmc[22] 3 > xmc[23] 3 > xmc[24] 3 > xmc[25] 3 > > Nc[2] 7 > bc[2] 2 > Mc[2] 2 > xmaxc[2] 6 > xmc[26] 3 > xmc[27] 3 > xmc[28] 3 > xmc[29] 3 > xmc[30] 3 > xmc[31] 3 > xmc[32] 3 > xmc[33] 3 > xmc[34] 3 > xmc[35] 3 > xmc[36] 3 > xmc[37] 3 > xmc[38] 3 > > Nc[3] 7 > bc[3] 2 > Mc[3] 2 > xmaxc[3] 6 > xmc[39] 3 > xmc[40] 3 > xmc[41] 3 > xmc[42] 3 > xmc[43] 3 > xmc[44] 3 > xmc[45] 3 > xmc[46] 3 > xmc[47] 3 > xmc[48] 3 > xmc[49] 3 > xmc[50] 3 > xmc[51] 3 *** tls/sour2.dta *** 0a1,90 > ; > ; Copyright 1992 by Jutta Degener and Carsten Bormann, Technische > ; Universitaet Berlin. See the accompanying file "COPYRIGHT" for > ; details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. > ; > ; > ; Variable Size > > g->chain 4 > > LARc[0] 6 > LARc[1] 6 > LARc[2] 5 > LARc[3] 5 > LARc[4] 4 > LARc[5] 4 > LARc[6] 3 > LARc[7] 3 > > Nc[0] 7 > bc[0] 2 > Mc[0] 2 > xmaxc[0] 6 > xmc[0] 3 > xmc[1] 3 > xmc[2] 3 > xmc[3] 3 > xmc[4] 3 > xmc[5] 3 > xmc[6] 3 > xmc[7] 3 > xmc[8] 3 > xmc[9] 3 > xmc[10] 3 > xmc[11] 3 > xmc[12] 3 > > Nc[1] 7 > bc[1] 2 > Mc[1] 2 > xmaxc[1] 6 > xmc[13] 3 > xmc[14] 3 > xmc[15] 3 > xmc[16] 3 > xmc[17] 3 > xmc[18] 3 > xmc[19] 3 > xmc[20] 3 > xmc[21] 3 > xmc[22] 3 > xmc[23] 3 > xmc[24] 3 > xmc[25] 3 > > Nc[2] 7 > bc[2] 2 > Mc[2] 2 > xmaxc[2] 6 > xmc[26] 3 > xmc[27] 3 > xmc[28] 3 > xmc[29] 3 > xmc[30] 3 > xmc[31] 3 > xmc[32] 3 > xmc[33] 3 > xmc[34] 3 > xmc[35] 3 > xmc[36] 3 > xmc[37] 3 > xmc[38] 3 > > Nc[3] 7 > bc[3] 2 > Mc[3] 2 > xmaxc[3] 6 > xmc[39] 3 > xmc[40] 3 > xmc[41] 3 > xmc[42] 3 > xmc[43] 3 > xmc[44] 3 > xmc[45] 3 > xmc[46] 3 > xmc[47] 3 > xmc[48] 3 > xmc[49] 3 > xmc[50] 3 > xmc[51] 3 *** tls/sweet.c *** 7c7 < /*$Header: /home/kbs/jutta/src/gsm/gsm-1.0/tls/RCS/sweet.c,v 1.1 1992/10/28 00:28:39 jutta Exp $*/ --- > /*$Header: /home/kbs/jutta/src/gsm/gsm-1.0/tls/RCS/sweet.c,v 1.2 1996/07/02 10:15:53 jutta Exp $*/ 36c36 < --- > *** tst/cod2lin.c *** 7c7 < /*$Header: /home/kbs/jutta/src/gsm/gsm-1.0/tst/RCS/cod2lin.c,v 1.1 1992/10/28 00:32:06 jutta Exp $*/ --- > /*$Header: /home/kbs/jutta/src/gsm/gsm-1.0/tst/RCS/cod2lin.c,v 1.2 1996/07/02 14:33:10 jutta Exp $*/ 19a20 > int wav = 0; 24c25 < fprintf(stderr, "Usage: %s [-vF] [files...]\n", pname); --- > fprintf(stderr, "Usage: %s [-vwF] [files...]\n", pname); 44c45,46 < gsm_option(r, GSM_OPT_FAST, &fast); --- > gsm_option(r, GSM_OPT_FAST, &fast); > gsm_option(r, GSM_OPT_WAV49, &wav); 82c84 < while ((opt = getopt(ac, av, "vF")) != EOF) switch (opt) { --- > while ((opt = getopt(ac, av, "vwF")) != EOF) switch (opt) { 83a86 > case 'w': wav++; break; *** tst/lin2cod.c *** 7c7 < /*$Header: /home/kbs/jutta/src/gsm/gsm-1.0/tst/RCS/lin2cod.c,v 1.1 1992/10/28 00:32:06 jutta Exp $*/ --- > /*$Header: /home/kbs/jutta/src/gsm/gsm-1.0/tst/RCS/lin2cod.c,v 1.2 1996/07/02 14:33:13 jutta Exp $*/ 18a19 > int wav = 0; 23c24 < fprintf(stderr, "Usage: %s [-vF] [files...]\n", pname); --- > fprintf(stderr, "Usage: %s [-vwF] [files...]\n", pname); 40a42 > gsm_option(r, GSM_OPT_WAV49, &wav); 83c85 < while ((opt = getopt(ac, av, "vF")) != EOF) switch (opt) { --- > while ((opt = getopt(ac, av, "vwF")) != EOF) switch (opt) { 84a87 > case 'w': wav++; break; *** tst/run *** 16c16 < ./lin2cod < $i.inp | cmp - $i.cod --- > ./lin2cod < $i.inp | cmp - $i.cod