SHA256
1
0
forked from pool/broadvoice16

Accepting request 923537 from multimedia:libs

better home project for broadvoice16

OBS-URL: https://build.opensuse.org/request/show/923537
OBS-URL: https://build.opensuse.org/package/show/network:telephony/broadvoice16?expand=0&rev=1
This commit is contained in:
Jan Engelhardt 2021-10-06 17:33:05 +00:00 committed by Git OBS Bridge
commit 8a15c914ee
10 changed files with 229 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:56bb104ff730d3d19ff179e501b0b775213975ecbd6d94eb9727980504419860
size 4079754

16
COPYING Normal file
View File

@ -0,0 +1,16 @@
Floating Point and Fixed Point Interoperable ANSI C Implementations of BroadVoice16
/*****************************************************************************/
/* BroadVoice(R)16, Copyright (c) 2000-12, Broadcom Corporation. */
/* All Rights Reserved. */
/* */
/* This software is provided under the GNU Lesser General Public License, */
/* version 2.1, as published by the Free Software Foundation ("LGPL"). */
/* This program is distributed in the hope that it will be useful, but */
/* WITHOUT ANY SUPPORT OR WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LGPL for */
/* more details. A copy of the LGPL is available at */
/* http://www.broadcom.com/licenses/LGPLv2.1.php, */
/* or by writing to the Free Software Foundation, Inc., */
/* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*****************************************************************************/

13
README Normal file
View File

@ -0,0 +1,13 @@
Technology
BroadVoice is based on Two-Stage Noise Feedback Coding (TSNFC) rather than the popular Code-Excited Linear Prediction (CELP) coding paradigm. BroadVoice has two variants: a 16 kb/s version called BroadVoice16 (BV16) for narrowband telephone-bandwidth speech sampled at 8 kHz, and a 32 kb/s version called BroadVoice32 (BV32) for wideband speech sampled at 16 kHz. BV16 is a standard codec in the following standards: PacketCable™ 1.5, PacketCable 2.0, ANSI/SCTE 24-21 2006, and ITU-T Recommendation J.161. BV32 is a standard codec in PacketCable 2.0, ANSI/SCTE 24-23 2007, and ITU-T Recommendation J.361. The RTP payload formats for BV16 and BV32 are specified in RFC4298. BV16 and BV32 have very similar codec structures and share most of the algorithm modules, so if the two are implemented together, substantial code sharing and memory reduction can be achieved.
BroadVoice was designed from the ground up to be optimized for voice transmission over IP networks. The main design goal of BroadVoice was to make the coding delay and codec complexity as low as possible while maintaining output speech quality as close to transparent as possible. The following list summarizes the attributes of BroadVoice16 and BroadVoice32:
- Low Delay (Latency): algorithmic buffering delay of merely 5 ms (compared with 15 to 40 ms of most competing codecs)
- Low Complexity: much lower MIPS requirements than most competing codecs (typically 1/3 to 1/2 of comparable ITU-T G.72x codecs), also lower memory requirement than most competing codecs
- High Quality: equivalent or better speech quality than most competing codecs in PESQ comparisons and in extensive formal subjective MOS listening tests conducted by AT&T Labs, COMSAT Labs, and Dynastat, Inc
- Moderate Bit-Rate: at 2 bits/sample, coding efficiency is higher than G.711, G.726, and G.722 and comparable to many other codecs
- Availability: Broadcom is providing both the floating-point and fixed-point C source code of BroadVoice16 and BroadVoice 32 under an open source license and on a royalty-free basis
The BroadVoice open source C software programs are implementations conforming to the BV16 and BV32 codecs standardized in PacketCable, ANSI/SCTE, and ITU-T J.161/J.361 standards and thus are bit-stream compatible (inter-operable) with the BV16 and BV32 standards.

14
README.SUSE Normal file
View File

@ -0,0 +1,14 @@
Broadvoice codec information was once available at:
https://www.broadcom.com/support/broadvoice/
Currently such page is not available anymore.
However, you can find an old copy at web.archive.org
For example:
https://web.archive.org/web/20150224023215/https://www.broadcom.com/support/broadvoice/
The file COPYING was generated with the command:
unoconv -f txt --stdout BroadVoice16.doc | sed '1s@^.@@;/Scope/,$d' >COPYING
The file README is an extract from the page:
https://web.archive.org/web/20150224023215/https://www.broadcom.com/support/broadvoice/

4
broadvoice16.changes Normal file
View File

@ -0,0 +1,4 @@
-------------------------------------------------------------------
Mon Oct 4 16:56:44 UTC 2021 - Giacomo Comes <gcomes.obs@gmail.com> - 1.2
- Initial packaging

136
broadvoice16.spec Normal file
View File

