├── .cproject
├── .project
├── .travis.yml
├── AUTHORS
├── COPYING
├── ChangeLog
├── INSTALL
├── LICENSE_PLEASE_READ.txt
├── Makefile.am
├── Makefile.in
├── Makefile.mips
├── Makefile.unix
├── NEWS
├── Profiling
├── tracer_profiling.c
└── tracer_profiling.h
├── README
├── README.draft
├── README.md
├── _config.yml
├── aclocal.m4
├── appveyor.yml
├── autogen.sh
├── celt
├── _kiss_fft_guts.h
├── arch.h
├── arm
│ ├── arm2gnu.pl
│ ├── arm_celt_map.c
│ ├── arm_celt_mapv1.c
│ ├── armcpu.c
│ ├── armcpu.h
│ ├── armcpuv2.c
│ ├── armcpuv2.h
│ ├── armopts-gnu.S
│ ├── armopts.s.in
│ ├── celt_armv7e_fft.c
│ ├── celt_armv7e_intr.h
│ ├── celt_armv7e_mdct.c
│ ├── celt_ne10_fft.c
│ ├── celt_ne10_mdct.c
│ ├── celt_neon_intr.c
│ ├── celt_pitch_xcorr_arm-gnu.S
│ ├── celt_pitch_xcorr_arm-gnu2.S
│ ├── celt_pitch_xcorr_arm.s
│ ├── fft_arm.h
│ ├── fixed_arm64.h
│ ├── fixed_armv4.h
│ ├── fixed_armv5e.h
│ ├── fixed_armv7e.h
│ ├── kiss_fft_armv4.h
│ ├── kiss_fft_armv5e.h
│ ├── kiss_fft_armv7e.h
│ ├── mdct_arm.h
│ └── pitch_arm.h
├── bands.c
├── bands.h
├── celt.c
├── celt.h
├── celt_decoder.c
├── celt_encoder.c
├── celt_lpc.c
├── celt_lpc.h
├── cpu_support.h
├── cwrs.c
├── cwrs.h
├── dump_modes
│ ├── Makefile
│ ├── dump_modes.c
│ ├── dump_modes_arch.h
│ └── dump_modes_arm_ne10.c
├── ecintrin.h
├── entcode.c
├── entcode.h
├── entdec.c
├── entdec.h
├── entenc.c
├── entenc.h
├── fixed_c5x.h
├── fixed_c6x.h
├── fixed_debug.h
├── fixed_generic.h
├── float_cast.h
├── kiss_fft.c
├── kiss_fft.h
├── laplace.c
├── laplace.h
├── mathops.c
├── mathops.h
├── mathops_armv7e.c
├── mathops_armv7e.h
├── mdct.c
├── mdct.h
├── mfrngcod.h
├── mips
│ ├── celt_mipsr1.h
│ ├── fixed_generic_mipsr1.h
│ ├── kiss_fft_mipsr1.h
│ ├── mdct_mipsr1.h
│ ├── pitch_mipsr1.h
│ └── vq_mipsr1.h
├── modes.c
├── modes.h
├── opus_custom_demo.c
├── os_support.h
├── pitch.c
├── pitch.h
├── quant_bands.c
├── quant_bands.h
├── rate.c
├── rate.h
├── stack_alloc.h
├── static_modes_fixed.h
├── static_modes_fixed_arm_ne10.h
├── static_modes_fixed_armv7e.h
├── static_modes_float.h
├── static_modes_float_arm_ne10.h
├── tests
│ ├── test_unit_cwrs32.c
│ ├── test_unit_dft.c
│ ├── test_unit_entropy.c
│ ├── test_unit_laplace.c
│ ├── test_unit_mathops.c
│ ├── test_unit_mdct.c
│ ├── test_unit_rotation.c
│ └── test_unit_types.c
├── vq.c
├── vq.h
└── x86
│ ├── celt_lpc_sse.c
│ ├── celt_lpc_sse.h
│ ├── pitch_sse.c
│ ├── pitch_sse.h
│ ├── pitch_sse2.c
│ ├── pitch_sse4_1.c
│ ├── vq_sse.h
│ ├── vq_sse2.c
│ ├── x86_celt_map.c
│ ├── x86cpu.c
│ └── x86cpu.h
├── celt_headers.mk
├── celt_sources.mk
├── compile
├── config.guess
├── config.h.in
├── config.sub
├── configure
├── configure.ac
├── depcomp
├── doc
├── Doxyfile.in
├── Makefile.am
├── Makefile.in
├── TODO
├── build_draft.sh
├── build_isobmff.sh
├── build_oggdraft.sh
├── customdoxygen.css
├── draft-ietf-codec-oggopus.xml
├── draft-ietf-codec-opus-update.xml
├── draft-ietf-codec-opus.xml
├── draft-ietf-payload-rtp-opus.xml
├── footer.html
├── header.html
├── opus_in_isobmff.css
├── opus_in_isobmff.html
├── opus_logo.svg
├── opus_update.patch
├── release.txt
└── trivial_example.c
├── include
├── config.h
├── opus.h
├── opus_custom.h
├── opus_defines.h
├── opus_multistream.h
└── opus_types.h
├── install-sh
├── ltmain.sh
├── m4
├── as-gcc-inline-assembly.m4
├── libtool.m4
├── ltoptions.m4
├── ltsugar.m4
├── ltversion.m4
├── lt~obsolete.m4
└── opus-intrinsics.m4
├── missing
├── opus-uninstalled.pc.in
├── opus.m4
├── opus.pc.in
├── opus_headers.mk
├── opus_sources.mk
├── package_version
├── releases.sha2
├── silk
├── A2NLSF.c
├── API.h
├── CNG.c
├── HP_variable_cutoff.c
├── Inlines.h
├── LPC_analysis_filter.c
├── LPC_fit.c
├── LPC_inv_pred_gain.c
├── LP_variable_cutoff.c
├── MacroCount.h
├── MacroDebug.h
├── NLSF2A.c
├── NLSF_VQ.c
├── NLSF_VQ_weights_laroia.c
├── NLSF_decode.c
├── NLSF_del_dec_quant.c
├── NLSF_encode.c
├── NLSF_stabilize.c
├── NLSF_unpack.c
├── NSQ.c
├── NSQ.h
├── NSQ_del_dec.c
├── PLC.c
├── PLC.h
├── SigProc_FIX.h
├── VAD.c
├── VQ_WMat_EC.c
├── ana_filt_bank_1.c
├── arm
│ ├── LPC_inv_pred_gain_arm.h
│ ├── LPC_inv_pred_gain_neon_intr.c
│ ├── NSQ_del_dec_arm.h
│ ├── NSQ_del_dec_neon_intr.c
│ ├── NSQ_neon.c
│ ├── NSQ_neon.h
│ ├── SigProc_FIX_armv4.h
│ ├── SigProc_FIX_armv5e.h
│ ├── arm_silk_map.c
│ ├── macros_arm64.h
│ ├── macros_armv4.h
│ └── macros_armv5e.h
├── biquad_alt.c
├── bwexpander.c
├── bwexpander_32.c
├── check_control_input.c
├── code_signs.c
├── control.h
├── control_SNR.c
├── control_audio_bandwidth.c
├── control_codec.c
├── debug.c
├── debug.h
├── dec_API.c
├── decode_core.c
├── decode_frame.c
├── decode_indices.c
├── decode_parameters.c
├── decode_pitch.c
├── decode_pulses.c
├── decoder_set_fs.c
├── define.h
├── enc_API.c
├── encode_indices.c
├── encode_pulses.c
├── errors.h
├── fixed
│ ├── LTP_analysis_filter_FIX.c
│ ├── LTP_scale_ctrl_FIX.c
│ ├── apply_sine_window_FIX.c
│ ├── autocorr_FIX.c
│ ├── burg_modified_FIX.c
│ ├── corrMatrix_FIX.c
│ ├── encode_frame_FIX.c
│ ├── find_LPC_FIX.c
│ ├── find_LTP_FIX.c
│ ├── find_pitch_lags_FIX.c
│ ├── find_pred_coefs_FIX.c
│ ├── k2a_FIX.c
│ ├── k2a_Q16_FIX.c
│ ├── main_FIX.h
│ ├── mips
│ │ ├── noise_shape_analysis_FIX_mipsr1.h
│ │ ├── prefilter_FIX_mipsr1.h
│ │ └── warped_autocorrelation_FIX_mipsr1.h
│ ├── noise_shape_analysis_FIX.c
│ ├── pitch_analysis_core_FIX.c
│ ├── prefilter_FIX.c
│ ├── process_gains_FIX.c
│ ├── regularize_correlations_FIX.c
│ ├── residual_energy16_FIX.c
│ ├── residual_energy_FIX.c
│ ├── schur64_FIX.c
│ ├── schur_FIX.c
│ ├── solve_LS_FIX.c
│ ├── structs_FIX.h
│ ├── vector_ops_FIX.c
│ ├── warped_autocorrelation_FIX.c
│ └── x86
│ │ ├── burg_modified_FIX_sse.c
│ │ ├── prefilter_FIX_sse.c
│ │ └── vector_ops_FIX_sse.c
├── float
│ ├── LPC_analysis_filter_FLP.c
│ ├── LPC_inv_pred_gain_FLP.c
│ ├── LTP_analysis_filter_FLP.c
│ ├── LTP_scale_ctrl_FLP.c
│ ├── SigProc_FLP.h
│ ├── apply_sine_window_FLP.c
│ ├── autocorrelation_FLP.c
│ ├── burg_modified_FLP.c
│ ├── bwexpander_FLP.c
│ ├── corrMatrix_FLP.c
│ ├── encode_frame_FLP.c
│ ├── energy_FLP.c
│ ├── find_LPC_FLP.c
│ ├── find_LTP_FLP.c
│ ├── find_pitch_lags_FLP.c
│ ├── find_pred_coefs_FLP.c
│ ├── inner_product_FLP.c
│ ├── k2a_FLP.c
│ ├── levinsondurbin_FLP.c
│ ├── main_FLP.h
│ ├── noise_shape_analysis_FLP.c
│ ├── pitch_analysis_core_FLP.c
│ ├── prefilter_FLP.c
│ ├── process_gains_FLP.c
│ ├── regularize_correlations_FLP.c
│ ├── residual_energy_FLP.c
│ ├── scale_copy_vector_FLP.c
│ ├── scale_vector_FLP.c
│ ├── schur_FLP.c
│ ├── solve_LS_FLP.c
│ ├── sort_FLP.c
│ ├── structs_FLP.h
│ ├── warped_autocorrelation_FLP.c
│ └── wrappers_FLP.c
├── gain_quant.c
├── init_decoder.c
├── init_encoder.c
├── inner_prod_aligned.c
├── interpolate.c
├── lin2log.c
├── log2lin.c
├── macros.h
├── main.h
├── mips
│ ├── NSQ_del_dec_mipsr1.h
│ ├── macros_mipsr1.h
│ └── sigproc_fix_mipsr1.h
├── pitch_est_defines.h
├── pitch_est_tables.c
├── process_NLSFs.c
├── quant_LTP_gains.c
├── resampler.c
├── resampler_down2.c
├── resampler_down2_3.c
├── resampler_private.h
├── resampler_private_AR2.c
├── resampler_private_IIR_FIR.c
├── resampler_private_down_FIR.c
├── resampler_private_up2_HQ.c
├── resampler_rom.c
├── resampler_rom.h
├── resampler_structs.h
├── shell_coder.c
├── sigm_Q15.c
├── sort.c
├── stereo_LR_to_MS.c
├── stereo_MS_to_LR.c
├── stereo_decode_pred.c
├── stereo_encode_pred.c
├── stereo_find_predictor.c
├── stereo_quant_pred.c
├── structs.h
├── sum_sqr_shift.c
├── table_LSF_cos.c
├── tables.h
├── tables_LTP.c
├── tables_NLSF_CB_NB_MB.c
├── tables_NLSF_CB_WB.c
├── tables_gain.c
├── tables_other.c
├── tables_pitch_lag.c
├── tables_pulses_per_block.c
├── tests
│ └── test_unit_LPC_inv_pred_gain.c
├── tuning_parameters.h
├── typedef.h
└── x86
│ ├── NSQ_del_dec_sse.c
│ ├── NSQ_sse.c
│ ├── SigProc_FIX_sse.h
│ ├── VAD_sse.c
│ ├── VQ_WMat_EC_sse.c
│ ├── main_sse.h
│ └── x86_silk_map.c
├── silk_headers.mk
├── silk_sources.mk
├── src
├── analysis.c
├── analysis.h
├── mlp.c
├── mlp.h
├── mlp_data.c
├── mlp_train.c
├── mlp_train.h
├── opus.c
├── opus_compare.c
├── opus_decoder.c
├── opus_demo.c
├── opus_encoder.c
├── opus_multistream.c
├── opus_multistream_decoder.c
├── opus_multistream_encoder.c
├── opus_private.h
├── repacketizer.c
├── repacketizer_demo.c
└── tansig_table.h
├── test-driver
├── tests
├── opus_decode_fuzzer.c
├── opus_decode_fuzzer.options
├── opus_encode_regressions.c
├── run_vectors.sh
├── test_opus_api.c
├── test_opus_common.h
├── test_opus_decode.c
├── test_opus_encode.c
└── test_opus_padding.c
├── version.mk
└── win32
├── VS2010
├── celt.vcxproj
├── celt.vcxproj.filters
├── opus.sln
├── opus.vcxproj
├── opus.vcxproj.filters
├── opus_demo.vcxproj
├── opus_demo.vcxproj.filters
├── silk_common.vcxproj
├── silk_common.vcxproj.filters
├── silk_fixed.vcxproj
├── silk_fixed.vcxproj.filters
├── silk_float.vcxproj
├── silk_float.vcxproj.filters
├── test_opus_api.vcxproj
├── test_opus_api.vcxproj.filters
├── test_opus_decode.vcxproj
├── test_opus_decode.vcxproj.filters
├── test_opus_encode.vcxproj
└── test_opus_encode.vcxproj.filters
├── VS2015
├── common.props
├── opus.sln
├── opus.vcxproj
├── opus.vcxproj.filters
├── opus_demo.vcxproj
├── opus_demo.vcxproj.filters
├── test_opus_api.vcxproj
├── test_opus_api.vcxproj.filters
├── test_opus_decode.vcxproj
├── test_opus_decode.vcxproj.filters
├── test_opus_encode.vcxproj
└── test_opus_encode.vcxproj.filters
├── config.h
└── genversion.bat
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | Opus_ST
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder
10 | clean,full,incremental,
11 |
12 |
13 |
14 |
15 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
16 | full,incremental,
17 |
18 |
19 |
20 |
21 |
22 | org.eclipse.cdt.core.cnature
23 | org.eclipse.cdt.core.ccnature
24 | org.eclipse.cdt.managedbuilder.core.managedBuildNature
25 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
26 |
27 |
28 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: c
2 |
3 | compiler:
4 | - gcc
5 | - clang
6 |
7 | os:
8 | - linux
9 | - osx
10 |
11 | env:
12 | - CONFIG=""
13 | - CONFIG="--enable-assertions"
14 | - CONFIG="--enable-fixed-point"
15 | - CONFIG="--enable-fixed-point --disable-float-api"
16 | - CONFIG="--enable-fixed-point --enable-assertions"
17 |
18 | script:
19 | - ./autogen.sh
20 | - ./configure $CONFIG
21 | - make distcheck
22 |
--------------------------------------------------------------------------------
/AUTHORS:
--------------------------------------------------------------------------------
1 | Jean-Marc Valin (jmvalin@jmvalin.ca)
2 | Koen Vos (koenvos74@gmail.com)
3 | Timothy Terriberry (tterribe@xiph.org)
4 | Karsten Vandborg Sorensen (karsten.vandborg.sorensen@skype.net)
5 | Soren Skak Jensen (ssjensen@gn.com)
6 | Gregory Maxwell (greg@xiph.org)
7 |
--------------------------------------------------------------------------------
/COPYING:
--------------------------------------------------------------------------------
1 | Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic,
2 | Jean-Marc Valin, Timothy B. Terriberry,
3 | CSIRO, Gregory Maxwell, Mark Borgerding,
4 | Erik de Castro Lopo
5 |
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions
8 | are met:
9 |
10 | - Redistributions of source code must retain the above copyright
11 | notice, this list of conditions and the following disclaimer.
12 |
13 | - Redistributions in binary form must reproduce the above copyright
14 | notice, this list of conditions and the following disclaimer in the
15 | documentation and/or other materials provided with the distribution.
16 |
17 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
18 | names of specific contributors, may be used to endorse or promote
19 | products derived from this software without specific prior written
20 | permission.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
26 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | Opus is subject to the royalty-free patent licenses which are
35 | specified at:
36 |
37 | Xiph.Org Foundation:
38 | https://datatracker.ietf.org/ipr/1524/
39 |
40 | Microsoft Corporation:
41 | https://datatracker.ietf.org/ipr/1914/
42 |
43 | Broadcom Corporation:
44 | https://datatracker.ietf.org/ipr/1526/
45 |
--------------------------------------------------------------------------------
/ChangeLog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Daparrag/Opus_CotexM4_microcontroller/7023730ce5f8e0ba662acbbb739714829fa63d21/ChangeLog
--------------------------------------------------------------------------------
/LICENSE_PLEASE_READ.txt:
--------------------------------------------------------------------------------
1 | Contributions to the collaboration shall not be considered confidential.
2 |
3 | Each contributor represents and warrants that it has the right and
4 | authority to license copyright in its contributions to the collaboration.
5 |
6 | Each contributor agrees to license the copyright in the contributions
7 | under the Modified (2-clause or 3-clause) BSD License or the Clear BSD License.
8 |
9 | Please see the IPR statements submitted to the IETF for the complete
10 | patent licensing details:
11 |
12 | Xiph.Org Foundation:
13 | https://datatracker.ietf.org/ipr/1524/
14 |
15 | Microsoft Corporation:
16 | https://datatracker.ietf.org/ipr/1914/
17 |
18 | Skype Limited:
19 | https://datatracker.ietf.org/ipr/1602/
20 |
21 | Broadcom Corporation:
22 | https://datatracker.ietf.org/ipr/1526/
23 |
--------------------------------------------------------------------------------
/NEWS:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Daparrag/Opus_CotexM4_microcontroller/7023730ce5f8e0ba662acbbb739714829fa63d21/NEWS
--------------------------------------------------------------------------------
/Profiling/tracer_profiling.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file tracer_profiling.h
4 | * @author Central Lab
5 | * @version V1.0.0
6 | * @date 28-January-2016
7 | * @brief Header for codec_profiling.c module.
8 | ******************************************************************************
9 | * @attention
10 | *
11 | *
© COPYRIGHT(c) 2016 STMicroelectronics
12 | *
13 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
14 | * You may not use this file except in compliance with the License.
15 | * You may obtain a copy of the License at:
16 | *
17 | * http://www.st.com/software_license_agreement_liberty_v2
18 | *
19 | * Unless required by applicable law or agreed to in writing, software
20 | * distributed under the License is distributed on an "AS IS" BASIS,
21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 | * See the License for the specific language governing permissions and
23 | * limitations under the License.
24 | *
25 | ******************************************************************************
26 | */
27 |
28 |
29 |
30 | /* Define to prevent recursive inclusion -------------------------------------*/
31 | #ifndef __TRACER_PROFILING_H
32 | #define __TRACER_PROFILING_H
33 | /* Includes ------------------------------------------------------------------*/
34 | #include "main_usb.h"
35 | #include "cube_hal.h"
36 | #include "stm32xx_it.h"
37 |
38 | #define PROF_ON 1
39 | #define PROF_OFF 0
40 | #define PROF_BUSY 2
41 |
42 | #define MAX_ENTRIES 10
43 |
44 | struct profile {
45 | int state;
46 | int already_setup;
47 | };
48 |
49 | struct profile_fun{
50 | int16_t num_child;
51 | int32_t deph_level;
52 | void* fun_addrs;
53 | int cycles;
54 | int16_t count;
55 | void* parent_addrs;
56 | struct profile_fun *next_fun[MAX_ENTRIES];
57 | };
58 |
59 | extern struct profile _profparam;
60 |
61 |
62 |
63 |
64 | /* Private define ------------------------------------------------------------*/
65 | /* Private macro -------------------------------------------------------------*/
66 | /* Private typedef -----------------------------------------------------------*/
67 | /* Private variables ---------------------------------------------------------*/
68 | void __attribute__ ((constructor,no_instrument_function)) trace_begin (void);
69 | void __attribute__ ((destructor,no_instrument_function)) trace_end(void);
70 | void __attribute__ ((no_instrument_function)) __cyg_profile_func_enter(void *func, void *caller);
71 | void __attribute__ ((no_instrument_function)) __cyg_profile_func_exit(void *func, void *caller);
72 | void __attribute__ ((no_instrument_function)) start_profile(int start);
73 | void __attribute__ ((no_instrument_function)) Error_profile(void);
74 |
75 | #endif /* __TRACER_PROFILING_H */
76 |
77 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
78 |
--------------------------------------------------------------------------------
/README.draft:
--------------------------------------------------------------------------------
1 | To build this source code, simply type:
2 |
3 | % make
4 |
5 | If this does not work, or if you want to change the default configuration
6 | (e.g., to compile for a fixed-point architecture), simply edit the options
7 | in the Makefile.
8 |
9 | An up-to-date implementation conforming to this standard is available in a
10 | Git repository at https://git.xiph.org/opus.git or on a website at:
11 | https://opus-codec.org/
12 | However, although that implementation is expected to remain conformant
13 | with the standard, it is the code in this RFC that shall remain normative.
14 | To build from the git repository instead of using this RFC, follow these
15 | steps:
16 |
17 | 1) Clone the repository (latest implementation of this standard at the time
18 | of publication)
19 |
20 | % git clone https://git.xiph.org/opus.git
21 | % cd opus
22 |
23 | 2) Compile
24 |
25 | % ./autogen.sh
26 | % ./configure
27 | % make
28 |
29 | Once you have compiled the codec, there will be a opus_demo executable in
30 | the top directory.
31 |
32 | Usage: opus_demo [-e]
33 | [options]
34 | opus_demo -d [options]
35 |
36 |
37 | mode: voip | audio | restricted-lowdelay
38 | options:
39 | -e : only runs the encoder (output the bit-stream)
40 | -d : only runs the decoder (reads the bit-stream as input)
41 | -cbr : enable constant bitrate; default: variable bitrate
42 | -cvbr : enable constrained variable bitrate; default: unconstrained
43 | -bandwidth : audio bandwidth (from narrowband to fullband);
44 | default: sampling rate
45 | -framesize <2.5|5|10|20|40|60> : frame size in ms; default: 20
46 | -max_payload : maximum payload size in bytes, default: 1024
47 | -complexity : complexity, 0 (lowest) ... 10 (highest); default: 10
48 | -inbandfec : enable SILK inband FEC
49 | -forcemono : force mono encoding, even for stereo input
50 | -dtx : enable SILK DTX
51 | -loss : simulate packet loss, in percent (0-100); default: 0
52 |
53 | input and output are little endian signed 16-bit PCM files or opus bitstreams
54 | with simple opus_demo proprietary framing.
55 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-cayman
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | image: Visual Studio 2015
2 | configuration:
3 | - Debug
4 | - DebugDLL
5 | - DebugDLL_fixed
6 | - Release
7 | - ReleaseDLL
8 | - ReleaseDLL_fixed
9 |
10 | platform:
11 | - Win32
12 | - x64
13 |
14 | build:
15 | project: win32\VS2015\opus.sln
16 | parallel: true
17 | verbosity: minimal
18 |
19 | after_build:
20 | - cmd: >-
21 | mkdir %APPVEYOR_BUILD_FOLDER%\artifacts
22 |
23 | cd %APPVEYOR_BUILD_FOLDER%\win32\VS2015\%PLATFORM%\%CONFIGURATION%
24 |
25 | for %%a in (lib dll exp pdb) do if exist opus.%%a copy opus.%%a %APPVEYOR_BUILD_FOLDER%\artifacts\
26 |
27 | cd %APPVEYOR_BUILD_FOLDER%
28 |
29 | 7z a opus.zip .\artifacts\* include\*.h
30 |
31 | test_script:
32 | - cmd: >-
33 | cd %APPVEYOR_BUILD_FOLDER%\win32\VS2015\%PLATFORM%\%CONFIGURATION%
34 |
35 | test_opus_api.exe
36 |
37 | test_opus_decode.exe
38 |
39 | test_opus_encode.exe
40 |
41 | artifacts:
42 | - path: opus.zip
43 |
--------------------------------------------------------------------------------
/autogen.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Copyright (c) 2010-2015 Xiph.Org Foundation and contributors.
3 | # Use of this source code is governed by a BSD-style license that can be
4 | # found in the COPYING file.
5 |
6 | # Run this to set up the build system: configure, makefiles, etc.
7 | set -e
8 |
9 | srcdir=`dirname $0`
10 | test -n "$srcdir" && cd "$srcdir"
11 |
12 | echo "Updating build configuration files, please wait...."
13 |
14 | autoreconf -isf
15 |
--------------------------------------------------------------------------------
/celt/arm/armcpuv2.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2010 Xiph.Org Foundation
2 | * Copyright (c) 2013 Parrot */
3 | /*
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions
6 | are met:
7 |
8 | - Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 |
11 | - Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in the
13 | documentation and/or other materials provided with the distribution.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
19 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 |
29 | #if !defined(ARMCPU_H)
30 | # define ARMCPU_H
31 |
32 |
33 | # if defined(OPUS_ARM_MAY_HAVE_EDSP)
34 | # define MAY_HAVE_EDSP(name) name ## _edsp //this "##" puts two token together in this case the tokens & <_edsp>
35 | # else
36 | # define MAY_HAVE_EDSP(name) name ## _c
37 | # endif
38 |
39 | # if defined(OPUS_ARM_MAY_HAVE_MEDIA)
40 | # define MAY_HAVE_MEDIA(name) name ## _media
41 | # else
42 | # define MAY_HAVE_MEDIA(name) MAY_HAVE_EDSP(name)
43 | # endif
44 |
45 | # if defined(OPUS_ARM_MAY_HAVE_NEON)
46 | # define MAY_HAVE_NEON(name) name ## _neon
47 | # else
48 | # define MAY_HAVE_NEON(name) MAY_HAVE_MEDIA(name)
49 | # endif
50 |
51 | # if defined(OPUS_ARM_PRESUME_EDSP)
52 | # define PRESUME_EDSP(name) name ## _edsp
53 | # else
54 | # define PRESUME_EDSP(name) name ## _c
55 | # endif
56 |
57 | # if defined(OPUS_ARM_PRESUME_MEDIA)
58 | # define PRESUME_MEDIA(name) name ## _media
59 | # else
60 | # define PRESUME_MEDIA(name) PRESUME_EDSP(name)
61 | # endif
62 |
63 | # if defined(OPUS_ARM_PRESUME_NEON)
64 | # define PRESUME_NEON(name) name ## _neon
65 | # else
66 | # define PRESUME_NEON(name) PRESUME_MEDIA(name)
67 | # endif
68 |
69 |
70 |
71 | # if defined(OPUS_HAVE_RTCD)
72 | int opus_select_arch(void);
73 |
74 | #define OPUS_ARCH_ARM_V4 (0)
75 | #define OPUS_ARCH_ARM_EDSP (1)
76 | #define OPUS_ARCH_ARM_MEDIA (2)
77 | #define OPUS_ARCH_ARM_NEON (3)
78 | # endif
79 |
80 | # if defined(OPUS_HAVE_CORTEX_M)/*new_D*/
81 | int opus_select_arch(void);
82 | #define OPUS_ARCH_ARM_ARM6M (4)
83 | #define OPUS_ARCH_ARM_ARM7M (5)
84 | #define OPUS_ARCH_ARM_ARMv7E (6) /*include for support ARMv7E-M architecture*/
85 |
86 | # endif
87 |
88 | #endif
89 |
--------------------------------------------------------------------------------
/celt/arm/armopts-gnu.S:
--------------------------------------------------------------------------------
1 | .syntax unified
2 | /* Copyright (C) 2013 Mozilla Corporation */
3 | /*
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions
6 | are met:
7 |
8 | - Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 |
11 | - Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in the
13 | documentation and/or other materials provided with the distribution.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
19 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | @ Set the following to 1 if we have EDSP instructions
29 | @ (LDRD/STRD, etc., ARMv5E and later).
30 | .set OPUS_ARM_MAY_HAVE_EDSP, 0
31 |
32 | @ Set the following to 1 if we have ARMv6 media instructions.
33 | .set OPUS_ARM_MAY_HAVE_MEDIA, 0
34 |
35 | @ Set the following to 1 if we have NEON (some ARMv7)
36 | .set OPUS_ARM_MAY_HAVE_NEON, 0
37 |
38 | @ Set the following to 1 if we have CORTEX_M4 (some ARMv7E-M)/*New_D*/
39 | .set USE_CORTEX_M4, 1
40 | @ END:
41 |
--------------------------------------------------------------------------------
/celt/arm/armopts.s.in:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2013 Mozilla Corporation */
2 | /*
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 |
7 | - Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 |
10 | - Redistributions in binary form must reproduce the above copyright
11 | notice, this list of conditions and the following disclaimer in the
12 | documentation and/or other materials provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
18 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | ; Set the following to 1 if we have EDSP instructions
28 | ; (LDRD/STRD, etc., ARMv5E and later).
29 | OPUS_ARM_MAY_HAVE_EDSP * @OPUS_ARM_MAY_HAVE_EDSP@
30 |
31 | ; Set the following to 1 if we have ARMv6 media instructions.
32 | OPUS_ARM_MAY_HAVE_MEDIA * @OPUS_ARM_MAY_HAVE_MEDIA@
33 |
34 | ; Set the following to 1 if we have NEON (some ARMv7)
35 | OPUS_ARM_MAY_HAVE_NEON * @OPUS_ARM_MAY_HAVE_NEON@
36 |
37 | ; Set the following to 1 if we have CORTEX_M4 (some ARMv7E-M)/*New_D*/
38 | USE_CORTEX_M4 * @USE_CORTEX_M4@
39 | END
40 |
--------------------------------------------------------------------------------
/celt/arm/celt_armv7e_intr.h:
--------------------------------------------------------------------------------
1 | /*
2 | * celt_armv7e_intr.h
3 | *
4 | * Created on: Nov 2, 2017
5 | * Author: Homer
6 | */
7 |
8 | #ifndef CELT_ARMV7E_INTR_H_
9 | #define CELT_ARMV7E_INTR_H_
10 |
11 |
12 | #include "arm_math.h"
13 |
14 | /** saturate a 32-bits signed value */
15 | #undef SATURATE
16 | static OPUS_INLINE opus_val32 SATURATE_armv7e (opus_val32 value, opus_val8 sat)
17 | {
18 | return __SSAT(value,sat);
19 | }
20 |
21 | #define SATURATE (x,a) (SATURATE_armv7e(x,a))
22 |
23 | #undef SATURATE
24 |
25 | /** sum two 16-bits signed values in parallel */
26 | #undef ADD2_16
27 | static OPUS_INLINE opus_val32 ADD2_16_armv7e (opus_val32 val_a, opus_val32 val_b)
28 | {
29 | return __SADD16(val_a,val_b);
30 | }
31 |
32 | #define ADD2_16(a,b) (ADD2_16_armv7e(a,b))
33 |
34 | /** Subtract two 16-bits signed values in parallel */
35 | #undef SUB2_16(a,b)
36 | static OPUS_INLINE opus_val32 SUB2_16_armv7e (opus_val32 val_a, opus_val32 val_b)
37 | {
38 | return __SSUB16(a,b);
39 | }
40 | #define SUB2_16(a,b) ( SUB2_16_armv7e(a,b))
41 |
42 |
43 |
44 | /**
45 | * @brief This function enables to exchange two halfwords of one operand and perform one 16-bit
46 | * integer subtraction
47 | * @param opus_val32 val1: first operand for the addition in the low halfword,
48 | * and the first operand for the subtraction in the high halfword.
49 | * @param opus_val32 val2: second operand for the addition in the high halfword,
50 | * and the second operand for the subtraction in the low halfword.
51 | * @retval opus_val32 res : res[15:0]= val1[15:0] + val2[31:16]
52 | * res[15:0]= val1[31:16] - val2[15:0]
53 | */
54 | #undef ADD_SUB_H
55 | static OPUS_INLINE opus_val32 ADD_SUB_H_armv7e (opus_val32 val1, opus_val32 val2)
56 | {
57 | return __SSAX(a,b);
58 | }
59 | #define ADD_SUB_H(a,b) (ADD_SUB_H_armv7e(a,b))
60 |
61 | /**
62 | * @brief This function enables to exchange two halfwords of the second operand, add the high halfwords
63 | * and subtract the low halfword
64 | * @param opus_val32 val1: first operand for the subtraction in the high halfword,
65 | * and the first operand for the addition in the lower halfword.
66 | * @param opus_val32 val2: second operand for the subtraction in the high halfword,
67 | * and the second operand for the addition in the low halfword.
68 | * @retval opus_val32 res : res[15:0]= val1[15:0] - val2[31:16]
69 | * res[15:0]= val1[31:16] + val2[15:0]
70 | */
71 | #undef SUB_ADD_H
72 | static OPUS_INLINE opus_val32 SUB_ADD_H_armv7e (opus_val32 val1, opus_val32 val2)
73 | {
74 | return __UASX(a,b);
75 | }
76 |
77 | #define SUB_ADD_H(a,b) (SUB_ADD_H_armv7e(a,b))
78 |
79 |
80 |
81 |
82 |
83 | /**This function counts The number of leading zeros of a data value */
84 | #undef EC_CLZ
85 | static OPUS_INLINE opus_val32 EC_CLZ_armv7e (opus_val32 _x)
86 | {
87 | return __CLZ(_x);
88 | }
89 | #define EC_CLZ(_x) (EC_CLZ_armv7e(_x))
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 | #endif /* CELT_ARMV7E_INTR_H_ */
100 |
--------------------------------------------------------------------------------
/celt/arm/fixed_arm64.h:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2015 Vidyo */
2 | /*
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 |
7 | - Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 |
10 | - Redistributions in binary form must reproduce the above copyright
11 | notice, this list of conditions and the following disclaimer in the
12 | documentation and/or other materials provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
18 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | #ifndef FIXED_ARM64_H
28 | #define FIXED_ARM64_H
29 |
30 | #include
31 |
32 | #undef SIG2WORD16
33 | #define SIG2WORD16(x) (vqmovns_s32(PSHR32((x), SIG_SHIFT)))
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/celt/arm/fixed_armv4.h:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2013 Xiph.Org Foundation and contributors */
2 | /*
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 |
7 | - Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 |
10 | - Redistributions in binary form must reproduce the above copyright
11 | notice, this list of conditions and the following disclaimer in the
12 | documentation and/or other materials provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
18 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | #ifndef FIXED_ARMv4_H
28 | #define FIXED_ARMv4_H
29 |
30 | /** 16x32 multiplication, followed by a 16-bit shift right. Results fits in 32 bits */
31 | #undef MULT16_32_Q16
32 | static OPUS_INLINE opus_val32 MULT16_32_Q16_armv4(opus_val16 a, opus_val32 b)
33 | {
34 | unsigned rd_lo;
35 | int rd_hi;
36 | __asm__(
37 | "#MULT16_32_Q16\n\t"
38 | "smull %0, %1, %2, %3\n\t"
39 | : "=&r"(rd_lo), "=&r"(rd_hi)
40 | : "%r"(b),"r"(SHL32(a,16))
41 | );
42 | return rd_hi;
43 | }
44 | #define MULT16_32_Q16(a, b) (MULT16_32_Q16_armv4(a, b))
45 |
46 |
47 | /** 16x32 multiplication, followed by a 15-bit shift right. Results fits in 32 bits */
48 | #undef MULT16_32_Q15
49 | static OPUS_INLINE opus_val32 MULT16_32_Q15_armv4(opus_val16 a, opus_val32 b)
50 | {
51 | unsigned rd_lo;
52 | int rd_hi;
53 | __asm__(
54 | "#MULT16_32_Q15\n\t"
55 | "smull %0, %1, %2, %3\n\t"
56 | : "=&r"(rd_lo), "=&r"(rd_hi)
57 | : "%r"(b), "r"(SHL32(a,16))
58 | );
59 | /*We intentionally don't OR in the high bit of rd_lo for speed.*/
60 | return SHL32(rd_hi,1);
61 | }
62 | #define MULT16_32_Q15(a, b) (MULT16_32_Q15_armv4(a, b))
63 |
64 |
65 | /** 16x32 multiply, followed by a 15-bit shift right and 32-bit add.
66 | b must fit in 31 bits.
67 | Result fits in 32 bits. */
68 | #undef MAC16_32_Q15
69 | #define MAC16_32_Q15(c, a, b) ADD32(c, MULT16_32_Q15(a, b))
70 |
71 | /** 16x32 multiply, followed by a 16-bit shift right and 32-bit add.
72 | Result fits in 32 bits. */
73 | #undef MAC16_32_Q16
74 | #define MAC16_32_Q16(c, a, b) ADD32(c, MULT16_32_Q16(a, b))
75 |
76 | /** 32x32 multiplication, followed by a 31-bit shift right. Results fits in 32 bits */
77 | #undef MULT32_32_Q31
78 | #define MULT32_32_Q31(a,b) (opus_val32)((((opus_int64)(a)) * ((opus_int64)(b)))>>31)
79 |
80 | #endif
81 |
--------------------------------------------------------------------------------
/celt/arm/kiss_fft_armv7e.h:
--------------------------------------------------------------------------------
1 | /*Copyright (c) 2013, Xiph.Org Foundation and contributors.
2 |
3 | All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | * Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the
12 | documentation and/or other materials provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
18 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | POSSIBILITY OF SUCH DAMAGE.*/
25 |
26 | #ifndef KISS_FFT_ARMv7E_H
27 | #define KISS_FFT_ARMv7E_H
28 |
29 | #ifdef HAVE_CONFIG_H /*new_D*/
30 | #include "config.h"
31 | #endif
32 |
33 | #include "kiss_fft_armv5e.h"
34 | /*Complex Multiplication*/
35 | void C_MUL32_armv7e(opus_val32 * in_cplxA, opus_val32 * in_cplxB, opus_val32 out_dest, opus_val32 nsamples){
36 |
37 | }
38 | /*Complex Conjugates input vector*/
39 | void CPLX_CONJ_armv7e(opus_val32 * in_cplxA,opus_val32 * dest_vect,opus_val32 nsamples){
40 |
41 | }
42 |
43 |
44 |
45 | #endif /*KISS_FFT_ARMv7E_H*/
46 |
--------------------------------------------------------------------------------
/celt/celt_lpc.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2009-2010 Xiph.Org Foundation
2 | Written by Jean-Marc Valin */
3 | /*
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions
6 | are met:
7 |
8 | - Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 |
11 | - Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in the
13 | documentation and/or other materials provided with the distribution.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
19 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifndef PLC_H
29 | #define PLC_H
30 |
31 | #include "arch.h"
32 | #include "cpu_support.h"
33 |
34 | #if defined(OPUS_X86_MAY_HAVE_SSE4_1)
35 | #include "x86/celt_lpc_sse.h"
36 | #endif
37 |
38 | #define LPC_ORDER 24
39 |
40 | void _celt_lpc(opus_val16 *_lpc, const opus_val32 *ac, int p);
41 |
42 | void celt_fir_c(
43 | const opus_val16 *x,
44 | const opus_val16 *num,
45 | opus_val16 *y,
46 | int N,
47 | int ord,
48 | opus_val16 *mem,
49 | int arch);
50 |
51 | #if !defined(OVERRIDE_CELT_FIR)
52 | #define celt_fir(x, num, y, N, ord, mem, arch) \
53 | (celt_fir_c(x, num, y, N, ord, mem, arch))
54 | #endif
55 |
56 | void celt_iir(const opus_val32 *x,
57 | const opus_val16 *den,
58 | opus_val32 *y,
59 | int N,
60 | int ord,
61 | opus_val16 *mem,
62 | int arch);
63 |
64 | int _celt_autocorr(const opus_val16 *x, opus_val32 *ac,
65 | const opus_val16 *window, int overlap, int lag, int n, int arch);
66 |
67 | #endif /* PLC_H */
68 |
--------------------------------------------------------------------------------
/celt/cpu_support.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2010 Xiph.Org Foundation
2 | * Copyright (c) 2013 Parrot */
3 | /*
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions
6 | are met:
7 |
8 | - Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 |
11 | - Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in the
13 | documentation and/or other materials provided with the distribution.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
19 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifndef CPU_SUPPORT_H
29 | #define CPU_SUPPORT_H
30 |
31 | #include "opus_types.h"
32 | #include "opus_defines.h"
33 |
34 | #if defined(OPUS_HAVE_RTCD) && \
35 | (defined(OPUS_ARM_ASM) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR))
36 | #include "arm/armcpu.h"
37 |
38 | /* We currently support 4 ARM variants:
39 | * arch[0] -> ARMv4
40 | * arch[1] -> ARMv5E
41 | * arch[2] -> ARMv6
42 | * arch[3] -> NEON
43 | */
44 | #define OPUS_ARCHMASK 3
45 |
46 | #elif (defined(OPUS_X86_MAY_HAVE_SSE) && !defined(OPUS_X86_PRESUME_SSE)) || \
47 | (defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(OPUS_X86_PRESUME_SSE2)) || \
48 | (defined(OPUS_X86_MAY_HAVE_SSE4_1) && !defined(OPUS_X86_PRESUME_SSE4_1)) || \
49 | (defined(OPUS_X86_MAY_HAVE_AVX) && !defined(OPUS_X86_PRESUME_AVX))
50 |
51 | #include "x86/x86cpu.h"
52 | /* We currently support 5 x86 variants:
53 | * arch[0] -> non-sse
54 | * arch[1] -> sse
55 | * arch[2] -> sse2
56 | * arch[3] -> sse4.1
57 | * arch[4] -> avx
58 | */
59 | #define OPUS_ARCHMASK 7
60 | int opus_select_arch(void);
61 |
62 | #elif defined(USE_CORTEX_M4)
63 | #include "arm/armcpu.h"
64 | #define OPUS_ARCHMASK 1
65 |
66 | #else
67 | #define OPUS_ARCHMASK 0
68 |
69 | static OPUS_INLINE int opus_select_arch(void)
70 | {
71 | return 0;
72 | }
73 | #endif
74 | #endif
75 |
--------------------------------------------------------------------------------
/celt/cwrs.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2007-2008 CSIRO
2 | Copyright (c) 2007-2009 Xiph.Org Foundation
3 | Copyright (c) 2007-2009 Timothy B. Terriberry
4 | Written by Timothy B. Terriberry and Jean-Marc Valin */
5 | /*
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions
8 | are met:
9 |
10 | - Redistributions of source code must retain the above copyright
11 | notice, this list of conditions and the following disclaimer.
12 |
13 | - Redistributions in binary form must reproduce the above copyright
14 | notice, this list of conditions and the following disclaimer in the
15 | documentation and/or other materials provided with the distribution.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
21 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #ifndef CWRS_H
31 | #define CWRS_H
32 |
33 | #include "arch.h"
34 | #include "stack_alloc.h"
35 | #include "entenc.h"
36 | #include "entdec.h"
37 |
38 | #ifdef CUSTOM_MODES
39 | int log2_frac(opus_uint32 val, int frac);
40 | #endif
41 |
42 | void get_required_bits(opus_int16 *bits, int N, int K, int frac);
43 |
44 | void encode_pulses(const int *_y, int N, int K, ec_enc *enc);
45 |
46 | opus_val32 decode_pulses(int *_y, int N, int K, ec_dec *dec);
47 |
48 | #endif /* CWRS_H */
49 |
--------------------------------------------------------------------------------
/celt/dump_modes/Makefile:
--------------------------------------------------------------------------------
1 |
2 | CFLAGS=-O2 -Wall -Wextra -DHAVE_CONFIG_H
3 | INCLUDES=-I. -I../ -I../.. -I../../include
4 |
5 | SOURCES = dump_modes.c \
6 | ../modes.c \
7 | ../cwrs.c \
8 | ../rate.c \
9 | ../entcode.c \
10 | ../entenc.c \
11 | ../entdec.c \
12 | ../mathops.c \
13 | ../mdct.c \
14 | ../kiss_fft.c
15 |
16 | ifdef HAVE_ARM_NE10
17 | CC = gcc
18 | CFLAGS += -mfpu=neon
19 | INCLUDES += -I$(NE10_INCDIR) -DHAVE_ARM_NE10 -DOPUS_ARM_PRESUME_NEON_INTR
20 | LIBS = -L$(NE10_LIBDIR) -lNE10
21 | SOURCES += ../arm/celt_ne10_fft.c \
22 | dump_modes_arm_ne10.c \
23 | ../arm/armcpu.c
24 | endif
25 |
26 | all: dump_modes
27 |
28 | dump_modes:
29 | $(PREFIX)$(CC) $(CFLAGS) $(INCLUDES) -DCUSTOM_MODES_ONLY -DCUSTOM_MODES $(SOURCES) -o $@ $(LIBS) -lm
30 |
31 | clean:
32 | rm -f dump_modes
33 |
--------------------------------------------------------------------------------
/celt/dump_modes/dump_modes_arch.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2015 Xiph.Org Foundation
2 | Written by Viswanath Puttagunta */
3 | /*
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions
6 | are met:
7 |
8 | - Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 |
11 | - Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in the
13 | documentation and/or other materials provided with the distribution.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
19 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifndef DUMP_MODE_ARCH_H
29 | #define DUMP_MODE_ARCH_H
30 |
31 | void dump_modes_arch_init();
32 | void dump_mode_arch(CELTMode *mode);
33 | void dump_modes_arch_finalize();
34 |
35 | #if !defined(FIXED_POINT)
36 | #define ARM_NE10_ARCH_FILE_NAME "static_modes_float_arm_ne10.h"
37 | #else
38 | #define ARM_NE10_ARCH_FILE_NAME "static_modes_fixed_arm_ne10.h"
39 | #endif
40 |
41 | #if defined(HAVE_ARM_NE10)
42 | #define OVERRIDE_FFT (1)
43 | #endif
44 |
45 | #endif
46 |
--------------------------------------------------------------------------------
/celt/fixed_c5x.h:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2003 Jean-Marc Valin */
2 | /**
3 | @file fixed_c5x.h
4 | @brief Fixed-point operations for the TI C5x DSP family
5 | */
6 | /*
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions
9 | are met:
10 |
11 | - Redistributions of source code must retain the above copyright
12 | notice, this list of conditions and the following disclaimer.
13 |
14 | - Redistributions in binary form must reproduce the above copyright
15 | notice, this list of conditions and the following disclaimer in the
16 | documentation and/or other materials provided with the distribution.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
22 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 | */
30 |
31 | #ifndef FIXED_C5X_H
32 | #define FIXED_C5X_H
33 |
34 | #include "dsplib.h"
35 |
36 | #undef IMUL32
37 | static OPUS_INLINE long IMUL32(long i, long j)
38 | {
39 | long ac0, ac1;
40 | ac0 = _lmpy(i>>16,j);
41 | ac1 = ac0 + _lmpy(i,j>>16);
42 | return _lmpyu(i,j) + (ac1<<16);
43 | }
44 |
45 | #undef MAX16
46 | #define MAX16(a,b) _max(a,b)
47 |
48 | #undef MIN16
49 | #define MIN16(a,b) _min(a,b)
50 |
51 | #undef MAX32
52 | #define MAX32(a,b) _lmax(a,b)
53 |
54 | #undef MIN32
55 | #define MIN32(a,b) _lmin(a,b)
56 |
57 | #undef VSHR32
58 | #define VSHR32(a, shift) _lshl(a,-(shift))
59 |
60 | #undef MULT16_16_Q15
61 | #define MULT16_16_Q15(a,b) (_smpy(a,b))
62 |
63 | #undef MULT16_16SU
64 | #define MULT16_16SU(a,b) _lmpysu(a,b)
65 |
66 | #undef MULT_16_16
67 | #define MULT_16_16(a,b) _lmpy(a,b)
68 |
69 | /* FIXME: This is technically incorrect and is bound to cause problems. Is there any cleaner solution? */
70 | #undef MULT16_32_Q15
71 | #define MULT16_32_Q15(a,b) ADD32(SHL(MULT16_16((a),SHR((b),16)),1), SHR(MULT16_16SU((a),(b)),15))
72 |
73 | #define celt_ilog2(x) (30 - _lnorm(x))
74 | #define OVERRIDE_CELT_ILOG2
75 |
76 | #define celt_maxabs16(x, len) MAX32(EXTEND32(maxval((DATA *)x, len)),-EXTEND32(minval((DATA *)x, len)))
77 | #define OVERRIDE_CELT_MAXABS16
78 |
79 | #endif /* FIXED_C5X_H */
80 |
--------------------------------------------------------------------------------
/celt/fixed_c6x.h:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2008 CSIRO */
2 | /**
3 | @file fixed_c6x.h
4 | @brief Fixed-point operations for the TI C6x DSP family
5 | */
6 | /*
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions
9 | are met:
10 |
11 | - Redistributions of source code must retain the above copyright
12 | notice, this list of conditions and the following disclaimer.
13 |
14 | - Redistributions in binary form must reproduce the above copyright
15 | notice, this list of conditions and the following disclaimer in the
16 | documentation and/or other materials provided with the distribution.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
22 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 | */
30 |
31 | #ifndef FIXED_C6X_H
32 | #define FIXED_C6X_H
33 |
34 | #undef MULT16_16SU
35 | #define MULT16_16SU(a,b) _mpysu(a,b)
36 |
37 | #undef MULT_16_16
38 | #define MULT_16_16(a,b) _mpy(a,b)
39 |
40 | #define celt_ilog2(x) (30 - _norm(x))
41 | #define OVERRIDE_CELT_ILOG2
42 |
43 | #undef MULT16_32_Q15
44 | #define MULT16_32_Q15(a,b) (_mpylill(a, b) >> 15)
45 |
46 | #if 0
47 | #include "dsplib.h"
48 |
49 | #undef MAX16
50 | #define MAX16(a,b) _max(a,b)
51 |
52 | #undef MIN16
53 | #define MIN16(a,b) _min(a,b)
54 |
55 | #undef MAX32
56 | #define MAX32(a,b) _lmax(a,b)
57 |
58 | #undef MIN32
59 | #define MIN32(a,b) _lmin(a,b)
60 |
61 | #undef VSHR32
62 | #define VSHR32(a, shift) _lshl(a,-(shift))
63 |
64 | #undef MULT16_16_Q15
65 | #define MULT16_16_Q15(a,b) (_smpy(a,b))
66 |
67 | #define celt_maxabs16(x, len) MAX32(EXTEND32(maxval((DATA *)x, len)),-EXTEND32(minval((DATA *)x, len)))
68 | #define OVERRIDE_CELT_MAXABS16
69 |
70 | #endif /* FIXED_C6X_H */
71 |
--------------------------------------------------------------------------------
/celt/laplace.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2007 CSIRO
2 | Copyright (c) 2007-2009 Xiph.Org Foundation
3 | Written by Jean-Marc Valin */
4 | /*
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions
7 | are met:
8 |
9 | - Redistributions of source code must retain the above copyright
10 | notice, this list of conditions and the following disclaimer.
11 |
12 | - Redistributions in binary form must reproduce the above copyright
13 | notice, this list of conditions and the following disclaimer in the
14 | documentation and/or other materials provided with the distribution.
15 |
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
20 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | #include "entenc.h"
30 | #include "entdec.h"
31 |
32 | /** Encode a value that is assumed to be the realisation of a
33 | Laplace-distributed random process
34 | @param enc Entropy encoder state
35 | @param value Value to encode
36 | @param fs Probability of 0, multiplied by 32768
37 | @param decay Probability of the value +/- 1, multiplied by 16384
38 | */
39 | void ec_laplace_encode(ec_enc *enc, int *value, unsigned fs, int decay);
40 |
41 | /** Decode a value that is assumed to be the realisation of a
42 | Laplace-distributed random process
43 | @param dec Entropy decoder state
44 | @param fs Probability of 0, multiplied by 32768
45 | @param decay Probability of the value +/- 1, multiplied by 16384
46 | @return Value decoded
47 | */
48 | int ec_laplace_decode(ec_dec *dec, unsigned fs, int decay);
49 |
--------------------------------------------------------------------------------
/celt/mfrngcod.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2001-2008 Timothy B. Terriberry
2 | Copyright (c) 2008-2009 Xiph.Org Foundation */
3 | /*
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions
6 | are met:
7 |
8 | - Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 |
11 | - Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in the
13 | documentation and/or other materials provided with the distribution.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
19 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #if !defined(_mfrngcode_H)
29 | # define _mfrngcode_H (1)
30 | # include "entcode.h"
31 |
32 | /*Constants used by the entropy encoder/decoder.*/
33 |
34 | /*The number of bits to output at a time.*/
35 | # define EC_SYM_BITS (8)
36 | /*The total number of bits in each of the state registers.*/
37 | # define EC_CODE_BITS (32)
38 | /*The maximum symbol value.*/
39 | # define EC_SYM_MAX ((1U<>EC_SYM_BITS)
46 | /*The number of bits available for the last, partial symbol in the code field.*/
47 | # define EC_CODE_EXTRA ((EC_CODE_BITS-2)%EC_SYM_BITS+1)
48 | #endif
49 |
--------------------------------------------------------------------------------
/celt/modes.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2007-2008 CSIRO
2 | Copyright (c) 2007-2009 Xiph.Org Foundation
3 | Copyright (c) 2008 Gregory Maxwell
4 | Written by Jean-Marc Valin and Gregory Maxwell */
5 | /*
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions
8 | are met:
9 |
10 | - Redistributions of source code must retain the above copyright
11 | notice, this list of conditions and the following disclaimer.
12 |
13 | - Redistributions in binary form must reproduce the above copyright
14 | notice, this list of conditions and the following disclaimer in the
15 | documentation and/or other materials provided with the distribution.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
21 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #ifndef MODES_H
31 | #define MODES_H
32 |
33 | #include "opus_types.h"
34 | #include "celt.h"
35 | #include "arch.h"
36 | #include "mdct.h"
37 | #include "entenc.h"
38 | #include "entdec.h"
39 |
40 | #define MAX_PERIOD 1024
41 |
42 | typedef struct {
43 | int size;
44 | const opus_int16 *index;
45 | const unsigned char *bits;
46 | const unsigned char *caps;
47 | } PulseCache;
48 |
49 | /** Mode definition (opaque)
50 | @brief Mode definition
51 | */
52 | struct OpusCustomMode {
53 | opus_int32 Fs;
54 | int overlap;
55 |
56 | int nbEBands;
57 | int effEBands;
58 | opus_val16 preemph[4];
59 | const opus_int16 *eBands; /**< Definition for each "pseudo-critical band" */
60 |
61 | int maxLM;
62 | int nbShortMdcts;
63 | int shortMdctSize;
64 |
65 | int nbAllocVectors; /**< Number of lines in the matrix below */
66 | const unsigned char *allocVectors; /**< Number of bits in each band for several rates */
67 | const opus_int16 *logN;
68 |
69 | const opus_val16 *window;
70 | mdct_lookup mdct;
71 | PulseCache cache;
72 | };
73 |
74 |
75 | #endif
76 |
--------------------------------------------------------------------------------
/celt/quant_bands.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2007-2008 CSIRO
2 | Copyright (c) 2007-2009 Xiph.Org Foundation
3 | Written by Jean-Marc Valin */
4 | /*
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions
7 | are met:
8 |
9 | - Redistributions of source code must retain the above copyright
10 | notice, this list of conditions and the following disclaimer.
11 |
12 | - Redistributions in binary form must reproduce the above copyright
13 | notice, this list of conditions and the following disclaimer in the
14 | documentation and/or other materials provided with the distribution.
15 |
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
20 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | #ifndef QUANT_BANDS
30 | #define QUANT_BANDS
31 |
32 | #include "arch.h"
33 | #include "modes.h"
34 | #include "entenc.h"
35 | #include "entdec.h"
36 | #include "mathops.h"
37 |
38 | #ifdef FIXED_POINT
39 | extern const signed char eMeans[25];
40 | #else
41 | extern const opus_val16 eMeans[25];
42 | #endif
43 |
44 | void amp2Log2(const CELTMode *m, int effEnd, int end,
45 | celt_ener *bandE, opus_val16 *bandLogE, int C);
46 |
47 | void log2Amp(const CELTMode *m, int start, int end,
48 | celt_ener *eBands, const opus_val16 *oldEBands, int C);
49 |
50 | void quant_coarse_energy(const CELTMode *m, int start, int end, int effEnd,
51 | const opus_val16 *eBands, opus_val16 *oldEBands, opus_uint32 budget,
52 | opus_val16 *error, ec_enc *enc, int C, int LM,
53 | int nbAvailableBytes, int force_intra, opus_val32 *delayedIntra,
54 | int two_pass, int loss_rate, int lfe);
55 |
56 | void quant_fine_energy(const CELTMode *m, int start, int end, opus_val16 *oldEBands, opus_val16 *error, int *fine_quant, ec_enc *enc, int C);
57 |
58 | void quant_energy_finalise(const CELTMode *m, int start, int end, opus_val16 *oldEBands, opus_val16 *error, int *fine_quant, int *fine_priority, int bits_left, ec_enc *enc, int C);
59 |
60 | void unquant_coarse_energy(const CELTMode *m, int start, int end, opus_val16 *oldEBands, int intra, ec_dec *dec, int C, int LM);
61 |
62 | void unquant_fine_energy(const CELTMode *m, int start, int end, opus_val16 *oldEBands, int *fine_quant, ec_dec *dec, int C);
63 |
64 | void unquant_energy_finalise(const CELTMode *m, int start, int end, opus_val16 *oldEBands, int *fine_quant, int *fine_priority, int bits_left, ec_dec *dec, int C);
65 |
66 | #endif /* QUANT_BANDS */
67 |
--------------------------------------------------------------------------------
/celt/static_modes_fixed_armv7e.h:
--------------------------------------------------------------------------------
1 | #ifndef ARMV7E_FFT_PARAMS48000_960
2 | #define ARMV7E_FFT_PARAMS48000_960
3 |
4 |
5 | static const arch_fft_state cfg_arch_480 = {
6 | 0,
7 | NULL,
8 | };
9 |
10 | static const arch_fft_state cfg_arch_240 = {
11 | 0,
12 | NULL,
13 | };
14 |
15 |
16 | static const arch_fft_state cfg_arch_120 = {
17 | 0,
18 | NULL,
19 | };
20 |
21 | static const arch_fft_state cfg_arch_60 = {
22 | 0,
23 | NULL,
24 | };
25 |
26 | #endif /* end ARMV7E_FFT_PARAMS48000_960 */
--------------------------------------------------------------------------------
/celt/tests/test_unit_laplace.c:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2008-2011 Xiph.Org Foundation, Mozilla Corporation
2 | Written by Jean-Marc Valin and Timothy B. Terriberry */
3 | /*
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions
6 | are met:
7 |
8 | - Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 |
11 | - Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in the
13 | documentation and/or other materials provided with the distribution.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
19 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include
33 | #include
34 | #include "laplace.h"
35 | #define CELT_C
36 | #include "stack_alloc.h"
37 |
38 | #include "entenc.c"
39 | #include "entdec.c"
40 | #include "entcode.c"
41 | #include "laplace.c"
42 |
43 | #define DATA_SIZE 40000
44 |
45 | int ec_laplace_get_start_freq(int decay)
46 | {
47 | opus_uint32 ft = 32768 - LAPLACE_MINP*(2*LAPLACE_NMIN+1);
48 | int fs = (ft*(16384-decay))/(16384+decay);
49 | return fs+LAPLACE_MINP;
50 | }
51 |
52 | int main(void)
53 | {
54 | int i;
55 | int ret = 0;
56 | ec_enc enc;
57 | ec_dec dec;
58 | unsigned char *ptr;
59 | int val[10000], decay[10000];
60 | ALLOC_STACK;
61 | ptr = (unsigned char *)malloc(DATA_SIZE);
62 | ec_enc_init(&enc,ptr,DATA_SIZE);
63 |
64 | val[0] = 3; decay[0] = 6000;
65 | val[1] = 0; decay[1] = 5800;
66 | val[2] = -1; decay[2] = 5600;
67 | for (i=3;i<10000;i++)
68 | {
69 | val[i] = rand()%15-7;
70 | decay[i] = rand()%11000+5000;
71 | }
72 | for (i=0;i<10000;i++)
73 | ec_laplace_encode(&enc, &val[i],
74 | ec_laplace_get_start_freq(decay[i]), decay[i]);
75 |
76 | ec_enc_done(&enc);
77 |
78 | ec_dec_init(&dec,ec_get_buffer(&enc),ec_range_bytes(&enc));
79 |
80 | for (i=0;i<10000;i++)
81 | {
82 | int d = ec_laplace_decode(&dec,
83 | ec_laplace_get_start_freq(decay[i]), decay[i]);
84 | if (d != val[i])
85 | {
86 | fprintf (stderr, "Got %d instead of %d\n", d, val[i]);
87 | ret = 1;
88 | }
89 | }
90 |
91 | free(ptr);
92 | return ret;
93 | }
94 |
--------------------------------------------------------------------------------
/celt/tests/test_unit_types.c:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2008-2011 Xiph.Org Foundation
2 | Written by Jean-Marc Valin */
3 | /*
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions
6 | are met:
7 |
8 | - Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 |
11 | - Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in the
13 | documentation and/or other materials provided with the distribution.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
19 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "opus_types.h"
33 | #include
34 |
35 | int main(void)
36 | {
37 | opus_int16 i = 1;
38 | i <<= 14;
39 | if (i>>14 != 1)
40 | {
41 | fprintf(stderr, "opus_int16 isn't 16 bits\n");
42 | return 1;
43 | }
44 | if (sizeof(opus_int16)*2 != sizeof(opus_int32))
45 | {
46 | fprintf(stderr, "16*2 != 32\n");
47 | return 1;
48 | }
49 | return 0;
50 | }
51 |
--------------------------------------------------------------------------------
/celt/vq.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2007-2008 CSIRO
2 | Copyright (c) 2007-2009 Xiph.Org Foundation
3 | Written by Jean-Marc Valin */
4 | /**
5 | @file vq.h
6 | @brief Vector quantisation of the residual
7 | */
8 | /*
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions
11 | are met:
12 |
13 | - Redistributions of source code must retain the above copyright
14 | notice, this list of conditions and the following disclaimer.
15 |
16 | - Redistributions in binary form must reproduce the above copyright
17 | notice, this list of conditions and the following disclaimer in the
18 | documentation and/or other materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
24 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 | */
32 |
33 | #ifndef VQ_H
34 | #define VQ_H
35 |
36 | #include "entenc.h"
37 | #include "entdec.h"
38 | #include "modes.h"
39 |
40 | #if defined(MIPSr1_ASM)
41 | #include "mips/vq_mipsr1.h"
42 | #endif
43 |
44 |
45 | /** Algebraic pulse-vector quantiser. The signal x is replaced by the sum of
46 | * the pitch and a combination of pulses such that its norm is still equal
47 | * to 1. This is the function that will typically require the most CPU.
48 | * @param X Residual signal to quantise/encode (returns quantised version)
49 | * @param N Number of samples to encode
50 | * @param K Number of pulses to use
51 | * @param enc Entropy encoder state
52 | * @ret A mask indicating which blocks in the band received pulses
53 | */
54 | unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B,
55 | ec_enc *enc
56 | #ifdef RESYNTH
57 | , opus_val16 gain
58 | #endif
59 | );
60 |
61 | /** Algebraic pulse decoder
62 | * @param X Decoded normalised spectrum (returned)
63 | * @param N Number of samples to decode
64 | * @param K Number of pulses to use
65 | * @param dec Entropy decoder state
66 | * @ret A mask indicating which blocks in the band received pulses
67 | */
68 | unsigned alg_unquant(celt_norm *X, int N, int K, int spread, int B,
69 | ec_dec *dec, opus_val16 gain);
70 |
71 | void renormalise_vector(celt_norm *X, int N, opus_val16 gain, int arch);
72 |
73 | int stereo_itheta(const celt_norm *X, const celt_norm *Y, int stereo, int N, int arch);
74 |
75 | #endif /* VQ_H */
76 |
--------------------------------------------------------------------------------
/celt/x86/celt_lpc_sse.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2014, Cisco Systems, INC
2 | Written by XiangMingZhu WeiZhou MinPeng YanWang
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions
6 | are met:
7 |
8 | - Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 |
11 | - Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in the
13 | documentation and/or other materials provided with the distribution.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
19 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifndef CELT_LPC_SSE_H
29 | #define CELT_LPC_SSE_H
30 |
31 | #ifdef HAVE_CONFIG_H
32 | #include "config.h"
33 | #endif
34 |
35 | #if defined(OPUS_X86_MAY_HAVE_SSE4_1) && defined(FIXED_POINT)
36 | #define OVERRIDE_CELT_FIR
37 |
38 | void celt_fir_sse4_1(
39 | const opus_val16 *x,
40 | const opus_val16 *num,
41 | opus_val16 *y,
42 | int N,
43 | int ord,
44 | opus_val16 *mem,
45 | int arch);
46 |
47 | #if defined(OPUS_X86_PRESUME_SSE4_1)
48 | #define celt_fir(x, num, y, N, ord, mem, arch) \
49 | ((void)arch, celt_fir_sse4_1(x, num, y, N, ord, mem, arch))
50 |
51 | #else
52 |
53 | extern void (*const CELT_FIR_IMPL[OPUS_ARCHMASK + 1])(
54 | const opus_val16 *x,
55 | const opus_val16 *num,
56 | opus_val16 *y,
57 | int N,
58 | int ord,
59 | opus_val16 *mem,
60 | int arch);
61 |
62 | # define celt_fir(x, num, y, N, ord, mem, arch) \
63 | ((*CELT_FIR_IMPL[(arch) & OPUS_ARCHMASK])(x, num, y, N, ord, mem, arch))
64 |
65 | #endif
66 | #endif
67 |
68 | #endif
69 |
--------------------------------------------------------------------------------
/celt/x86/vq_sse.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2016 Jean-Marc Valin */
2 | /*
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 |
7 | - Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 |
10 | - Redistributions in binary form must reproduce the above copyright
11 | notice, this list of conditions and the following disclaimer in the
12 | documentation and/or other materials provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
18 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | #ifndef VQ_SSE_H
28 | #define VQ_SSE_H
29 |
30 | #if defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(FIXED_POINT)
31 | #define OVERRIDE_OP_PVQ_SEARCH
32 |
33 | opus_val16 op_pvq_search_sse2(celt_norm *_X, int *iy, int K, int N, int arch);
34 |
35 | #if defined(OPUS_X86_PRESUME_SSE2)
36 | #define op_pvq_search(x, iy, K, N, arch) \
37 | (op_pvq_search_sse2(x, iy, K, N, arch))
38 |
39 | #else
40 |
41 | extern opus_val16 (*const OP_PVQ_SEARCH_IMPL[OPUS_ARCHMASK + 1])(
42 | celt_norm *_X, int *iy, int K, int N, int arch);
43 |
44 | # define op_pvq_search(X, iy, K, N, arch) \
45 | ((*OP_PVQ_SEARCH_IMPL[(arch) & OPUS_ARCHMASK])(X, iy, K, N, arch))
46 |
47 | #endif
48 | #endif
49 |
50 | #endif
51 |
--------------------------------------------------------------------------------
/celt_headers.mk:
--------------------------------------------------------------------------------
1 | CELT_HEAD = \
2 | celt/arch.h \
3 | celt/bands.h \
4 | celt/celt.h \
5 | celt/cpu_support.h \
6 | include/opus_types.h \
7 | include/opus_defines.h \
8 | include/opus_custom.h \
9 | celt/cwrs.h \
10 | celt/ecintrin.h \
11 | celt/entcode.h \
12 | celt/entdec.h \
13 | celt/entenc.h \
14 | celt/fixed_debug.h \
15 | celt/fixed_generic.h \
16 | celt/float_cast.h \
17 | celt/_kiss_fft_guts.h \
18 | celt/kiss_fft.h \
19 | celt/laplace.h \
20 | celt/mathops.h \
21 | celt/mdct.h \
22 | celt/mfrngcod.h \
23 | celt/modes.h \
24 | celt/os_support.h \
25 | celt/pitch.h \
26 | celt/celt_lpc.h \
27 | celt/x86/celt_lpc_sse.h \
28 | celt/quant_bands.h \
29 | celt/rate.h \
30 | celt/stack_alloc.h \
31 | celt/vq.h \
32 | celt/static_modes_float.h \
33 | celt/static_modes_fixed.h \
34 | celt/static_modes_float_arm_ne10.h \
35 | celt/static_modes_fixed_arm_ne10.h \
36 | celt/arm/armcpu.h \
37 | celt/arm/fixed_armv4.h \
38 | celt/arm/fixed_armv5e.h \
39 | celt/arm/kiss_fft_armv4.h \
40 | celt/arm/kiss_fft_armv5e.h \
41 | celt/arm/pitch_arm.h \
42 | celt/arm/fft_arm.h \
43 | celt/arm/mdct_arm.h \
44 | celt/mips/celt_mipsr1.h \
45 | celt/mips/fixed_generic_mipsr1.h \
46 | celt/mips/kiss_fft_mipsr1.h \
47 | celt/mips/mdct_mipsr1.h \
48 | celt/mips/pitch_mipsr1.h \
49 | celt/mips/vq_mipsr1.h \
50 | celt/x86/pitch_sse.h \
51 | celt/x86/x86cpu.h
52 |
--------------------------------------------------------------------------------
/celt_sources.mk:
--------------------------------------------------------------------------------
1 | CELT_SOURCES = celt/bands.c \
2 | celt/celt.c \
3 | celt/celt_encoder.c \
4 | celt/celt_decoder.c \
5 | celt/cwrs.c \
6 | celt/entcode.c \
7 | celt/entdec.c \
8 | celt/entenc.c \
9 | celt/kiss_fft.c \
10 | celt/laplace.c \
11 | celt/mathops.c \
12 | celt/mdct.c \
13 | celt/modes.c \
14 | celt/pitch.c \
15 | celt/celt_lpc.c \
16 | celt/quant_bands.c \
17 | celt/rate.c \
18 | celt/vq.c
19 |
20 | CELT_SOURCES_SSE = celt/x86/x86cpu.c \
21 | celt/x86/x86_celt_map.c \
22 | celt/x86/pitch_sse.c
23 |
24 | CELT_SOURCES_SSE2 = celt/x86/pitch_sse2.c
25 |
26 | CELT_SOURCES_SSE4_1 = celt/x86/celt_lpc_sse.c \
27 | celt/x86/pitch_sse4_1.c
28 |
29 | CELT_SOURCES_ARM = \
30 | celt/arm/armcpu.c \
31 | celt/arm/arm_celt_map.c
32 |
33 | CELT_SOURCES_ARM_ASM = \
34 | celt/arm/celt_pitch_xcorr_arm.s
35 |
36 | CELT_AM_SOURCES_ARM_ASM = \
37 | celt/arm/armopts.s.in
38 |
39 | CELT_SOURCES_ARM_NEON_INTR = \
40 | celt/arm/celt_neon_intr.c
41 |
42 | CELT_SOURCES_ARM_NE10= \
43 | celt/arm/celt_ne10_fft.c \
44 | celt/arm/celt_ne10_mdct.c
45 |
--------------------------------------------------------------------------------
/doc/Makefile.am:
--------------------------------------------------------------------------------
1 | ## Process this file with automake to produce Makefile.in
2 |
3 | DOCINPUTS = $(top_srcdir)/include/opus.h \
4 | $(top_srcdir)/include/opus_multistream.h \
5 | $(top_srcdir)/include/opus_defines.h \
6 | $(top_srcdir)/include/opus_types.h \
7 | $(top_srcdir)/include/opus_custom.h \
8 | $(top_srcdir)/doc/header.html \
9 | $(top_srcdir)/doc/footer.html \
10 | $(top_srcdir)/doc/customdoxygen.css
11 |
12 | EXTRA_DIST = customdoxygen.css Doxyfile.in footer.html header.html \
13 | opus_logo.svg trivial_example.c
14 |
15 |
16 | if HAVE_DOXYGEN
17 |
18 | all-local: doxygen-build.stamp
19 |
20 | doxygen-build.stamp: Doxyfile $(DOCINPUTS)
21 | doxygen
22 | touch $@
23 |
24 | install-data-local:
25 | $(INSTALL) -d $(DESTDIR)$(docdir)/html/search
26 | for f in `find html -type f \! -name "installdox"`; do \
27 | $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/$$f; \
28 | done
29 |
30 | $(INSTALL) -d $(DESTDIR)$(mandir)/man3
31 | cd man && find man3 -type f -name opus_*.3 \
32 | -exec $(INSTALL_DATA) \{} $(DESTDIR)$(mandir)/man3 \;
33 |
34 | clean-local:
35 | $(RM) -r html
36 | $(RM) -r latex
37 | $(RM) -r man
38 | $(RM) doxygen-build.stamp
39 |
40 | uninstall-local:
41 | $(RM) -r $(DESTDIR)$(docdir)/html
42 | $(RM) $(DESTDIR)$(mandir)/man3/opus_*.3 $(DESTDIR)$(mandir)/man3/opus.h.3
43 |
44 | endif
45 |
--------------------------------------------------------------------------------
/doc/TODO:
--------------------------------------------------------------------------------
1 | define audio bandwidth as frequency range
2 |
3 | repeat padding recommendation
4 |
5 | ptime: refer to RFC
6 |
7 | Opus does not provide any confidentiality or integrity protection
8 |
--------------------------------------------------------------------------------
/doc/build_isobmff.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Copyright (c) 2014 Xiph.Org Foundation and Mozilla Foundation
4 | #
5 | # Redistribution and use in source and binary forms, with or without
6 | # modification, are permitted provided that the following conditions
7 | # are met:
8 | #
9 | # - Redistributions of source code must retain the above copyright
10 | # notice, this list of conditions and the following disclaimer.
11 | #
12 | # - Redistributions in binary form must reproduce the above copyright
13 | # notice, this list of conditions and the following disclaimer in the
14 | # documentation and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 | # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
20 | # OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 |
28 | #Stop on errors
29 | set -e
30 | #Set the CWD to the location of this script
31 | [ -n "${0%/*}" ] && cd "${0%/*}"
32 |
33 | HTML=opus_in_isobmff.html
34 |
35 | echo downloading updates...
36 | CSS=${HTML%%.html}.css
37 | wget -q http://vfrmaniac.fushizen.eu/contents/${HTML} -O ${HTML}
38 | wget -q http://vfrmaniac.fushizen.eu/style.css -O ${CSS}
39 |
40 | echo updating links...
41 | cat ${HTML} | sed -e "s/\\.\\.\\/style.css/${CSS}/" > ${HTML}+ && mv ${HTML}+ ${HTML}
42 |
43 | echo stripping...
44 | cat ${HTML} | sed -e 's///g' > ${HTML}+ && mv ${HTML}+ ${HTML}
45 | cat ${HTML} | sed -e 's/ *$//g' > ${HTML}+ && mv ${HTML}+ ${HTML}
46 | cat ${CSS} | sed -e 's/ *$//g' > ${CSS}+ && mv ${CSS}+ ${CSS}
47 |
48 |
49 | VERSION=$(fgrep Version ${HTML} | sed 's/.*Version \([0-9]\.[0-9]\.[0-9]\).*/\1/')
50 | echo Now at version ${VERSION}
51 |
--------------------------------------------------------------------------------
/doc/build_oggdraft.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Copyright (c) 2012 Xiph.Org Foundation and Mozilla Corporation
4 | #
5 | # This file is extracted from RFC6716. Please see that RFC for additional
6 | # information.
7 | #
8 | # Redistribution and use in source and binary forms, with or without
9 | # modification, are permitted provided that the following conditions
10 | # are met:
11 | #
12 | # - Redistributions of source code must retain the above copyright
13 | # notice, this list of conditions and the following disclaimer.
14 | #
15 | # - Redistributions in binary form must reproduce the above copyright
16 | # notice, this list of conditions and the following disclaimer in the
17 | # documentation and/or other materials provided with the distribution.
18 | #
19 | # - Neither the name of Internet Society, IETF or IETF Trust, nor the
20 | # names of specific contributors, may be used to endorse or promote
21 | # products derived from this software without specific prior written
22 | # permission.
23 | #
24 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 | # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
28 | # OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
30 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
31 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
32 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 |
36 | #Stop on errors
37 | set -e
38 | #Set the CWD to the location of this script
39 | [ -n "${0%/*}" ] && cd "${0%/*}"
40 |
41 | if test -z `which xml2rfc 2> /dev/null`; then
42 | echo "Error: couldn't find xml2rfc."
43 | echo
44 | echo "Please install xml2rfc version 2 or later."
45 | echo "E.g. 'pip install xml2rfc' or follow the instructions"
46 | echo "on http://pypi.python.org/pypi/xml2rfc/ or tools.ietf.org."
47 | exit 1
48 | fi
49 |
50 | echo running xml2rfc
51 | # version 2 syntax
52 | xml2rfc draft-ietf-codec-oggopus.xml --text --html
53 |
--------------------------------------------------------------------------------
/doc/footer.html:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
18 |
19 |