Bcg729 is an opensource implementation of both encoder and decoder of the ITU G729 Annex A/B speech codec.
The library written in C 99 is fully portable and can be executed on many platforms including both ARM and x86 processors. libbcg729 supports concurrent channels encoding/decoding for multi call application such as conferencing.
For more information, please visit bcg729's homepage on linphone.org.
Copyright © Belledonne Communications
bcg729 is dual licensed, and is available either :
-
under a GNU/GPLv3 license, for free (open source). Please make sure that you understand and agree with the terms of this license before using it (see LICENSE.txt file for details).
-
under a proprietary license, for a fee, to be used in closed source applications. Contact Belledonne Communications for any question about costs and services.
ITU G729 Annex A/B were offically released October/November 1996 (https://www.itu.int/rec/T-REC-G.729), hence all patents covering these specifications shall have expired in November 2016. Patent pool administrator confirmed most licensed patents under the G.729 Consortium have expired (http://www.sipro.com/G729.html).
No dependency is requested.
Building by Autotools way is deprecated. Use CMake to configure the source code.
cmake . -DCMAKE_INSTALL_PREFIX=<prefix> -DCMAKE_PREFIX_PATH=<search_prefixes>
make
make install
CMAKE_INSTALL_PREFIX=<string>
: install prefixCMAKE_PREFIX_PATH=<string>
: column-separated list of prefixes where to look for dependenciesENABLE_SHARED=NO
: do not build the shared libraryENABLE_STATIC=NO
: do not build the static libraryENABLE_TESTS=NO
: do not build non-regression tests
Our CMake scripts may automatically add some paths into research paths of generated binaries.
To ensure that the installed binaries are striped of any rpath, use -DCMAKE_SKIP_INSTALL_RPATH=ON
while you invoke cmake.
-
Tests are defined for each functional bloc (more or less matching a source file) and for global encoding/decoding
-
Use
-DENABLE_TESTS=YES
to compile with tests To run all tests available in the test directory, run testCampaignAll from test directory -
Input tests pattern have been generated by ITU code using ITU tests patterns. The test patterns are not part of this repository but can be downloaded here. However, the first run of
make check
will get them for you. -
To run partial test, use perl executable
testCampaign
in the test directory../testCampaign <functional bloc name>
You must first download the tests patterns usingmake check
or manually
- Check URL of sources;
- Change --with-asteriskXX according to your version.
Check after finish bcg729 installation, the path where libs are installed and do the symbolic links (obviously if the path where the libs are installed is different from /usr/lib):
# ln -s /usr/local/lib/libbcg729.so.0 /usr/lib
# ln -s /usr/local/lib/libbcg729.so /usr/lib
# ln -s /usr/local/lib/libbcg729.a /usr/lib
# apt-get install libtool --no-install-dependencies
# cd /usr/src
# wget http://asterisk.hosting.lv/src/asterisk-g72x-1.2.tar.bz2
# tar -jxvf asterisk-g72x-1.2.tar.bz2
# cd asterisk-g72x-1.2
# ./autogen.sh
# ./configure --with-bcg729 --with-asterisk18
# make
# make install
# readelf -h /usr/lib/asterisk/modules/codec_g729.so
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
Machine: ARM
Version: 0x1
Entry point address: 0x930
Start of program headers: 52 (bytes into file)
Start of section headers: 9748 (bytes into file)
Flags: 0x5000002, has entry point, Version5 EABI
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 6
Size of section headers: 40 (bytes)
Number of section headers: 27
Section header string table index: 24
You need to restart your Asterisk or load specific module using the command module load codec_g729.so, then:
# rasterisk -x "core show translation"
Translation times between formats (in microseconds) for one second of data
Source Format (Rows) Destination Format (Columns)
gsm ulaw alaw adpcm slin g729 slin16 testlaw slin12 slin24 slin32 slin44 slin48 slin96 slin192
gsm - 15000 15000 15000 9000 15000 17000 15000 17000 17000 17000 17000 17000 17000 17000
ulaw 15000 - 9150 15000 9000 15000 17000 15000 17000 17000 17000 17000 17000 17000 17000
alaw 15000 9150 - 15000 9000 15000 17000 15000 17000 17000 17000 17000 17000 17000 17000
adpcm 15000 15000 15000 - 9000 15000 17000 15000 17000 17000 17000 17000 17000 17000 17000
slin 6000 6000 6000 6000 - 6000 8000 6000 8000 8000 8000 8000 8000 8000 8000
g729 15000 15000 15000 15000 9000 - 17000 15000 17000 17000 17000 17000 17000 17000 17000
[...]