@ -0,0 +1,136 @@
#
# spec file for package broadvoice16
#
# Copyright (c) 2021 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define static 0
%define shared 1
%define tools 1
Name: broadvoice16
Version: 1.2
Release: 0
Summary: BroadVoice 16 Speech Codec
License: LGPL-2.1-only
Group: Productivity/Multimedia/Sound/Utilities
URL: https://www.broadcom.com/site-search?q=broadvoice
Source0: BroadVoice16OpenSource.v%{version}.zip
Source1: COPYING
Source2: README
Source3: README.SUSE
Source4: meson_options.txt
Source5: meson.build
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires: unzip
BuildRequires: meson
%description
BroadVoice is a family of speech coding algorithms created by Broadcom and standardized by CableLabs, SCTE, and ANSI for Voice over IP applications in cable telephony. BroadVoice is also part of the ITU-T Recommendations J.161 and J.361. To encourage wide-spread use of BroadVoice in diverse speech compression applications, Broadcom is providing the C source code of BroadVoice on a royalty-free basis under the GNU Lesser General Public License (LGPL), version 2.1, as published by the Free Software Foundation.
%if 0%{?static} || 0%{?shared}
%package devel
Summary: BroadVoice 16 development files
Group: Development/Libraries/C and C++
%if !0%{?static}
Requires: %{name}
%endif
%description devel
Header files for the libbv16 library.
%if 0%{?static}
This package also includes the static library.
%endif
%endif
%prep
%setup -q -n BroadVoice16
%build
cp %{SOURCE1} %{SOURCE2} %{SOURCE3} .
cp %{SOURCE4} %{SOURCE5} FloatingPoint
cd FloatingPoint
%meson \
%if 0%{?static}
-Dstatic_libs=true \
%endif
%if !0%{?shared}
-Dshared_libs=false \
%endif
%if !0%{?tools}
-Dbuild_tools=false \
%endif
%meson_build
%install
cd FloatingPoint
%meson_install
%if !0%{?static} && !0%{?shared}
rm -r %{buildroot}%{_includedir}/bv16-floatingpoint
%endif
%check
%if 0%{?tools}
cd FloatingPoint/process
#return failure if TestBroadVoice16 fails
echo 'exit $checksum' >>TestBroadVoice16
#TestBroadVoice16 is setup for compilation with DG192BITSTREAM=1
#remove some tests for compilation with DG192BITSTREAM=0
grep -qF DG192BITSTREAM=0 ../meson.build && \
sed -i '/cmp tv.bv16 tv.bv16.ref/,/fi/d' TestBroadVoice16 && \
sed -i '/cmp tv.bv16.bfe10.raw tv.bv16.bfe10.ref.raw/,/fi/d' TestBroadVoice16 && \
sed -i '/cmp tvbe.bv16 tvbe.bv16.ref/,/fi/d' TestBroadVoice16 && \
sed -i '/cmp tvbe.bv16.bfe10.raw tvbe.bv16.bfe10.ref.raw/,/fi/d' TestBroadVoice16
%ifarch %ix86 x86_64 ppc64le aarch64 %arm
PATH=%{buildroot}%{_bindir}:$PATH LD_LIBRARY_PATH=%{buildroot}%{_libdir} \
bash TestBroadVoice16 LittleEndian
%endif
%ifarch s390x ppc64
PATH=%{buildroot}%{_bindir}:$PATH LD_LIBRARY_PATH=%{buildroot}%{_libdir} \
bash TestBroadVoice16 BigEndian
%endif
%endif
%if 0%{?shared}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%endif
%files
%defattr(-,root,root,-)
%license COPYING
%doc README README.SUSE BroadVoice16.doc
%if 0%{?tools}
%{_bindir}/BroadVoice16
%endif
%if 0%{?shared}
%{_libdir}/*.so
%endif
%if 0%{?static} || 0%{?shared}
%files devel
%defattr(-,root,root,-)
%dir %{_includedir}/bv16-floatingpoint
%dir %{_includedir}/bv16-floatingpoint/*
%{_includedir}/*/*/*.h
%if 0%{?static}
%{_libdir}/*.a
%endif
%endif
%changelog

16
meson.build Normal file
View File

@ -0,0 +1,16 @@
#meson
project('BROADVOICE16', 'c', version : '1.2')
bvinclude = include_directories('bv16', 'bvcommon')
libm = meson.get_compiler('c').find_library('libm')
bv16_source_files = ['bvcommon/a2lsp.c', 'bvcommon/allpole.c', 'bvcommon/allzero.c', 'bvcommon/autocor.c', 'bvcommon/cmtables.c', 'bvcommon/levdur.c', 'bvcommon/lsp2a.c', 'bvcommon/ptdec.c', 'bvcommon/stblchck.c', 'bvcommon/stblzlsp.c', 'bvcommon/utility.c', 'bv16/bitpack.c', 'bv16/coarptch.c', 'bv16/decoder.c', 'bv16/encoder.c', 'bv16/excdec.c', 'bv16/excquan.c', 'bv16/fineptch.c', 'bv16/gaindec.c', 'bv16/gainquan.c', 'bv16/levelest.c', 'bv16/lspdec.c', 'bv16/lspquan.c', 'bv16/plc.c', 'bv16/postfilt.c', 'bv16/ptquan.c', 'bv16/tables.c']
broadvoice16_source_files = ['bv16/bv.c', 'bv16/g192.c']
add_global_arguments('-DWMOPS=0', '-DG192BITSTREAM=0', language : 'c')
link_libraries = static_library('bv16', bv16_source_files, include_directories : bvinclude, dependencies : libm, install : get_option('static_libs'))
if get_option('shared_libs')
link_libraries = shared_library('bv16', bv16_source_files, include_directories : bvinclude, dependencies : libm, install : true)
endif
if get_option('build_tools')
executable('BroadVoice16', broadvoice16_source_files, include_directories : bvinclude, dependencies : libm, link_with : link_libraries, install : true)
endif
install_headers('bv16/bitpack.h','bv16/bv16.h','bv16/bv16cnst.h','bv16/bv16externs.h','bv16/bv16strct.h','bv16/g192.h','bv16/postfilt.h', subdir : 'bv16-floatingpoint/bv16')
install_headers('bvcommon/bvcommon.h','bvcommon/typedef.h','bvcommon/utility.h', subdir : 'bv16-floatingpoint/bvcommon')

3
meson_options.txt Normal file
View File

@ -0,0 +1,3 @@
option('shared_libs', type : 'boolean', value : true, description : 'Build shared library.')
option('static_libs', type : 'boolean', value : false, description : 'Build static library.')
option('build_tools', type : 'boolean', value : true, description : 'Build tools.')