readme.txt 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. ====================================================================================
  2. AMR Wideband Codec 3GPP TS26.173 / ITU-T G.722.2, Mar 20, 2007. Version 7.0.0, 8.0.0 and 9.0.0
  3. ====================================================================================
  4. These files represent the 3GPP/ITU AMR WB Speech Coder Bit-Exact C simulation.
  5. All code is written in ANSI-C. The system is implemented as two separate
  6. programs:
  7. coder Speech Encoder
  8. decoder Speech Decoder
  9. For encoding using the coder program, the input is a binary
  10. speech file (*.inp) and the output is a binary encoded parameter file
  11. (*.cod). For decoding using the decoder program, the input is a binary
  12. parameter file (*.cod) and the output is a binary synthesized speech
  13. file (*.out).
  14. FILE FORMATS:
  15. =============
  16. The file format of the supplied binary data (*.inp, *.cod, *.out)
  17. is 16-bit binary data which is read and written in 16 bit words.
  18. The data is therefore platform DEPENDENT.
  19. The files contain only data, i.e., there is no header.
  20. The test files included in this package are "PC" format, meaning that the
  21. least signification byte of the 16-bit word comes first in the files.
  22. If the software is to be run on some other platform than PC,
  23. such as an HP (HP-UX) or a Sun, then binary files will need to be modified
  24. by swapping the byte order in the files.
  25. The input (*.inp) and output files (*.out) are 16-bit signed binary files with 16 kHz
  26. sampling rate with no headers.
  27. The Speech Encoder produces bitstream files which are as follows:
  28. For every 20 ms input speech frame, the encoded bitstream using default format
  29. or ITU format contains the following data:
  30. Using default format:
  31. Word16 TXRXFLAG
  32. Word16 FrameType
  33. Word16 Mode
  34. Word16 1st Databit
  35. Word16 2nd DataBit
  36. .
  37. .
  38. .
  39. Word16 Nth DataBit
  40. Using ITU format:
  41. Word16 SyncWord
  42. Word16 DataLen
  43. Word16 1st Databit
  44. Word16 2nd DataBit
  45. .
  46. .
  47. .
  48. Word16 Nth DataBit
  49. where the TXRXFLAG tells whether the frame is input from the speech encoder or
  50. from the output of the channel decoder.
  51. For Speech encoder the Flag is 0x6B21 and for channel decoder the flag is 0x6B20
  52. The frametype tells whether the frame is speech, SID_FIRST, SID_UPDATE etc.
  53. The frame types are the same than used in the existing ETSI AMR narrow band codec.
  54. For more details on these frametype, refer to the AMR NB documentation.
  55. The mode can be from 0 to 8, corresponding bit rated from 6.6 kbit/s to 23.85 kbit/s.
  56. Finally, there is N databits where the N is the number of bits per frame for each
  57. mode. So for 6.6 kbit/s mode, there are 132 databits.
  58. Each bit is presented in the default format as follows: Bit 0 = -127, Bit 1 = 127.
  59. end in the ITU format as follows: Bit 0 = 0x007f, Bit 1 = 0x0081.
  60. The SyncWord from the encoder is always 0x6b21. If decoder receives SyncWord as 0x6b20
  61. it indicates that the current frame was received in error (bad frame).
  62. The DataLen parameter gives the number of speech data bits in the frame. For example using
  63. dxt, DataLen for NO_DATA frames is zero, Each bit is presented as follows: Bit 0 = -127, Bit 1 = 127.
  64. When using the MIME file storage format the encoded bitstream file starts with
  65. 9-byte magic number "#!AMR-WB\n", followed by the following data for each 20 ms
  66. input speech frame
  67. UWord8 Frame header
  68. UWord8 1st speech data octet
  69. .
  70. .
  71. .
  72. UWord8 Nth speech data octet
  73. where the frame header includes mode information and the quality bit, and the
  74. speech data octets contain the packed and sorted encoded speech bits. See RFC3267
  75. (sections 5.1 and 5.3) for the details of this format.
  76. INSTALLING THE SOFTWARE
  77. =======================
  78. Installing the software on the PC:
  79. First unpack the testv.zip and the c-code.zip into your directory. After that you
  80. should have the following structure:
  81. <your_dir>
  82. <testv>
  83. *.bat
  84. *.inp
  85. *.cod
  86. *.out
  87. <c-code>
  88. makefile.gcc
  89. *.c
  90. *.h
  91. *.tab
  92. readme.txt
  93. The package include makefile for gcc, which have been tested with gcc in
  94. Windows NT msdos-box.
  95. The code can be compiled in the dos-prompt by entering the directory c-code
  96. and typing the command: make -f makefile.gcc (assuming you have gcc installed)
  97. It is probably quite straightforward to use the same make file with other
  98. systems having gcc or a standard ANSI-C compiler with only small modifications.
  99. The codec has been also successfully compiled with the
  100. Microsoft Visual C++ version 6.0.
  101. RUNNING THE SOFTWARE
  102. ====================
  103. The usage of the "coder" program is as follows:
  104. Usage:
  105. coder [-dtx] [-itu | -mime] <mode> <speech_file> <bitstream_file>
  106. The DTX is activated by typing the optional switch "-dtx". By default, the DTX is not active.
  107. The ITU bit stream format is activated by typing the optional switch "-itu".
  108. Alternatively, the MIME file storage format output can be activated by using
  109. optional switch "-mime". By default, neither the ITU nor the MIME format is active.
  110. The mode is from 0 to 8 correspond the following bit-rates:
  111. 0 = 6.6 kbit/s, 1 = 8.85 kbit/s, 2 = 12.65 kbit/s, 3 = 14.25 kbit/s, 4 = 15.85 kbit/s
  112. 5 = 18.25 kbit/s, 6 = 19.85 kbit/s, 7 = 23.05 kbit/s, 8 = 23.85 kbit/s
  113. The usage of the "decoder" program is as follows:
  114. Usage:
  115. decoder [-itu | -mime] <bitstream_file> <synth_file>
  116. The ITU bit stream format is activated by typing the optional switch "-itu".
  117. Alternatively, the MIME file storage format can be activated by using the
  118. switch "-mime". By default, neither the ITU nor the MIME format is active.
  119. TESTING THE SOFTWARE
  120. ====================
  121. There are two verification scripts for PC:
  122. test_enc.bat for Speech Encoder
  123. test_dec.bat for Speech Decoder
  124. Both test all the 9 speech codec modes with DTX enabled using the default bitstream format.
  125. The compare commands at the end of this file should yield no differences.