README 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. Opus is a codec for interactive speech and audio transmission over the Internet.
  2. Opus can handle a wide range of interactive audio applications, including
  3. Voice over IP, videoconferencing, in-game chat, and even remote live music
  4. performances. It can scale from low bit-rate narrowband speech to very high
  5. quality stereo music.
  6. The IETF draft covering Opus can be found at:
  7. http://tools.ietf.org/id/draft-ietf-codec-opus
  8. Opus is subject to the royalty-free patent and copyright licenses specified
  9. in the file COPYING.
  10. This package implements a shared library for encoding and decoding raw Opus
  11. bitstreams. Raw Opus bitstreams should be used over RTP according to
  12. http://tools.ietf.org/html/draft-spittka-payload-rtp-opus
  13. The package also includes a number of test tools used for testing the
  14. correct operation of the library. The bitstreams read/written by these
  15. tools should not be used for Opus file distribution: They include
  16. additional debugging data and cannot support seeking.
  17. Opus stored in files should use the Ogg encapsulation for Opus which is
  18. described at:
  19. http://wiki.xiph.org/OggOpus
  20. An opus-tools package is available which provides encoding and decoding of
  21. Ogg encapsulated Opus files and includes a number of useful features.
  22. Opus-tools can be found at:
  23. http://git.xiph.org/?p=users/greg/opus-tools.git
  24. == Compiling libopus ==
  25. To build from a distribution tarball, you only need to do the following:
  26. % ./configure
  27. % make
  28. To build from the git repository, the following steps are necessary:
  29. 1) Clone the repository:
  30. % git clone git://git.opus-codec.org/opus.git
  31. % cd opus
  32. 1) Compiling
  33. % ./autogen.sh
  34. % ./configure
  35. % make
  36. Once you have compiled the codec, there will be a opus_demo executable in
  37. the top directory.
  38. Usage: opus_demo [-e] <application> <sampling rate (Hz)> <channels (1/2)>
  39. <bits per second> [options] <input> <output>
  40. opus_demo -d <sampling rate (Hz)> <channels (1/2)> [options]
  41. <input> <output>
  42. mode: voip | audio | restricted-lowdelay
  43. options:
  44. -e : only runs the encoder (output the bit-stream)
  45. -d : only runs the decoder (reads the bit-stream as input)
  46. -cbr : enable constant bitrate; default: variable bitrate
  47. -cvbr : enable constrained variable bitrate; default: unconstrained
  48. -bandwidth <NB|MB|WB|SWB|FB> : audio bandwidth (from narrowband to fullband);
  49. default: sampling rate
  50. -framesize <2.5|5|10|20|40|60> : frame size in ms; default: 20
  51. -max_payload <bytes> : maximum payload size in bytes, default: 1024
  52. -complexity <comp> : complexity, 0 (lowest) ... 10 (highest); default: 10
  53. -inbandfec : enable SILK inband FEC
  54. -forcemono : force mono encoding, even for stereo input
  55. -dtx : enable SILK DTX
  56. -loss <perc> : simulate packet loss, in percent (0-100); default: 0
  57. input and output are little-endian signed 16-bit PCM files or opus bitstreams
  58. with simple opus_demo proprietary framing.
  59. == Testing ==
  60. This package includes a collection of automated unit and system tests
  61. which should be run after compiling the package especially the first
  62. time it is run on a new platform.
  63. To run the integrated tests:
  64. % make check
  65. There is also collection of standard test vectors which are not
  66. included in this package for size reasons but can be obtained from:
  67. http://opus-codec.org/testvectors/opus_testvectors-draft11.tar.gz
  68. To run compare the code to these test vectors:
  69. % tar -zxf opus_testvectors-draft11.tar.gz
  70. % ./tests/run_vectors.sh ./ opus_testvectors 48000
  71. == Portability notes ==
  72. This implementation uses floating-point by default but can be compiled to
  73. use only fixed-point arithmetic by setting --enable-fixed-point (if using
  74. autoconf) or by defining the FIXED_POINT macro (if building manually).
  75. The fixed point implementation has somewhat lower audio quality and is
  76. slower on platforms with fast FPUs, it is normally only used in embedded
  77. environments.
  78. The implementation can be compiled with either a C89 or a C99 compiler.
  79. While it does not rely on any _undefined behavior_ as defined by C89 or
  80. C99, it relies on common _implementation-defined behavior_ for two's
  81. complement architectures:
  82. o Right shifts of negative values are consistent with two's
  83. complement arithmetic, so that a>>b is equivalent to
  84. floor(a/(2^b)),
  85. o For conversion to a signed integer of N bits, the value is reduced
  86. modulo 2^N to be within range of the type,
  87. o The result of integer division of a negative value is truncated
  88. towards zero, and
  89. o The compiler provides a 64-bit integer type (a C99 requirement
  90. which is supported by most C89 compilers).