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

📄 eid-xor.c

📁 Reference Implementation of G.711 standard and other voice codecs
💻 C
字号:
/*                                                           09.JUNE.05 v1.1   =========================================================================   eid-xor.c   ~~~~~~~~~~   Program Description:   ~~~~~~~~~~~~~~~~~~~~   This example program performs a "logical" exclusive-or operation of   a file (representing an encoded speech bitstream) with another file   (representing a bit error pattern.   The file containing an encoded speech bitstream can be in a compact   binary format, in the G.192 serial bitstream format (which uses   16-bit softbits), or in the byte-oriented G.192 format.   The file containing the error pattern will be in one of three   possible formats: G.192 16-bit softbit format (without synchronism   header for bit errors), byte-oriented version of the G.192 format,   and compact, hard-bit binary (bit) mode. These are described in the   following.   The headerless G.192 serial bitstream format is as described in   G.192, with the exceptions listed below. The main feature is that   the softbits and frame erasure indicators are right-aligned at   16-bit word boundaries (unsigned short):    '0'=0x007F and '1'=0x0081, and good/bad frame = 0x6B21/0x6B20   In the byte-oriented softbit serial bitstream, only the lower byte   of the softbits defined in G.192 are used. Hence:   '0'=0x7F and '1'=0x81, and good/bad frame = 0x21/0x20   In the compact (bit) mode, only hard bits are saved. Each byte will   have information about eight bits or frames. The LBbs will refer to   bits or frames that occur first in time. Here, '1' means that a bit   is in error or that a frame should be erased, and a '0', otherwise.   Conventions:   ~~~~~~~~~~~~   Bitstreams can be disturbed in two ways: by bit errors, or by frame   erasures. The STL EID supports three basic modes: random/bit errors   (labeled BER), simple frame erasure (labeled FER), and Bellcore   model burst frame erasure (labeled BFER). Here are some conventions   that apply to the particular formats for each of these three EID   operating modes.   BER: bitstream generated by this program are composed of bits 1/0,        *without* synchronism headers or any other frame delimitation        (i.e., only bits affecting the payload are present). Frame        boundaries are defined by the user's application only. The        following applies:        G.192 mode: file will contain either 0x007F (no disturbance) or	            0x0081 (bit error)        Byte mode:  file will contain either 0x7F (no disturbance) or	            0x81 (bit error)        Compact mode: each bit in the file will indicate whether a	            disturbance occurred (bit 1) or not (bit 0).		    Lower order bits apply to bits occurring first	            in time.   FER/BFER: bitstream generate by this program is composed only by        the indication of whether a frame should be erased or not. No        payload is present. The following applies:        G.192 mode: file will contain either 0x6B21 (no disturbance) or	            0x6B20 (frame erasure)        Byte mode:  file will contain either 0x21 (no disturbance) or	            0x20 (frame erasure)        Compact mode: each bit in the file will indicate whether a	            frame erasure occurred (bit 1) or not (bit 0).		    Lower order bits apply to bits occurring first	            in time.   Usage:   ~~~~~   eid-xor [Options] in_bs err_pat_bs out_bs   Where:   in_bs ...... input encoded speech bitstream file   err_pat .... error pattern bitstream file   out_bs ..... disturbed encoded speech bitstream file       Options:   -frame # ... Set the frame size to #. Necessary for headerless G.192                bitstreams or for compact binary files.   -bs mode ... Mode for bitstream (g192, byte, or bit)   -ep mode ... Mode for error pattern (g192, byte, or bit)   -ber ....... Error pattern is a bit error pattern (needed for bit format)   -fer ....... Error pattern is a frame erasure pattern (for bit format)   -vbr ....... Enables variable bit rate operation   -q ......... Quiet operation   -? ......... Displays this message   -help ...... Displays a complete help message   Original Author:   ~~~~~~~~~~~~~~~~   Simao Ferraz de Campos Neto   Comsat Laboratories                  Tel:    +1-301-428-4516   22300 Comsat Drive                   Fax:    +1-301-428-9287   Clarksburg MD 20871 - USA            E-mail: simao@ctd.comsat.com   History:   ~~~~~~~~   15.Aug.97 v.1.0 Created based on eid-xor.c <simao.campos@comsat.com>
   09.Jun.05 v.1.1 Bug correction during EP file reading. <Cyril Guillaum

⌨️ 快捷键说明

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