Skip to content

Commit

Permalink
Move speex into the chrome repo
Browse files Browse the repository at this point in the history
This is a smaller library that is always checked out and depsed in. It seems there is no particular reason for it to be in a separate repo other than it makes changes more difficult.

Review URL: https://codereview.chromium.org/608853002

Cr-Commit-Position: refs/heads/master@{#297781}
  • Loading branch information
brettw authored and Commit bot committed Oct 2, 2014
1 parent 715a73b commit ef5e3c5
Show file tree
Hide file tree
Showing 70 changed files with 17,182 additions and 5 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ v8.log
/third_party/skia
/third_party/smhasher
/third_party/snappy/src
/third_party/speex
/third_party/swiftshader/include/
/third_party/swig
/third_party/syzygy
Expand Down
4 changes: 0 additions & 4 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,6 @@ deps = {
'src/third_party/libsrtp':
Var('chromium_git') + '/chromium/deps/libsrtp.git' + '@' + '98284c8600c73812ff4716a6ea157d1e11d417dc',

'src/third_party/speex':
Var('chromium_git') + '/chromium/deps/speex.git' + '@' + '5260621c36c227209c7ba64ea71ca3418cf9e2b4',

'src/third_party/yasm/source/patched-yasm':
Var('chromium_git') + '/chromium/deps/yasm/patched-yasm.git' + '@' + 'c960eb11ccda80b10ed50be39df4f0663b371d1d',

Expand Down Expand Up @@ -391,7 +388,6 @@ deps_os = {
'src/third_party/safe_browsing/testing': None,
'src/third_party/scons-2.0.1': None,
'src/third_party/sfntly/cpp/src': None,
'src/third_party/speex': None,
'src/third_party/swig/Lib': None,
'src/third_party/usrsctp/usrsctplib': None,
'src/third_party/v8-i18n': None,
Expand Down
18 changes: 18 additions & 0 deletions third_party/speex/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
All the code except the following

David Rowe <david@rowetel.com>
lsp.c lsp.h
Also ideas and feedback

John Francis Edwards
wave_out.[ch], some #ifdefs for windows port and MSVC project files

Segher Boessenkool
Misc. optimizations (for QMF in particular)

Atsuhiko Yamanaka <ymnk@jcraft.com>:
Patch to speexenc.c to add Vorbis comment format

Radim Kolar <hsn@cybermail.net>:
Patch to speexenc.c for supporting more input formats
96 changes: 96 additions & 0 deletions third_party/speex/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

config("speex_config") {
include_dirs = [
"include", # Clients expect <speex/speex.h> to be a system header.
]
}

source_set("speex") {
sources = [
"libspeex/arch.h",
"libspeex/bits.c",
"libspeex/cb_search.c",
"libspeex/cb_search.h",
"libspeex/exc_10_16_table.c",
"libspeex/exc_10_32_table.c",
"libspeex/exc_20_32_table.c",
"libspeex/exc_5_256_table.c",
"libspeex/exc_5_64_table.c",
"libspeex/exc_8_128_table.c",
"libspeex/filters.c",
"libspeex/filters.h",
"libspeex/gain_table.c",
"libspeex/gain_table_lbr.c",
"libspeex/hexc_10_32_table.c",
"libspeex/hexc_table.c",
"libspeex/high_lsp_tables.c",
"libspeex/lpc.c",
"libspeex/lpc.h",
"libspeex/lsp.c",
"libspeex/lsp.h",
"libspeex/lsp_tables_nb.c",
"libspeex/ltp.c",
"libspeex/ltp.h",
"libspeex/math_approx.h",
"libspeex/modes.c",
"libspeex/modes.h",
"libspeex/modes_wb.c",
"libspeex/nb_celp.c",
"libspeex/nb_celp.h",
"libspeex/os_support.h",
"libspeex/pseudofloat.h",
"libspeex/quant_lsp.c",
"libspeex/quant_lsp.h",
"libspeex/sb_celp.c",
"libspeex/sb_celp.h",
"libspeex/speex.c",
"libspeex/speex_callbacks.c",
"libspeex/speex_header.c",
"libspeex/stack_alloc.h",
"libspeex/stereo.c",
"libspeex/vbr.c",
"libspeex/vbr.h",
"libspeex/vq.c",
"libspeex/vq.h",
"libspeex/window.c",
"include/speex/speex.h",
"include/speex/speex_bits.h",
"include/speex/speex_buffer.h",
"include/speex/speex_callbacks.h",
"include/speex/speex_echo.h",
"include/speex/speex_header.h",
"include/speex/speex_jitter.h",
"include/speex/speex_preprocess.h",
"include/speex/speex_resampler.h",
"include/speex/speex_stereo.h",
"include/speex/speex_types.h",
]

configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]

direct_dependent_configs = [ ":speex_config" ]

include_dirs = [
"libspeex",
]

defines = [
"FLOATING_POINT",
"EXPORT=",
"USE_ALLOCA",
"inline=__inline",
]

cflags = []

if (is_win) {
cflags += [
"/wd4244",
"/wd4305",
]
}
}
35 changes: 35 additions & 0 deletions third_party/speex/COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Copyright 2002-2008 Xiph.org Foundation
Copyright 2002-2008 Jean-Marc Valin
Copyright 2005-2007 Analog Devices Inc.
Copyright 2005-2008 Commonwealth Scientific and Industrial Research
Organisation (CSIRO)
Copyright 1993, 2002, 2006 David Rowe
Copyright 2003 EpicGames
Copyright 1992-1994 Jutta Degener, Carsten Bormann

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9 changes: 9 additions & 0 deletions third_party/speex/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
See INSTALL file for instruction on how to install Speex.

The Speex is a patent-free, Open Source/Free Software voice codec. Unlike other codecs like MP3 and Ogg Vorbis, Speex is designed to compress voice at bitrates in the 2-45 kbps range. Possible applications include VoIP, internet audio streaming, archiving of speech data (e.g. voice mail), and audio books. In some sense, it is meant to be complementary to the Ogg Vorbis codec.

To use the Speex command line tools:

% speexenc [options] input_file.wav compressed_file.spx

% speexdec [options] compressed_file.spx output_file.wav
15 changes: 15 additions & 0 deletions third_party/speex/README.chromium
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Name: speex
URL: http://downloads.xiph.org/releases/speex/speex-1.2rc1.tar.gz
Version: 1.2.rc1
License: BSD
Security Critical: yes

Description:
This contains a copy of speex-1.2.rc1

This library is required for the browser to compress and encode recorded audio
before sending to Google servers for speech recognition. This is a straight dump
of speex-1.2rc1 with all the unused files removed with the following changes:

1. Added include/speex/speex_config_types.h generated by the configure script
on Linux.
48 changes: 48 additions & 0 deletions third_party/speex/TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
For 1.2:
Major points:
- Make documentation match the actual code (especially jitter buffer, AEC and preprocessor)
- Get AGC to work in fixed-point even if not totally converted
- Stabilise all APIs (need feedback)
- Short-term estimate in jitter buffer
- Control delay in new AEC API.
- NaN checks?
- Better error reporting
- Make kiss-fft 32-bit safe

Minor issues:
- Fix last frame of speexenc


Post 1.2:
improve float<->int conversion
split encoder and decoder?
Merge TriMedia stuff
packet dump
Do VAD properly
--enable-{aec,preprocessor,jitter,resampler}

Optimisations
- Add restrict in a few places?
- enable 4x4 version of pitch_xcorr() at least on some archs?
- use __builtin_expect() (likely()/unlikely())

Would be nice:
Implement wideband split as IIR instead of QMF?

Allocator override (speex_lib_ctl?)
Fixed-point:
- VBR
- Jitter buffer
- AGC
Denoiser:
- Better noise adaptation
AGC:
- Use median filtering instead of "non-linear mean"?

Standards
-Complete Speex RTP profile
-MIME type registration

ideas:
Peelable stream (double codebook, higher bands, stereo)
LPC from spectral domain
Loading

0 comments on commit ef5e3c5

Please sign in to comment.