bitter.1

来自「数字语音编码中的GSM编码C语言程序」· 1 代码 · 共 71 行

1
71
字号
.\".\" 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..\".PU.TH BITTER 1 .SH NAMEbitter, sweet \(em code-generators for packing bits.SH SYNOPSISbitter < input > output.brsweet < input > output.SH "DESCRIPTION"Bitter and sweet are two filters which turn a description of theform .nf	name	number-of-bits	name 	number-of-bits	....nfinto code..PPBitter generates code that packs the specified bits from theirvariables into an array of unsigned char referenced by anadvancing pointer c..PPSweet generates code that unpacks the specified bits from an arrayof unsigned char referenced by a mutable pointer c into thenamed variables..\" .SH OPTIONS.\" .SH "RETURN VALUE".\" .SH ERRORS.SH EXAMPLES.nf% cat inamaretto 1banana 2cherry 3strawberry 4vanilla 15walnut 15% bitter < in	*c++ =   ((amaretto & 0x1) << 7)	       | ((banana & 0x3) << 5)	       | ((cherry & 0x7) << 2)	       | ((strawberry >> 2) & 0x3);	*c++ =   ((strawberry & 0x3) << 6)	       | ((vanilla >> 9) & 0x3F);	*c++ =   ((vanilla >> 1) & 0xFF);	*c++ =   ((vanilla & 0x1) << 7)	       | ((walnut >> 8) & 0x7F);	*c++ =   walnut & 0xFF;% sweet < in	amaretto  = (*c >> 7) & 0x1;	banana  = (*c >> 5) & 0x3;	cherry  = (*c >> 2) & 0x7;	strawberry  = (*c++ & 0x3) << 2;	strawberry |= (*c >> 6) & 0x3;	vanilla  = (*c++ & 0x3F) << 9;	vanilla |= (*c++ & 0xFF) << 1;	vanilla |= (*c >> 7) & 0x1;	walnut  = (*c++ & 0x7F) << 8;	walnut |= *c++;.SH NOTESThis is a quick hack for the gsm_encode() and gsm_decode() routines..SH BUGSPlease direct bug reports to jutta@cs.tu-berlin.de and cabo@cs.tu-berlin.de.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?