READ.ME
上传用户:meifeng08
上传日期:2013-06-18
资源大小:5304k
文件大小:7k
源码类别:

语音压缩

开发平台:

C/C++

  1. /* G.729a  Version 1.1    Last modified: September 1996 */
  2. TITLE
  3. -----
  4. Fixed-point description of Recommendation G.729A
  5. Coding of Speech at 8 kbit/s using Conjugate-Structure
  6. Algebraic-Code-Excited Linear-Prediction (CS-ACELP)
  7. SOFTWARE AND INTELLECTUAL PROPERTY
  8. ----------------------------------
  9. This software package is provided as part of ITU-T Recommendation G.729A.
  10.    Copyright (c) 1996,
  11.    AT&T, France Telecom, NTT, Universite de Sherbrooke
  12.    All rights reserved.
  13. The copy of the source C code, version 1.1, is given under Copyright of the
  14. authors, only for the purpose of establishing the specification of a codec.
  15. VERSION
  16. -------
  17. This is version 1.1.
  18. Changes from version 1.0:
  19. -The decoder (decoder.c) now use the same way of detecting the frame erasure
  20.  than the G.729. This have change one of the test vectors "overflow.pst".
  21. -Add some initializations of variable to remove warning from some compilers.
  22. -In typedef.h add the compiler (_TURBOC_).
  23. DESCRIPTION
  24. -----------
  25.   This package includes the files needed to build the fixed point version
  26. of the G.729A codec.
  27.  It includes also the PC executable (coder.exe and decoder.exe), a batch file
  28. (test.bat), speech (test.inp) and data files (test.bit and test.syn) to verify
  29. the execution. More files (test vectors) are available to verify the
  30. bit-exactness of the implementation. They are presently available at the
  31. following ftp site:
  32. ftp.research.bell_labs.com
  33. login: anonymous
  34. cd /dist/g729a
  35. The zip file "TV729APC.ZIP" contains the PC version of the test vectors.
  36. SIMILARITIES AND DIFFERENCES WITH G.729
  37. ---------------------------------------
  38.  The serial stream of this version is directly interoperable with the G729.
  39. Common files with G.729:
  40. ~~~~~~~~~~~~~~~~~~~~~~~~
  41. basic_op.c
  42. basic_op.h
  43. oper_32b.c
  44. oper_32b.h
  45. pre_proc.c
  46. post_pro.c
  47. bits.c
  48. util.c
  49. filter.c
  50. dspfunc.c
  51. qua_lsp.c
  52. lspdec.c
  53. lspgetq.c
  54. qua_gain.c
  55. dec_gain.c
  56. gainpred.c
  57. de_acelp.c
  58. pred_lt3.c
  59. p_parity.c
  60. dec_lag3.c
  61. Files will small changes from G.729:
  62. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  63. lpc.c
  64.     ->In function Az_lsp() division of the interval by 2 instead of 4.
  65.     Note: The vectors rc[] and old_rc[] of the function Levinson()
  66.           are not used in the G.729A version. These vectors were kept
  67.           to minimize the difference between the G.729 and the G.729A.
  68.           If you implement only the G.729a version, you could remove
  69.           these vectors.
  70. lpcfunc.c
  71.     ->Function Int_lpc() removed.
  72.     ->Function Int_qlpc() is different.
  73. coder.c and decoder.c
  74.    ->Call to functions with differents names.
  75.    ->The switch HARW and SYNC have been removed. These switch were
  76.      for development and testing purpose only.
  77. Files changed from G.729:
  78. ~~~~~~~~~~~~~~~~~~~~~~~~~
  79. ld8a.h      replace  ld8k.h
  80. cod_ld8a.c  replace  cod_ld8k.c
  81. dec_ld8a.c  replace  dec_ld8k.c
  82. acelp_ca    replace  acelp_co.c (New fixed codebook search)
  83. tab_ld8a.h  replace  tab_ld8k.h
  84. tab_ld8a.c  replace  tab_ld8k.c
  85. postfilt.c  replace  pst.c
  86. pitch_a.c   replace  pitch.c (New pitch functions)
  87. New files:
  88. ~~~~~~~~~~
  89. taming.c    The taming functions have been removed from the file
  90.             cod_ld8k.c(G.729) and put together in file taming.c
  91. cor_func.c  Contains functions:
  92.             Corr_xy2() previously in file cod_ld8k.c (G.729)
  93.             Cor_h_x()  previously in file acelp_co.c (G.729)
  94.                        Now also used by the pitch functions.
  95. COMPILATION
  96. -----------
  97. Edit the file typedef.h to comply to your target platform
  98. For UNIX systems the following makefiles are provided
  99.    coder.mak
  100.    decoder.mak
  101. Edit the makefiles coder.mak and decoder.mak to set the proper options
  102. for your system.
  103. The command to compile and link all code on a UNIX system is
  104.      make -f coder.mak
  105.      make -f decoder.mak
  106. For other platforms, the *.mak files can be used to work out the
  107. compilation procedures.
  108. This code has been successfully compiled and run on the following
  109. platforms:
  110. Platform                   Operating System      Compiler
  111. -----------------------------------------------------------------------------
  112. DEC ALPHA                  OSF/1                 DEC OSF/1 cc
  113. PC                         DOS 6.21              Microsoft QuickC
  114.                                                  Borland 3.1
  115.                                                  Watcom 9.6
  116.                                                  Microsoft 8
  117.                                                  MS Visual C++ 1.5
  118. USAGE
  119. -----
  120. The following files are used or generated
  121.   inputfile    8 kHz sampled data file 16 bit PCM (binary)
  122.   outputfile   8 kHz sampled data file 16 bit PCM (binary)
  123.   bitstreamfile  binary file containing bitstream
  124. coder  inputfile bitstreamfile
  125. decoder bitstreamfile outputfile
  126. BITSTREAM FORMAT
  127. ----------------
  128. The bitstreamfile contains for each 10 ms speech frame,
  129. 82 16-bit words.
  130. The first word is the syncword SYNC_WORD
  131. The second word is the framesize and contains the fixed value 80
  132. The next 80 words contain the following parameters:
  133. 01      LPC1-   MA predictor switch
  134. 02      LPC1-   1st codebook           7 bit
  135. 03      LPC1-
  136. 04      LPC1-
  137. 05      LPC1-
  138. 06      LPC1-
  139. 07      LPC1-
  140. 08      LPC1-
  141. 09      LPC2-   2nd codebook  low         5 bit
  142. 10      LPC2-
  143. 11      LPC2-
  144. 12      LPC2-
  145. 13      LPC2-
  146. 14      LPC2-   2nd codebook  high         5 bit
  147. 15      LPC2-
  148. 16      LPC2-
  149. 17      LPC2-
  150. 18      LPC2-
  151. 19      M_1     pitch period                8 bit
  152. 20      M_1
  153. 21      M_1
  154. 22      M_1
  155. 23      M_1
  156. 24      M_1
  157. 25      M_1
  158. 26      M_1
  159. 27              parity check on 1st period  1 bit
  160. 28      CB_1    codebook pulse positions    13 bit
  161. 29      CB_1
  162. 30      CB_1
  163. 31      CB_1
  164. 32      CB_1
  165. 33      CB_1
  166. 34      CB_1
  167. 35      CB_1
  168. 36      CB_1
  169. 37      CB_1
  170. 38      CB_1
  171. 39      CB_1
  172. 40      CB_1
  173. 41      S_1     codebook pulse signs       4 bit
  174. 42      S_1
  175. 43      S_1
  176. 44      S_1
  177. 45      G_1     pitch and codebook gains  3 bit stage 1
  178. 46      G_1
  179. 47      G_1
  180. 48      G_1     pitch and codebook gains  4 bit stage 2
  181. 49      G_1
  182. 50      G_1
  183. 51      G_1
  184. 52      M_2     pitch period (relative)     5 bit
  185. 53      M_2
  186. 54      M_2
  187. 55      M_2
  188. 56      M_2
  189. 57      CB_2    codebook pulse positions    13 bit
  190. 58      CB_2
  191. 59      CB_2
  192. 60      CB_2
  193. 61      CB_2
  194. 62      CB_2
  195. 63      CB_2
  196. 64      CB_2
  197. 65      CB_2
  198. 66      CB_2
  199. 67      CB_2
  200. 68      CB_2
  201. 69      CB_2
  202. 70      S_2     codebook pulse signs       4 bit
  203. 71      S_2
  204. 72      S_2
  205. 73      S_2
  206. 74      G_2     pitch and codebook gains  3 bit stage 1
  207. 75      G_2
  208. 76      G_2
  209. 77      G_2     pitch and codebook gains  4 bit stage 2
  210. 78      G_2
  211. 79      G_2
  212. 80      G_2
  213. Bitstream information - all parameters start with msb
  214. The bits are defined as follows:
  215. #define SYNC_WORD (short)0x6b21
  216. #define BIT_0     (short)0x007f /* definition of zero-bit in bit-stream     */
  217. #define BIT_1     (short)0x0081 /* definition of one-bit in bit-stream      */