⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gsm_option.3

📁 GSM 6.10语音压缩算法
💻 3
字号:
.\".\" Copyright 1992-1995 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 GSM_OPTION 3 .SH NAMEgsm_option \(em customizing the GSM 06.10 implementation.SH SYNOPSIS#include "gsm.h".PPint gsm_option(handle, option, valueP);.brgsm handle;.brint option;.brint * valueP;.SH "DESCRIPTION"The gsm library is an implementation of the final draft GSM 06.10standard for full-rate speech transcoding, a lossyspeech compression algorithm..PPThe gsm_option() function can be used to set and query variousoptions or flags that are not needed for regular GSM 06.10 encodingor decoding, but might be of interest in special cases..PPThe second argument to gsm_option specifies what parametershould be changed or queried.The third argument is either a null pointer, in which casethe current value of that parameter is returned;or it is a pointer to an integer containing the valueyou want to set, in which case the previous value willbe returned..PPThe following options are defined:.PP.I GSM_OPT_VERBOSEVerbosity level..br.in+5This option is only supported if the library was compiledwith debugging turned on, and may be used by developers ofcompression algorithms to aid debugging..brThe verbosity level can be changed at any time during encoding or decoding..in-5.sp.PP.I GSM_OPT_FASTFaster compression algorithm..br.in+5This implementation offers a not strictly standard-compliant, butfaster compression algorithm that is compatible with the regularmethod and does not noticably degrade audio quality..brThe value passed to .br.nf	gsm_option(handle, GSM_OPT_FAST, & value).fi.br functions as a boolean flag; if it is zero, the regular algorithmwill be used, if not, the faster version will be used..brThe availability of this option depends on the hardware used;if it is not available, gsm_option will return -1 on an attemptto set or query it..brThis option can be set any time during encoding or decoding..in-5.ne 5.sp.PP.I GSM_OPT_LTP_CUTEnable, disable, or query the LTP cut-off optimization..br.in+5During encoding, the search for the long-term correlationlag forms the bottleneck of the algorithm. The ltp-cut option enables an approximation that disregards mostof the samples for purposes of finding that correlation,and hence speeds up the encoding at a noticable loss in quality..brThe value passed to .br.nf	gsm_option(handle, GSM_OPT_LTP_CUT, & value).fi.br turns the optimization on if nonzero, and off if zero..brThis option can be set any time during encodingor decoding; it will only affect the encoding pass, notthe decoding..sp.PP.I GSM_OPT_WAV49WAV-style byte ordering..br.in+5A WAV file of type #49 contains GSM 06.10-encoded frames.Unfortunately, the framing and code ordering of the WAV versionare incompatible with the native ones of this GSM 06.10 library.The GSM_OPT_WAV49 option turns on a different packingalgorithm that produces alternating frames of 32 and 33 bytes(or makes it consume alternating frames of 33 and 32 bytes, notethe 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 producecomplete WAV files..brThe 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 nativeframing algorithm will be used, if nonzero, WAV-type packing is in effect..brThis option should be used before any frames are encoded.Whether or not it is supported at all depends on acompile-time switch, WAV49.Both option and compile time switch are new to the libraryas of patchlevel 9, and are considerably less tested than thewell-worn rest of the it..brThanks to Jeff Chilton for the detective work and first freeimplementation of this version of the GSM 06.10 encoding..sp.PP.I GSM_OPT_FRAME_CHAINQuery or set the chaining byte..br.in+5Between the two frames of a WAV-style encoding, the GSM 06.10 librarymust keep track of one half-byte that is technically part of the firstframe, 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_INDEXQuery or set the current frame's index in a format'salternating list of frames..br.in+5The 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 frameof 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 frameswithin a format like WAV #49 (not accounting for the lostinternal GSM state)..in-5.SH "RETURN VALUE"gsm_option() returns -1 if an option is not supported, theprevious value of the option otherwise..SH BUGSPlease direct bug reports to jutta@cs.tu-berlin.de and cabo@cs.tu-berlin.de..SH "SEE ALSO"toast(1), gsm(3), gsm_explode(3), gsm_print(3)

⌨️ 快捷键说明

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