summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConstruct10
-rw-r--r--drivers/SCsub7
-rw-r--r--drivers/ogg/SCsub9
-rw-r--r--drivers/opus/SCsub196
-rw-r--r--drivers/register_driver_types.cpp55
-rw-r--r--drivers/vorbis/SCsub36
-rw-r--r--modules/ogg/SCsub20
-rw-r--r--modules/ogg/config.py6
-rw-r--r--modules/ogg/register_types.cpp35
-rw-r--r--modules/ogg/register_types.h30
-rw-r--r--modules/opus/SCsub211
-rw-r--r--modules/opus/audio_stream_opus.cpp (renamed from drivers/opus/audio_stream_opus.cpp)0
-rw-r--r--modules/opus/audio_stream_opus.h (renamed from drivers/opus/audio_stream_opus.h)8
-rw-r--r--modules/opus/config.py6
-rw-r--r--modules/opus/register_types.cpp45
-rw-r--r--modules/opus/register_types.h30
-rw-r--r--modules/vorbis/SCsub44
-rw-r--r--modules/vorbis/audio_stream_ogg_vorbis.cpp (renamed from drivers/vorbis/audio_stream_ogg_vorbis.cpp)0
-rw-r--r--modules/vorbis/audio_stream_ogg_vorbis.h (renamed from drivers/vorbis/audio_stream_ogg_vorbis.h)6
-rw-r--r--modules/vorbis/config.py6
-rw-r--r--modules/vorbis/register_types.cpp45
-rw-r--r--modules/vorbis/register_types.h30
-rw-r--r--platform/android/detect.py3
-rw-r--r--platform/iphone/detect.py3
-rw-r--r--platform/javascript/detect.py5
-rw-r--r--platform/x11/detect.py11
-rw-r--r--thirdparty/README.md40
-rw-r--r--thirdparty/libogg/COPYING (renamed from drivers/ogg/COPYING)0
-rw-r--r--thirdparty/libogg/bitwise.c (renamed from drivers/ogg/bitwise.c)0
-rw-r--r--thirdparty/libogg/framing.c (renamed from drivers/ogg/framing.c)0
-rw-r--r--thirdparty/libogg/ogg/config_types.h (renamed from drivers/ogg/config_types.h)0
-rw-r--r--thirdparty/libogg/ogg/ogg.h (renamed from drivers/ogg/ogg.h)0
-rw-r--r--thirdparty/libogg/ogg/os_types.h (renamed from drivers/ogg/os_types.h)0
-rw-r--r--thirdparty/libvorbis/COPYING (renamed from drivers/vorbis/COPYING)0
-rw-r--r--thirdparty/libvorbis/analysis.c (renamed from drivers/vorbis/analysis.c)0
-rw-r--r--thirdparty/libvorbis/backends.h (renamed from drivers/vorbis/backends.h)0
-rw-r--r--thirdparty/libvorbis/barkmel.c (renamed from drivers/vorbis/barkmel.c)0
-rw-r--r--thirdparty/libvorbis/bitrate.c (renamed from drivers/vorbis/bitrate.c)0
-rw-r--r--thirdparty/libvorbis/bitrate.h (renamed from drivers/vorbis/bitrate.h)0
-rw-r--r--thirdparty/libvorbis/block.c (renamed from drivers/vorbis/block.c)0
-rw-r--r--thirdparty/libvorbis/books/coupled/res_books_51.h (renamed from drivers/vorbis/books/coupled/res_books_51.h)0
-rw-r--r--thirdparty/libvorbis/books/coupled/res_books_stereo.h (renamed from drivers/vorbis/books/coupled/res_books_stereo.h)0
-rw-r--r--thirdparty/libvorbis/books/floor/floor_books.h (renamed from drivers/vorbis/books/floor/floor_books.h)0
-rw-r--r--thirdparty/libvorbis/books/uncoupled/res_books_uncoupled.h (renamed from drivers/vorbis/books/uncoupled/res_books_uncoupled.h)0
-rw-r--r--thirdparty/libvorbis/codebook.c (renamed from drivers/vorbis/codebook.c)0
-rw-r--r--thirdparty/libvorbis/codebook.h (renamed from drivers/vorbis/codebook.h)0
-rw-r--r--thirdparty/libvorbis/codec_internal.h (renamed from drivers/vorbis/codec_internal.h)0
-rw-r--r--thirdparty/libvorbis/envelope.c (renamed from drivers/vorbis/envelope.c)0
-rw-r--r--thirdparty/libvorbis/envelope.h (renamed from drivers/vorbis/envelope.h)0
-rw-r--r--thirdparty/libvorbis/floor0.c (renamed from drivers/vorbis/floor0.c)0
-rw-r--r--thirdparty/libvorbis/floor1.c (renamed from drivers/vorbis/floor1.c)0
-rw-r--r--thirdparty/libvorbis/highlevel.h (renamed from drivers/vorbis/highlevel.h)0
-rw-r--r--thirdparty/libvorbis/info.c (renamed from drivers/vorbis/info.c)0
-rw-r--r--thirdparty/libvorbis/lookup.c (renamed from drivers/vorbis/lookup.c)0
-rw-r--r--thirdparty/libvorbis/lookup.h (renamed from drivers/vorbis/lookup.h)0
-rw-r--r--thirdparty/libvorbis/lookup_data.h (renamed from drivers/vorbis/lookup_data.h)0
-rw-r--r--thirdparty/libvorbis/lpc.c (renamed from drivers/vorbis/lpc.c)0
-rw-r--r--thirdparty/libvorbis/lpc.h (renamed from drivers/vorbis/lpc.h)0
-rw-r--r--thirdparty/libvorbis/lsp.c (renamed from drivers/vorbis/lsp.c)0
-rw-r--r--thirdparty/libvorbis/lsp.h (renamed from drivers/vorbis/lsp.h)0
-rw-r--r--thirdparty/libvorbis/mapping0.c (renamed from drivers/vorbis/mapping0.c)0
-rw-r--r--thirdparty/libvorbis/masking.h (renamed from drivers/vorbis/masking.h)0
-rw-r--r--thirdparty/libvorbis/mdct.c (renamed from drivers/vorbis/mdct.c)0
-rw-r--r--thirdparty/libvorbis/mdct.h (renamed from drivers/vorbis/mdct.h)0
-rw-r--r--thirdparty/libvorbis/misc.h (renamed from drivers/vorbis/misc.h)0
-rw-r--r--thirdparty/libvorbis/modes/floor_all.h (renamed from drivers/vorbis/modes/floor_all.h)0
-rw-r--r--thirdparty/libvorbis/modes/psych_11.h (renamed from drivers/vorbis/modes/psych_11.h)0
-rw-r--r--thirdparty/libvorbis/modes/psych_16.h (renamed from drivers/vorbis/modes/psych_16.h)0
-rw-r--r--thirdparty/libvorbis/modes/psych_44.h (renamed from drivers/vorbis/modes/psych_44.h)0
-rw-r--r--thirdparty/libvorbis/modes/psych_8.h (renamed from drivers/vorbis/modes/psych_8.h)0
-rw-r--r--thirdparty/libvorbis/modes/residue_16.h (renamed from drivers/vorbis/modes/residue_16.h)0
-rw-r--r--thirdparty/libvorbis/modes/residue_44.h (renamed from drivers/vorbis/modes/residue_44.h)0
-rw-r--r--thirdparty/libvorbis/modes/residue_44p51.h (renamed from drivers/vorbis/modes/residue_44p51.h)0
-rw-r--r--thirdparty/libvorbis/modes/residue_44u.h (renamed from drivers/vorbis/modes/residue_44u.h)0
-rw-r--r--thirdparty/libvorbis/modes/residue_8.h (renamed from drivers/vorbis/modes/residue_8.h)0
-rw-r--r--thirdparty/libvorbis/modes/setup_11.h (renamed from drivers/vorbis/modes/setup_11.h)0
-rw-r--r--thirdparty/libvorbis/modes/setup_16.h (renamed from drivers/vorbis/modes/setup_16.h)0
-rw-r--r--thirdparty/libvorbis/modes/setup_22.h (renamed from drivers/vorbis/modes/setup_22.h)0
-rw-r--r--thirdparty/libvorbis/modes/setup_32.h (renamed from drivers/vorbis/modes/setup_32.h)0
-rw-r--r--thirdparty/libvorbis/modes/setup_44.h (renamed from drivers/vorbis/modes/setup_44.h)0
-rw-r--r--thirdparty/libvorbis/modes/setup_44p51.h (renamed from drivers/vorbis/modes/setup_44p51.h)0
-rw-r--r--thirdparty/libvorbis/modes/setup_44u.h (renamed from drivers/vorbis/modes/setup_44u.h)0
-rw-r--r--thirdparty/libvorbis/modes/setup_8.h (renamed from drivers/vorbis/modes/setup_8.h)0
-rw-r--r--thirdparty/libvorbis/modes/setup_X.h (renamed from drivers/vorbis/modes/setup_X.h)0
-rw-r--r--thirdparty/libvorbis/os.h (renamed from drivers/vorbis/os.h)0
-rw-r--r--thirdparty/libvorbis/psy.c (renamed from drivers/vorbis/psy.c)0
-rw-r--r--thirdparty/libvorbis/psy.h (renamed from drivers/vorbis/psy.h)0
-rw-r--r--thirdparty/libvorbis/psytune.c (renamed from drivers/vorbis/psytune.c)0
-rw-r--r--thirdparty/libvorbis/registry.c (renamed from drivers/vorbis/registry.c)0
-rw-r--r--thirdparty/libvorbis/registry.h (renamed from drivers/vorbis/registry.h)0
-rw-r--r--thirdparty/libvorbis/res0.c (renamed from drivers/vorbis/res0.c)0
-rw-r--r--thirdparty/libvorbis/scales.h (renamed from drivers/vorbis/scales.h)0
-rw-r--r--thirdparty/libvorbis/sharedbook.c (renamed from drivers/vorbis/sharedbook.c)0
-rw-r--r--thirdparty/libvorbis/smallft.c (renamed from drivers/vorbis/smallft.c)0
-rw-r--r--thirdparty/libvorbis/smallft.h (renamed from drivers/vorbis/smallft.h)0
-rw-r--r--thirdparty/libvorbis/synthesis.c (renamed from drivers/vorbis/synthesis.c)0
-rw-r--r--thirdparty/libvorbis/tone.c (renamed from drivers/vorbis/tone.c)0
-rw-r--r--thirdparty/libvorbis/vorbis/codec.h (renamed from drivers/vorbis/codec.h)0
-rw-r--r--thirdparty/libvorbis/vorbis/vorbisenc.h (renamed from drivers/vorbis/vorbisenc.h)0
-rw-r--r--thirdparty/libvorbis/vorbis/vorbisfile.h (renamed from drivers/vorbis/vorbisfile.h)0
-rw-r--r--thirdparty/libvorbis/vorbisenc.c (renamed from drivers/vorbis/vorbisenc.c)0
-rw-r--r--thirdparty/libvorbis/vorbisfile.c (renamed from drivers/vorbis/vorbisfile.c)0
-rw-r--r--thirdparty/libvorbis/window.c (renamed from drivers/vorbis/window.c)0
-rw-r--r--thirdparty/libvorbis/window.h (renamed from drivers/vorbis/window.h)0
-rw-r--r--thirdparty/opus/COPYING (renamed from drivers/opus/COPYING)0
-rw-r--r--thirdparty/opus/analysis.c (renamed from drivers/opus/analysis.c)29
-rw-r--r--thirdparty/opus/analysis.h (renamed from drivers/opus/analysis.h)4
-rw-r--r--thirdparty/opus/celt/_kiss_fft_guts.h (renamed from drivers/opus/celt/_kiss_fft_guts.h)14
-rw-r--r--thirdparty/opus/celt/arch.h (renamed from drivers/opus/celt/arch.h)16
-rwxr-xr-xthirdparty/opus/celt/arm/arm2gnu.pl (renamed from drivers/opus/celt/arm/arm2gnu.pl)0
-rw-r--r--thirdparty/opus/celt/arm/arm_celt_map.c (renamed from drivers/opus/celt/arm/arm_celt_map.c)11
-rw-r--r--thirdparty/opus/celt/arm/armcpu.c (renamed from drivers/opus/celt/arm/armcpu.c)13
-rw-r--r--thirdparty/opus/celt/arm/armcpu.h (renamed from drivers/opus/celt/arm/armcpu.h)0
-rw-r--r--thirdparty/opus/celt/arm/armopts.s.in (renamed from drivers/opus/celt/arm/armopts.s.in)0
-rw-r--r--thirdparty/opus/celt/arm/celt_ne10_fft.c (renamed from drivers/opus/celt/arm/celt_ne10_fft.c)10
-rw-r--r--thirdparty/opus/celt/arm/celt_ne10_mdct.c (renamed from drivers/opus/celt/arm/celt_ne10_mdct.c)12
-rw-r--r--thirdparty/opus/celt/arm/celt_neon_intr.c (renamed from drivers/opus/celt/arm/celt_neon_intr.c)7
-rw-r--r--thirdparty/opus/celt/arm/celt_pitch_xcorr_arm-gnu.S (renamed from drivers/opus/celt/arm/celt_pitch_xcorr_arm-gnu.S)0
-rw-r--r--thirdparty/opus/celt/arm/celt_pitch_xcorr_arm.s (renamed from drivers/opus/celt/arm/celt_pitch_xcorr_arm.s)0
-rw-r--r--thirdparty/opus/celt/arm/fft_arm.h (renamed from drivers/opus/celt/arm/fft_arm.h)4
-rw-r--r--thirdparty/opus/celt/arm/fixed_arm64.h35
-rw-r--r--thirdparty/opus/celt/arm/fixed_armv4.h (renamed from drivers/opus/celt/arm/fixed_armv4.h)0
-rw-r--r--thirdparty/opus/celt/arm/fixed_armv5e.h (renamed from drivers/opus/celt/arm/fixed_armv5e.h)2
-rw-r--r--thirdparty/opus/celt/arm/kiss_fft_armv4.h (renamed from drivers/opus/celt/arm/kiss_fft_armv4.h)2
-rw-r--r--thirdparty/opus/celt/arm/kiss_fft_armv5e.h (renamed from drivers/opus/celt/arm/kiss_fft_armv5e.h)2
-rw-r--r--thirdparty/opus/celt/arm/mdct_arm.h (renamed from drivers/opus/celt/arm/mdct_arm.h)4
-rw-r--r--thirdparty/opus/celt/arm/pitch_arm.h (renamed from drivers/opus/celt/arm/pitch_arm.h)2
-rw-r--r--thirdparty/opus/celt/bands.c (renamed from drivers/opus/celt/bands.c)49
-rw-r--r--thirdparty/opus/celt/bands.h (renamed from drivers/opus/celt/bands.h)10
-rw-r--r--thirdparty/opus/celt/celt.c (renamed from drivers/opus/celt/celt.c)37
-rw-r--r--thirdparty/opus/celt/celt.h (renamed from drivers/opus/celt/celt.h)12
-rw-r--r--thirdparty/opus/celt/celt_decoder.c (renamed from drivers/opus/celt/celt_decoder.c)51
-rw-r--r--thirdparty/opus/celt/celt_encoder.c (renamed from drivers/opus/celt/celt_encoder.c)63
-rw-r--r--thirdparty/opus/celt/celt_lpc.c (renamed from drivers/opus/celt/celt_lpc.c)23
-rw-r--r--thirdparty/opus/celt/celt_lpc.h (renamed from drivers/opus/celt/celt_lpc.h)6
-rw-r--r--thirdparty/opus/celt/cpu_support.h (renamed from drivers/opus/celt/cpu_support.h)8
-rw-r--r--thirdparty/opus/celt/cwrs.c (renamed from drivers/opus/celt/cwrs.c)13
-rw-r--r--thirdparty/opus/celt/cwrs.h (renamed from drivers/opus/celt/cwrs.h)8
-rw-r--r--thirdparty/opus/celt/ecintrin.h (renamed from drivers/opus/celt/ecintrin.h)4
-rw-r--r--thirdparty/opus/celt/entcode.c (renamed from drivers/opus/celt/entcode.c)9
-rw-r--r--thirdparty/opus/celt/entcode.h (renamed from drivers/opus/celt/entcode.h)6
-rw-r--r--thirdparty/opus/celt/entdec.c (renamed from drivers/opus/celt/entdec.c)13
-rw-r--r--thirdparty/opus/celt/entdec.h (renamed from drivers/opus/celt/entdec.h)2
-rw-r--r--thirdparty/opus/celt/entenc.c (renamed from drivers/opus/celt/entenc.c)13
-rw-r--r--thirdparty/opus/celt/entenc.h (renamed from drivers/opus/celt/entenc.h)2
-rw-r--r--thirdparty/opus/celt/fixed_debug.h (renamed from drivers/opus/celt/fixed_debug.h)2
-rw-r--r--thirdparty/opus/celt/fixed_generic.h (renamed from drivers/opus/celt/fixed_generic.h)2
-rw-r--r--thirdparty/opus/celt/float_cast.h (renamed from drivers/opus/celt/float_cast.h)2
-rw-r--r--thirdparty/opus/celt/kiss_fft.c (renamed from drivers/opus/celt/kiss_fft.c)24
-rw-r--r--thirdparty/opus/celt/kiss_fft.h (renamed from drivers/opus/celt/kiss_fft.h)12
-rw-r--r--thirdparty/opus/celt/laplace.c (renamed from drivers/opus/celt/laplace.c)9
-rw-r--r--thirdparty/opus/celt/laplace.h (renamed from drivers/opus/celt/laplace.h)4
-rw-r--r--thirdparty/opus/celt/mathops.c (renamed from drivers/opus/celt/mathops.c)9
-rw-r--r--thirdparty/opus/celt/mathops.h (renamed from drivers/opus/celt/mathops.h)14
-rw-r--r--thirdparty/opus/celt/mdct.c (renamed from drivers/opus/celt/mdct.c)20
-rw-r--r--thirdparty/opus/celt/mdct.h (renamed from drivers/opus/celt/mdct.h)8
-rw-r--r--thirdparty/opus/celt/mfrngcod.h (renamed from drivers/opus/celt/mfrngcod.h)2
-rw-r--r--thirdparty/opus/celt/mips/celt_mipsr1.h (renamed from drivers/opus/celt/mips/celt_mipsr1.h)33
-rw-r--r--thirdparty/opus/celt/mips/fixed_generic_mipsr1.h (renamed from drivers/opus/celt/mips/fixed_generic_mipsr1.h)0
-rw-r--r--thirdparty/opus/celt/mips/kiss_fft_mipsr1.h (renamed from drivers/opus/celt/mips/kiss_fft_mipsr1.h)4
-rw-r--r--thirdparty/opus/celt/mips/mdct_mipsr1.h (renamed from drivers/opus/celt/mips/mdct_mipsr1.h)18
-rw-r--r--thirdparty/opus/celt/mips/pitch_mipsr1.h (renamed from drivers/opus/celt/mips/pitch_mipsr1.h)0
-rw-r--r--thirdparty/opus/celt/mips/vq_mipsr1.h (renamed from drivers/opus/celt/mips/vq_mipsr1.h)13
-rw-r--r--thirdparty/opus/celt/modes.c (renamed from drivers/opus/celt/modes.c)27
-rw-r--r--thirdparty/opus/celt/modes.h (renamed from drivers/opus/celt/modes.h)12
-rw-r--r--thirdparty/opus/celt/opus_custom_demo.c (renamed from drivers/opus/celt/opus_custom_demo.c)9
-rw-r--r--thirdparty/opus/celt/os_support.h (renamed from drivers/opus/celt/os_support.h)4
-rw-r--r--thirdparty/opus/celt/pitch.c (renamed from drivers/opus/celt/pitch.c)65
-rw-r--r--thirdparty/opus/celt/pitch.h (renamed from drivers/opus/celt/pitch.h)14
-rw-r--r--thirdparty/opus/celt/quant_bands.c (renamed from drivers/opus/celt/quant_bands.c)41
-rw-r--r--thirdparty/opus/celt/quant_bands.h (renamed from drivers/opus/celt/quant_bands.h)12
-rw-r--r--thirdparty/opus/celt/rate.c (renamed from drivers/opus/celt/rate.c)17
-rw-r--r--thirdparty/opus/celt/rate.h (renamed from drivers/opus/celt/rate.h)4
-rw-r--r--thirdparty/opus/celt/stack_alloc.h (renamed from drivers/opus/celt/stack_alloc.h)6
-rw-r--r--thirdparty/opus/celt/static_modes_fixed.h (renamed from drivers/opus/celt/static_modes_fixed.h)6
-rw-r--r--thirdparty/opus/celt/static_modes_fixed_arm_ne10.h (renamed from drivers/opus/celt/static_modes_fixed_arm_ne10.h)0
-rw-r--r--thirdparty/opus/celt/static_modes_float.h (renamed from drivers/opus/celt/static_modes_float.h)6
-rw-r--r--thirdparty/opus/celt/static_modes_float_arm_ne10.h (renamed from drivers/opus/celt/static_modes_float_arm_ne10.h)0
-rw-r--r--thirdparty/opus/celt/tests/test_unit_cwrs32.c161
-rw-r--r--thirdparty/opus/celt/tests/test_unit_dft.c189
-rw-r--r--thirdparty/opus/celt/tests/test_unit_entropy.c382
-rw-r--r--thirdparty/opus/celt/tests/test_unit_laplace.c93
-rw-r--r--thirdparty/opus/celt/tests/test_unit_mathops.c304
-rw-r--r--thirdparty/opus/celt/tests/test_unit_mdct.c230
-rw-r--r--thirdparty/opus/celt/tests/test_unit_rotation.c120
-rw-r--r--thirdparty/opus/celt/tests/test_unit_types.c50
-rw-r--r--thirdparty/opus/celt/vq.c (renamed from drivers/opus/celt/vq.c)41
-rw-r--r--thirdparty/opus/celt/vq.h (renamed from drivers/opus/celt/vq.h)8
-rw-r--r--thirdparty/opus/celt/x86/celt_lpc_sse.c (renamed from drivers/opus/celt/x86/celt_lpc_sse.c)15
-rw-r--r--thirdparty/opus/celt/x86/celt_lpc_sse.h (renamed from drivers/opus/celt/x86/celt_lpc_sse.h)5
-rw-r--r--thirdparty/opus/celt/x86/pitch_sse.c (renamed from drivers/opus/celt/x86/pitch_sse.c)17
-rw-r--r--thirdparty/opus/celt/x86/pitch_sse.h (renamed from drivers/opus/celt/x86/pitch_sse.h)5
-rw-r--r--thirdparty/opus/celt/x86/pitch_sse2.c (renamed from drivers/opus/celt/x86/pitch_sse2.c)15
-rw-r--r--thirdparty/opus/celt/x86/pitch_sse4_1.c (renamed from drivers/opus/celt/x86/pitch_sse4_1.c)17
-rw-r--r--thirdparty/opus/celt/x86/x86_celt_map.c (renamed from drivers/opus/celt/x86/x86_celt_map.c)13
-rw-r--r--thirdparty/opus/celt/x86/x86cpu.c (renamed from drivers/opus/celt/x86/x86cpu.c)15
-rw-r--r--thirdparty/opus/celt/x86/x86cpu.h (renamed from drivers/opus/celt/x86/x86cpu.h)0
-rw-r--r--thirdparty/opus/config.h (renamed from drivers/opus/opus_config.h)0
-rw-r--r--thirdparty/opus/http.c (renamed from drivers/opus/http.c)8
-rw-r--r--thirdparty/opus/info.c (renamed from drivers/opus/info.c)6
-rw-r--r--thirdparty/opus/internal.c (renamed from drivers/opus/internal.c)6
-rw-r--r--thirdparty/opus/internal.h (renamed from drivers/opus/internal.h)2
-rw-r--r--thirdparty/opus/mlp.c (renamed from drivers/opus/mlp.c)17
-rw-r--r--thirdparty/opus/mlp.h (renamed from drivers/opus/mlp.h)2
-rw-r--r--thirdparty/opus/mlp_data.c (renamed from drivers/opus/mlp_data.c)7
-rw-r--r--thirdparty/opus/opus.c (renamed from drivers/opus/opus.c)9
-rw-r--r--thirdparty/opus/opus.h (renamed from drivers/opus/opus.h)4
-rw-r--r--thirdparty/opus/opus_compare.c (renamed from drivers/opus/opus_compare.c)0
-rw-r--r--thirdparty/opus/opus_custom.h (renamed from drivers/opus/opus_custom.h)2
-rw-r--r--thirdparty/opus/opus_decoder.c (renamed from drivers/opus/opus_decoder.c)43
-rw-r--r--thirdparty/opus/opus_defines.h (renamed from drivers/opus/opus_defines.h)2
-rw-r--r--thirdparty/opus/opus_encoder.c (renamed from drivers/opus/opus_encoder.c)67
-rw-r--r--thirdparty/opus/opus_multistream.c (renamed from drivers/opus/opus_multistream.c)17
-rw-r--r--thirdparty/opus/opus_multistream.h (renamed from drivers/opus/opus_multistream.h)2
-rw-r--r--thirdparty/opus/opus_multistream_decoder.c (renamed from drivers/opus/opus_multistream_decoder.c)19
-rw-r--r--thirdparty/opus/opus_multistream_encoder.c (renamed from drivers/opus/opus_multistream_encoder.c)37
-rw-r--r--thirdparty/opus/opus_private.h (renamed from drivers/opus/opus_private.h)6
-rw-r--r--thirdparty/opus/opus_types.h (renamed from drivers/opus/opus_types.h)0
-rw-r--r--thirdparty/opus/opusfile.c (renamed from drivers/opus/opusfile.c)8
-rw-r--r--thirdparty/opus/opusfile.h (renamed from drivers/opus/opusfile.h)2
-rw-r--r--thirdparty/opus/repacketizer.c (renamed from drivers/opus/repacketizer.c)11
-rw-r--r--thirdparty/opus/repacketizer_demo.c (renamed from drivers/opus/repacketizer_demo.c)7
-rw-r--r--thirdparty/opus/silk/A2NLSF.c (renamed from drivers/opus/silk/A2NLSF.c)9
-rw-r--r--thirdparty/opus/silk/API.h (renamed from drivers/opus/silk/API.h)10
-rw-r--r--thirdparty/opus/silk/CNG.c (renamed from drivers/opus/silk/CNG.c)9
-rw-r--r--thirdparty/opus/silk/HP_variable_cutoff.c (renamed from drivers/opus/silk/HP_variable_cutoff.c)13
-rw-r--r--thirdparty/opus/silk/Inlines.h (renamed from drivers/opus/silk/Inlines.h)0
-rw-r--r--thirdparty/opus/silk/LPC_analysis_filter.c (renamed from drivers/opus/silk/LPC_analysis_filter.c)13
-rw-r--r--thirdparty/opus/silk/LPC_inv_pred_gain.c (renamed from drivers/opus/silk/LPC_inv_pred_gain.c)9
-rw-r--r--thirdparty/opus/silk/LP_variable_cutoff.c (renamed from drivers/opus/silk/LP_variable_cutoff.c)7
-rw-r--r--thirdparty/opus/silk/MacroCount.h (renamed from drivers/opus/silk/MacroCount.h)0
-rw-r--r--thirdparty/opus/silk/MacroDebug.h (renamed from drivers/opus/silk/MacroDebug.h)0
-rw-r--r--thirdparty/opus/silk/NLSF2A.c (renamed from drivers/opus/silk/NLSF2A.c)9
-rw-r--r--thirdparty/opus/silk/NLSF_VQ.c (renamed from drivers/opus/silk/NLSF_VQ.c)7
-rw-r--r--thirdparty/opus/silk/NLSF_VQ_weights_laroia.c (renamed from drivers/opus/silk/NLSF_VQ_weights_laroia.c)9
-rw-r--r--thirdparty/opus/silk/NLSF_decode.c (renamed from drivers/opus/silk/NLSF_decode.c)7
-rw-r--r--thirdparty/opus/silk/NLSF_del_dec_quant.c (renamed from drivers/opus/silk/NLSF_del_dec_quant.c)7
-rw-r--r--thirdparty/opus/silk/NLSF_encode.c (renamed from drivers/opus/silk/NLSF_encode.c)9
-rw-r--r--thirdparty/opus/silk/NLSF_stabilize.c (renamed from drivers/opus/silk/NLSF_stabilize.c)7
-rw-r--r--thirdparty/opus/silk/NLSF_unpack.c (renamed from drivers/opus/silk/NLSF_unpack.c)7
-rw-r--r--thirdparty/opus/silk/NSQ.c (renamed from drivers/opus/silk/NSQ.c)9
-rw-r--r--thirdparty/opus/silk/NSQ.h101
-rw-r--r--thirdparty/opus/silk/NSQ_del_dec.c (renamed from drivers/opus/silk/NSQ_del_dec.c)11
-rw-r--r--thirdparty/opus/silk/PLC.c (renamed from drivers/opus/silk/PLC.c)11
-rw-r--r--thirdparty/opus/silk/PLC.h (renamed from drivers/opus/silk/PLC.h)2
-rw-r--r--thirdparty/opus/silk/SigProc_FIX.h (renamed from drivers/opus/silk/SigProc_FIX.h)22
-rw-r--r--thirdparty/opus/silk/VAD.c (renamed from drivers/opus/silk/VAD.c)9
-rw-r--r--thirdparty/opus/silk/VQ_WMat_EC.c (renamed from drivers/opus/silk/VQ_WMat_EC.c)7
-rw-r--r--thirdparty/opus/silk/ana_filt_bank_1.c (renamed from drivers/opus/silk/ana_filt_bank_1.c)7
-rw-r--r--thirdparty/opus/silk/arm/NSQ_neon.c112
-rw-r--r--thirdparty/opus/silk/arm/NSQ_neon.h113
-rw-r--r--thirdparty/opus/silk/arm/SigProc_FIX_armv4.h (renamed from drivers/opus/silk/arm/SigProc_FIX_armv4.h)0
-rw-r--r--thirdparty/opus/silk/arm/SigProc_FIX_armv5e.h (renamed from drivers/opus/silk/arm/SigProc_FIX_armv5e.h)0
-rw-r--r--thirdparty/opus/silk/arm/arm_silk_map.c55
-rw-r--r--thirdparty/opus/silk/arm/macros_arm64.h39
-rw-r--r--thirdparty/opus/silk/arm/macros_armv4.h (renamed from drivers/opus/silk/arm/macros_armv4.h)0
-rw-r--r--thirdparty/opus/silk/arm/macros_armv5e.h (renamed from drivers/opus/silk/arm/macros_armv5e.h)0
-rw-r--r--thirdparty/opus/silk/biquad_alt.c (renamed from drivers/opus/silk/biquad_alt.c)7
-rw-r--r--thirdparty/opus/silk/bwexpander.c (renamed from drivers/opus/silk/bwexpander.c)7
-rw-r--r--thirdparty/opus/silk/bwexpander_32.c (renamed from drivers/opus/silk/bwexpander_32.c)7
-rw-r--r--thirdparty/opus/silk/check_control_input.c (renamed from drivers/opus/silk/check_control_input.c)11
-rw-r--r--thirdparty/opus/silk/code_signs.c (renamed from drivers/opus/silk/code_signs.c)7
-rw-r--r--thirdparty/opus/silk/control.h (renamed from drivers/opus/silk/control.h)2
-rw-r--r--thirdparty/opus/silk/control_SNR.c (renamed from drivers/opus/silk/control_SNR.c)9
-rw-r--r--thirdparty/opus/silk/control_audio_bandwidth.c (renamed from drivers/opus/silk/control_audio_bandwidth.c)9
-rw-r--r--thirdparty/opus/silk/control_codec.c (renamed from drivers/opus/silk/control_codec.c)23
-rw-r--r--thirdparty/opus/silk/debug.c (renamed from drivers/opus/silk/debug.c)9
-rw-r--r--thirdparty/opus/silk/debug.h (renamed from drivers/opus/silk/debug.h)2
-rw-r--r--thirdparty/opus/silk/dec_API.c (renamed from drivers/opus/silk/dec_API.c)13
-rw-r--r--thirdparty/opus/silk/decode_core.c (renamed from drivers/opus/silk/decode_core.c)9
-rw-r--r--thirdparty/opus/silk/decode_frame.c (renamed from drivers/opus/silk/decode_frame.c)11
-rw-r--r--thirdparty/opus/silk/decode_indices.c (renamed from drivers/opus/silk/decode_indices.c)7
-rw-r--r--thirdparty/opus/silk/decode_parameters.c (renamed from drivers/opus/silk/decode_parameters.c)7
-rw-r--r--thirdparty/opus/silk/decode_pitch.c (renamed from drivers/opus/silk/decode_pitch.c)9
-rw-r--r--thirdparty/opus/silk/decode_pulses.c (renamed from drivers/opus/silk/decode_pulses.c)7
-rw-r--r--thirdparty/opus/silk/decoder_set_fs.c (renamed from drivers/opus/silk/decoder_set_fs.c)7
-rw-r--r--thirdparty/opus/silk/define.h (renamed from drivers/opus/silk/define.h)4
-rw-r--r--thirdparty/opus/silk/enc_API.c (renamed from drivers/opus/silk/enc_API.c)25
-rw-r--r--thirdparty/opus/silk/encode_indices.c (renamed from drivers/opus/silk/encode_indices.c)7
-rw-r--r--thirdparty/opus/silk/encode_pulses.c (renamed from drivers/opus/silk/encode_pulses.c)9
-rw-r--r--thirdparty/opus/silk/errors.h (renamed from drivers/opus/silk/errors.h)0
-rw-r--r--thirdparty/opus/silk/fixed/LTP_analysis_filter_FIX.c (renamed from drivers/opus/silk/fixed/LTP_analysis_filter_FIX.c)7
-rw-r--r--thirdparty/opus/silk/fixed/LTP_scale_ctrl_FIX.c (renamed from drivers/opus/silk/fixed/LTP_scale_ctrl_FIX.c)7
-rw-r--r--thirdparty/opus/silk/fixed/apply_sine_window_FIX.c (renamed from drivers/opus/silk/fixed/apply_sine_window_FIX.c)7
-rw-r--r--thirdparty/opus/silk/fixed/autocorr_FIX.c (renamed from drivers/opus/silk/fixed/autocorr_FIX.c)9
-rw-r--r--thirdparty/opus/silk/fixed/burg_modified_FIX.c (renamed from drivers/opus/silk/fixed/burg_modified_FIX.c)13
-rw-r--r--thirdparty/opus/silk/fixed/corrMatrix_FIX.c (renamed from drivers/opus/silk/fixed/corrMatrix_FIX.c)7
-rw-r--r--thirdparty/opus/silk/fixed/encode_frame_FIX.c (renamed from drivers/opus/silk/fixed/encode_frame_FIX.c)11
-rw-r--r--thirdparty/opus/silk/fixed/find_LPC_FIX.c (renamed from drivers/opus/silk/fixed/find_LPC_FIX.c)11
-rw-r--r--thirdparty/opus/silk/fixed/find_LTP_FIX.c (renamed from drivers/opus/silk/fixed/find_LTP_FIX.c)9
-rw-r--r--thirdparty/opus/silk/fixed/find_pitch_lags_FIX.c (renamed from drivers/opus/silk/fixed/find_pitch_lags_FIX.c)11
-rw-r--r--thirdparty/opus/silk/fixed/find_pred_coefs_FIX.c (renamed from drivers/opus/silk/fixed/find_pred_coefs_FIX.c)9
-rw-r--r--thirdparty/opus/silk/fixed/k2a_FIX.c (renamed from drivers/opus/silk/fixed/k2a_FIX.c)7
-rw-r--r--thirdparty/opus/silk/fixed/k2a_Q16_FIX.c (renamed from drivers/opus/silk/fixed/k2a_Q16_FIX.c)7
-rw-r--r--thirdparty/opus/silk/fixed/main_FIX.h (renamed from drivers/opus/silk/fixed/main_FIX.h)14
-rw-r--r--thirdparty/opus/silk/fixed/mips/noise_shape_analysis_FIX_mipsr1.h (renamed from drivers/opus/silk/fixed/mips/noise_shape_analysis_FIX_mipsr1.h)0
-rw-r--r--thirdparty/opus/silk/fixed/mips/prefilter_FIX_mipsr1.h (renamed from drivers/opus/silk/fixed/mips/prefilter_FIX_mipsr1.h)11
-rw-r--r--thirdparty/opus/silk/fixed/mips/warped_autocorrelation_FIX_mipsr1.h (renamed from drivers/opus/silk/fixed/mips/warped_autocorrelation_FIX_mipsr1.h)7
-rw-r--r--thirdparty/opus/silk/fixed/noise_shape_analysis_FIX.c (renamed from drivers/opus/silk/fixed/noise_shape_analysis_FIX.c)13
-rw-r--r--thirdparty/opus/silk/fixed/pitch_analysis_core_FIX.c (renamed from drivers/opus/silk/fixed/pitch_analysis_core_FIX.c)15
-rw-r--r--thirdparty/opus/silk/fixed/prefilter_FIX.c (renamed from drivers/opus/silk/fixed/prefilter_FIX.c)13
-rw-r--r--thirdparty/opus/silk/fixed/process_gains_FIX.c (renamed from drivers/opus/silk/fixed/process_gains_FIX.c)9
-rw-r--r--thirdparty/opus/silk/fixed/regularize_correlations_FIX.c (renamed from drivers/opus/silk/fixed/regularize_correlations_FIX.c)7
-rw-r--r--thirdparty/opus/silk/fixed/residual_energy16_FIX.c (renamed from drivers/opus/silk/fixed/residual_energy16_FIX.c)7
-rw-r--r--thirdparty/opus/silk/fixed/residual_energy_FIX.c (renamed from drivers/opus/silk/fixed/residual_energy_FIX.c)9
-rw-r--r--thirdparty/opus/silk/fixed/schur64_FIX.c (renamed from drivers/opus/silk/fixed/schur64_FIX.c)7
-rw-r--r--thirdparty/opus/silk/fixed/schur_FIX.c (renamed from drivers/opus/silk/fixed/schur_FIX.c)7
-rw-r--r--thirdparty/opus/silk/fixed/solve_LS_FIX.c (renamed from drivers/opus/silk/fixed/solve_LS_FIX.c)11
-rw-r--r--thirdparty/opus/silk/fixed/structs_FIX.h (renamed from drivers/opus/silk/fixed/structs_FIX.h)6
-rw-r--r--thirdparty/opus/silk/fixed/vector_ops_FIX.c (renamed from drivers/opus/silk/fixed/vector_ops_FIX.c)11
-rw-r--r--thirdparty/opus/silk/fixed/warped_autocorrelation_FIX.c (renamed from drivers/opus/silk/fixed/warped_autocorrelation_FIX.c)9
-rw-r--r--thirdparty/opus/silk/fixed/x86/burg_modified_FIX_sse.c (renamed from drivers/opus/silk/fixed/x86/burg_modified_FIX_sse.c)15
-rw-r--r--thirdparty/opus/silk/fixed/x86/prefilter_FIX_sse.c (renamed from drivers/opus/silk/fixed/x86/prefilter_FIX_sse.c)9
-rw-r--r--thirdparty/opus/silk/fixed/x86/vector_ops_FIX_sse.c (renamed from drivers/opus/silk/fixed/x86/vector_ops_FIX_sse.c)11
-rw-r--r--thirdparty/opus/silk/float/LPC_analysis_filter_FLP.c (renamed from drivers/opus/silk/float/LPC_analysis_filter_FLP.c)7
-rw-r--r--thirdparty/opus/silk/float/LPC_inv_pred_gain_FLP.c (renamed from drivers/opus/silk/float/LPC_inv_pred_gain_FLP.c)9
-rw-r--r--thirdparty/opus/silk/float/LTP_analysis_filter_FLP.c (renamed from drivers/opus/silk/float/LTP_analysis_filter_FLP.c)7
-rw-r--r--thirdparty/opus/silk/float/LTP_scale_ctrl_FLP.c (renamed from drivers/opus/silk/float/LTP_scale_ctrl_FLP.c)7
-rw-r--r--thirdparty/opus/silk/float/SigProc_FLP.h (renamed from drivers/opus/silk/float/SigProc_FLP.h)4
-rw-r--r--thirdparty/opus/silk/float/apply_sine_window_FLP.c (renamed from drivers/opus/silk/float/apply_sine_window_FLP.c)7
-rw-r--r--thirdparty/opus/silk/float/autocorrelation_FLP.c (renamed from drivers/opus/silk/float/autocorrelation_FLP.c)9
-rw-r--r--thirdparty/opus/silk/float/burg_modified_FLP.c (renamed from drivers/opus/silk/float/burg_modified_FLP.c)11
-rw-r--r--thirdparty/opus/silk/float/bwexpander_FLP.c (renamed from drivers/opus/silk/float/bwexpander_FLP.c)7
-rw-r--r--thirdparty/opus/silk/float/corrMatrix_FLP.c (renamed from drivers/opus/silk/float/corrMatrix_FLP.c)7
-rw-r--r--thirdparty/opus/silk/float/encode_frame_FLP.c (renamed from drivers/opus/silk/float/encode_frame_FLP.c)9
-rw-r--r--thirdparty/opus/silk/float/energy_FLP.c (renamed from drivers/opus/silk/float/energy_FLP.c)7
-rw-r--r--thirdparty/opus/silk/float/find_LPC_FLP.c (renamed from drivers/opus/silk/float/find_LPC_FLP.c)11
-rw-r--r--thirdparty/opus/silk/float/find_LTP_FLP.c (renamed from drivers/opus/silk/float/find_LTP_FLP.c)9
-rw-r--r--thirdparty/opus/silk/float/find_pitch_lags_FLP.c (renamed from drivers/opus/silk/float/find_pitch_lags_FLP.c)9
-rw-r--r--thirdparty/opus/silk/float/find_pred_coefs_FLP.c (renamed from drivers/opus/silk/float/find_pred_coefs_FLP.c)7
-rw-r--r--thirdparty/opus/silk/float/inner_product_FLP.c (renamed from drivers/opus/silk/float/inner_product_FLP.c)7
-rw-r--r--thirdparty/opus/silk/float/k2a_FLP.c (renamed from drivers/opus/silk/float/k2a_FLP.c)7
-rw-r--r--thirdparty/opus/silk/float/levinsondurbin_FLP.c (renamed from drivers/opus/silk/float/levinsondurbin_FLP.c)7
-rw-r--r--thirdparty/opus/silk/float/main_FLP.h (renamed from drivers/opus/silk/float/main_FLP.h)14
-rw-r--r--thirdparty/opus/silk/float/noise_shape_analysis_FLP.c (renamed from drivers/opus/silk/float/noise_shape_analysis_FLP.c)9
-rw-r--r--thirdparty/opus/silk/float/pitch_analysis_core_FLP.c (renamed from drivers/opus/silk/float/pitch_analysis_core_FLP.c)13
-rw-r--r--thirdparty/opus/silk/float/prefilter_FLP.c (renamed from drivers/opus/silk/float/prefilter_FLP.c)9
-rw-r--r--thirdparty/opus/silk/float/process_gains_FLP.c (renamed from drivers/opus/silk/float/process_gains_FLP.c)9
-rw-r--r--thirdparty/opus/silk/float/regularize_correlations_FLP.c (renamed from drivers/opus/silk/float/regularize_correlations_FLP.c)7
-rw-r--r--thirdparty/opus/silk/float/residual_energy_FLP.c (renamed from drivers/opus/silk/float/residual_energy_FLP.c)7
-rw-r--r--thirdparty/opus/silk/float/scale_copy_vector_FLP.c (renamed from drivers/opus/silk/float/scale_copy_vector_FLP.c)7
-rw-r--r--thirdparty/opus/silk/float/scale_vector_FLP.c (renamed from drivers/opus/silk/float/scale_vector_FLP.c)7
-rw-r--r--thirdparty/opus/silk/float/schur_FLP.c (renamed from drivers/opus/silk/float/schur_FLP.c)7
-rw-r--r--thirdparty/opus/silk/float/solve_LS_FLP.c (renamed from drivers/opus/silk/float/solve_LS_FLP.c)9
-rw-r--r--thirdparty/opus/silk/float/sort_FLP.c (renamed from drivers/opus/silk/float/sort_FLP.c)9
-rw-r--r--thirdparty/opus/silk/float/structs_FLP.h (renamed from drivers/opus/silk/float/structs_FLP.h)6
-rw-r--r--thirdparty/opus/silk/float/warped_autocorrelation_FLP.c (renamed from drivers/opus/silk/float/warped_autocorrelation_FLP.c)7
-rw-r--r--thirdparty/opus/silk/float/wrappers_FLP.c (renamed from drivers/opus/silk/float/wrappers_FLP.c)7
-rw-r--r--thirdparty/opus/silk/gain_quant.c (renamed from drivers/opus/silk/gain_quant.c)7
-rw-r--r--thirdparty/opus/silk/init_decoder.c (renamed from drivers/opus/silk/init_decoder.c)7
-rw-r--r--thirdparty/opus/silk/init_encoder.c (renamed from drivers/opus/silk/init_encoder.c)15
-rw-r--r--thirdparty/opus/silk/inner_prod_aligned.c (renamed from drivers/opus/silk/inner_prod_aligned.c)7
-rw-r--r--thirdparty/opus/silk/interpolate.c (renamed from drivers/opus/silk/interpolate.c)7
-rw-r--r--thirdparty/opus/silk/lin2log.c (renamed from drivers/opus/silk/lin2log.c)7
-rw-r--r--thirdparty/opus/silk/log2lin.c (renamed from drivers/opus/silk/log2lin.c)7
-rw-r--r--thirdparty/opus/silk/macros.h (renamed from drivers/opus/silk/macros.h)17
-rw-r--r--thirdparty/opus/silk/main.h (renamed from drivers/opus/silk/main.h)20
-rw-r--r--thirdparty/opus/silk/mips/NSQ_del_dec_mipsr1.h (renamed from drivers/opus/silk/mips/NSQ_del_dec_mipsr1.h)9
-rw-r--r--thirdparty/opus/silk/mips/macros_mipsr1.h (renamed from drivers/opus/silk/mips/macros_mipsr1.h)0
-rw-r--r--thirdparty/opus/silk/mips/sigproc_fix_mipsr1.h (renamed from drivers/opus/silk/mips/sigproc_fix_mipsr1.h)0
-rw-r--r--thirdparty/opus/silk/pitch_est_defines.h (renamed from drivers/opus/silk/pitch_est_defines.h)2
-rw-r--r--thirdparty/opus/silk/pitch_est_tables.c (renamed from drivers/opus/silk/pitch_est_tables.c)9
-rw-r--r--thirdparty/opus/silk/process_NLSFs.c (renamed from drivers/opus/silk/process_NLSFs.c)7
-rw-r--r--thirdparty/opus/silk/quant_LTP_gains.c (renamed from drivers/opus/silk/quant_LTP_gains.c)9
-rw-r--r--thirdparty/opus/silk/resampler.c (renamed from drivers/opus/silk/resampler.c)7
-rw-r--r--thirdparty/opus/silk/resampler_down2.c (renamed from drivers/opus/silk/resampler_down2.c)9
-rw-r--r--thirdparty/opus/silk/resampler_down2_3.c (renamed from drivers/opus/silk/resampler_down2_3.c)11
-rw-r--r--thirdparty/opus/silk/resampler_private.h (renamed from drivers/opus/silk/resampler_private.h)6
-rw-r--r--thirdparty/opus/silk/resampler_private_AR2.c (renamed from drivers/opus/silk/resampler_private_AR2.c)9
-rw-r--r--thirdparty/opus/silk/resampler_private_IIR_FIR.c (renamed from drivers/opus/silk/resampler_private_IIR_FIR.c)11
-rw-r--r--thirdparty/opus/silk/resampler_private_down_FIR.c (renamed from drivers/opus/silk/resampler_private_down_FIR.c)11
-rw-r--r--thirdparty/opus/silk/resampler_private_up2_HQ.c (renamed from drivers/opus/silk/resampler_private_up2_HQ.c)9
-rw-r--r--thirdparty/opus/silk/resampler_rom.c (renamed from drivers/opus/silk/resampler_rom.c)7
-rw-r--r--thirdparty/opus/silk/resampler_rom.h (renamed from drivers/opus/silk/resampler_rom.h)4
-rw-r--r--thirdparty/opus/silk/resampler_structs.h (renamed from drivers/opus/silk/resampler_structs.h)0
-rw-r--r--thirdparty/opus/silk/shell_coder.c (renamed from drivers/opus/silk/shell_coder.c)7
-rw-r--r--thirdparty/opus/silk/sigm_Q15.c (renamed from drivers/opus/silk/sigm_Q15.c)7
-rw-r--r--thirdparty/opus/silk/sort.c (renamed from drivers/opus/silk/sort.c)9
-rw-r--r--thirdparty/opus/silk/stereo_LR_to_MS.c (renamed from drivers/opus/silk/stereo_LR_to_MS.c)9
-rw-r--r--thirdparty/opus/silk/stereo_MS_to_LR.c (renamed from drivers/opus/silk/stereo_MS_to_LR.c)7
-rw-r--r--thirdparty/opus/silk/stereo_decode_pred.c (renamed from drivers/opus/silk/stereo_decode_pred.c)7
-rw-r--r--thirdparty/opus/silk/stereo_encode_pred.c (renamed from drivers/opus/silk/stereo_encode_pred.c)7
-rw-r--r--thirdparty/opus/silk/stereo_find_predictor.c (renamed from drivers/opus/silk/stereo_find_predictor.c)7
-rw-r--r--thirdparty/opus/silk/stereo_quant_pred.c (renamed from drivers/opus/silk/stereo_quant_pred.c)7
-rw-r--r--thirdparty/opus/silk/structs.h (renamed from drivers/opus/silk/structs.h)10
-rw-r--r--thirdparty/opus/silk/sum_sqr_shift.c (renamed from drivers/opus/silk/sum_sqr_shift.c)7
-rw-r--r--thirdparty/opus/silk/table_LSF_cos.c (renamed from drivers/opus/silk/table_LSF_cos.c)7
-rw-r--r--thirdparty/opus/silk/tables.h (renamed from drivers/opus/silk/tables.h)4
-rw-r--r--thirdparty/opus/silk/tables_LTP.c (renamed from drivers/opus/silk/tables_LTP.c)7
-rw-r--r--thirdparty/opus/silk/tables_NLSF_CB_NB_MB.c (renamed from drivers/opus/silk/tables_NLSF_CB_NB_MB.c)7
-rw-r--r--thirdparty/opus/silk/tables_NLSF_CB_WB.c (renamed from drivers/opus/silk/tables_NLSF_CB_WB.c)7
-rw-r--r--thirdparty/opus/silk/tables_gain.c (renamed from drivers/opus/silk/tables_gain.c)7
-rw-r--r--thirdparty/opus/silk/tables_other.c (renamed from drivers/opus/silk/tables_other.c)11
-rw-r--r--thirdparty/opus/silk/tables_pitch_lag.c (renamed from drivers/opus/silk/tables_pitch_lag.c)7
-rw-r--r--thirdparty/opus/silk/tables_pulses_per_block.c (renamed from drivers/opus/silk/tables_pulses_per_block.c)7
-rw-r--r--thirdparty/opus/silk/tuning_parameters.h (renamed from drivers/opus/silk/tuning_parameters.h)0
-rw-r--r--thirdparty/opus/silk/typedef.h (renamed from drivers/opus/silk/typedef.h)6
-rw-r--r--thirdparty/opus/silk/x86/NSQ_del_dec_sse.c (renamed from drivers/opus/silk/x86/NSQ_del_dec_sse.c)11
-rw-r--r--thirdparty/opus/silk/x86/NSQ_sse.c (renamed from drivers/opus/silk/x86/NSQ_sse.c)11
-rw-r--r--thirdparty/opus/silk/x86/SigProc_FIX_sse.h (renamed from drivers/opus/silk/x86/SigProc_FIX_sse.h)5
-rw-r--r--thirdparty/opus/silk/x86/VAD_sse.c (renamed from drivers/opus/silk/x86/VAD_sse.c)9
-rw-r--r--thirdparty/opus/silk/x86/VQ_WMat_EC_sse.c (renamed from drivers/opus/silk/x86/VQ_WMat_EC_sse.c)9
-rw-r--r--thirdparty/opus/silk/x86/main_sse.h (renamed from drivers/opus/silk/x86/main_sse.h)5
-rw-r--r--thirdparty/opus/silk/x86/x86_silk_map.c (renamed from drivers/opus/silk/x86/x86_silk_map.c)17
-rw-r--r--thirdparty/opus/stream.c (renamed from drivers/opus/stream.c)6
-rw-r--r--thirdparty/opus/tansig_table.h (renamed from drivers/opus/tansig_table.h)0
-rw-r--r--thirdparty/opus/wincerts.c (renamed from drivers/opus/wincerts.c)7
-rw-r--r--thirdparty/opus/winerrno.h (renamed from drivers/opus/winerrno.h)0
408 files changed, 4223 insertions, 1400 deletions
diff --git a/SConstruct b/SConstruct
index a5b7d19df9..2c92078ae7 100644
--- a/SConstruct
+++ b/SConstruct
@@ -119,8 +119,9 @@ opts.Add('platform','Platform: '+str(platform_list)+'.',"")
opts.Add('p','Platform (same as platform=).',"")
opts.Add('tools','Build Tools (Including Editor): (yes/no)','yes')
opts.Add('gdscript','Build GDSCript support: (yes/no)','yes')
-opts.Add('vorbis','Build Ogg Vorbis Support: (yes/no)','yes')
-opts.Add('opus','Build Opus Audio Format Support: (yes/no)','yes')
+opts.Add('libogg','Ogg library for ogg container support (system/builtin)','builtin')
+opts.Add('libvorbis','Ogg Vorbis library for vorbis support (system/builtin)','builtin')
+opts.Add('opus','Opus and opusfile library for Opus format support: (system/builtin)','builtin')
opts.Add('minizip','Build Minizip Archive Support: (yes/no)','yes')
opts.Add('squish','Squish BC Texture Compression in editor (yes/no)','yes')
opts.Add('theora','Theora Video (yes/no)','yes')
@@ -335,11 +336,6 @@ if selected_platform in platform_list:
if (env_base['squish']=='yes'):
env.Append(CPPFLAGS=['-DSQUISH_ENABLED']);
- if (env['vorbis']=='yes'):
- env.Append(CPPFLAGS=['-DVORBIS_ENABLED']);
- if (env['opus']=='yes'):
- env.Append(CPPFLAGS=['-DOPUS_ENABLED']);
-
if (env['theora']=='yes'):
env['theoralib']='yes'
diff --git a/drivers/SCsub b/drivers/SCsub
index 5effc6b2d4..26da90bfd1 100644
--- a/drivers/SCsub
+++ b/drivers/SCsub
@@ -4,7 +4,6 @@ env_drivers = env.Clone()
env.drivers_sources=[]
#env.add_source_files(env.drivers_sources,"*.cpp")
-env_drivers.Append(CPPPATH=["vorbis"])
Export('env_drivers')
@@ -32,12 +31,6 @@ if (env["builtin_zlib"]=="yes"):
SConscript("rtaudio/SCsub");
SConscript("nrex/SCsub");
SConscript("chibi/SCsub");
-if (env["vorbis"]=="yes" or env["theoralib"]=="yes" or env["opus"]=="yes"):
- SConscript("ogg/SCsub");
-if (env["vorbis"]=="yes"):
- SConscript("vorbis/SCsub");
-if (env["opus"]=="yes"):
- SConscript('opus/SCsub');
if (env["tools"]=="yes"):
SConscript("convex_decomp/SCsub");
diff --git a/drivers/ogg/SCsub b/drivers/ogg/SCsub
deleted file mode 100644
index 3ee1bb6408..0000000000
--- a/drivers/ogg/SCsub
+++ /dev/null
@@ -1,9 +0,0 @@
-Import('env')
-
-ogg_sources = [
-
- "ogg/bitwise.c",
- "ogg/framing.c",
-]
-
-env.drivers_sources+=ogg_sources
diff --git a/drivers/opus/SCsub b/drivers/opus/SCsub
deleted file mode 100644
index bed8b496fc..0000000000
--- a/drivers/opus/SCsub
+++ /dev/null
@@ -1,196 +0,0 @@
-Import('env')
-
-opus_sources = [
- "opus/audio_stream_opus.cpp",
-]
-
-opus_sources_silk=[]
-
-opus_sources_lib = [
- "opus/silk/tables_other.c",
- "opus/silk/sum_sqr_shift.c",
- "opus/silk/PLC.c",
- "opus/silk/dec_API.c",
- "opus/silk/decode_pulses.c",
- "opus/silk/inner_prod_aligned.c",
- "opus/silk/init_encoder.c",
- "opus/silk/interpolate.c",
- "opus/silk/stereo_encode_pred.c",
- "opus/silk/decode_frame.c",
- "opus/silk/NLSF_del_dec_quant.c",
- "opus/silk/VAD.c",
- "opus/silk/resampler_private_AR2.c",
- "opus/silk/NLSF_unpack.c",
- "opus/silk/resampler_down2.c",
- "opus/silk/sort.c",
- "opus/silk/resampler_private_IIR_FIR.c",
- "opus/silk/resampler_down2_3.c",
- "opus/silk/resampler_private_up2_HQ.c",
- "opus/silk/tables_gain.c",
- "opus/silk/stereo_find_predictor.c",
- "opus/silk/stereo_quant_pred.c",
- "opus/silk/NLSF_stabilize.c",
- "opus/silk/ana_filt_bank_1.c",
- "opus/silk/check_control_input.c",
- "opus/silk/bwexpander.c",
- "opus/silk/A2NLSF.c",
- "opus/silk/LPC_inv_pred_gain.c",
- "opus/silk/log2lin.c",
- "opus/silk/process_NLSFs.c",
- "opus/silk/sigm_Q15.c",
- "opus/silk/VQ_WMat_EC.c",
- "opus/silk/quant_LTP_gains.c",
- "opus/silk/resampler_private_down_FIR.c",
- "opus/silk/NLSF_decode.c",
- "opus/silk/control_codec.c",
- "opus/silk/NLSF_VQ_weights_laroia.c",
- "opus/silk/decode_pitch.c",
- "opus/silk/stereo_decode_pred.c",
- "opus/silk/tables_pulses_per_block.c",
- "opus/silk/init_decoder.c",
- "opus/silk/table_LSF_cos.c",
- "opus/silk/decode_core.c",
- "opus/silk/code_signs.c",
- "opus/silk/enc_API.c",
- "opus/silk/tables_LTP.c",
- "opus/silk/pitch_est_tables.c",
- "opus/silk/biquad_alt.c",
- "opus/silk/encode_indices.c",
- "opus/silk/tables_NLSF_CB_WB.c",
- "opus/silk/debug.c",
- "opus/silk/decode_parameters.c",
- "opus/silk/tables_pitch_lag.c",
- "opus/silk/NLSF2A.c",
- "opus/silk/resampler.c",
- "opus/silk/decode_indices.c",
- "opus/silk/NLSF_VQ.c",
- "opus/silk/bwexpander_32.c",
- "opus/silk/tables_NLSF_CB_NB_MB.c",
- "opus/silk/encode_pulses.c",
- "opus/silk/NSQ_del_dec.c",
- "opus/silk/control_SNR.c",
- "opus/silk/shell_coder.c",
- "opus/silk/NLSF_encode.c",
- "opus/silk/stereo_MS_to_LR.c",
- "opus/silk/stereo_LR_to_MS.c",
- "opus/silk/HP_variable_cutoff.c",
- "opus/silk/LPC_analysis_filter.c",
- "opus/silk/CNG.c",
- "opus/silk/decoder_set_fs.c",
- "opus/silk/resampler_rom.c",
- "opus/silk/control_audio_bandwidth.c",
- "opus/silk/lin2log.c",
- "opus/silk/LP_variable_cutoff.c",
- "opus/silk/NSQ.c",
- "opus/silk/gain_quant.c",
- "opus/celt/laplace.c",
- "opus/celt/vq.c",
- "opus/celt/quant_bands.c",
- "opus/celt/kiss_fft.c",
- "opus/celt/entcode.c",
- "opus/celt/entenc.c",
- "opus/celt/celt_lpc.c",
- "opus/celt/pitch.c",
- "opus/celt/rate.c",
- "opus/celt/mathops.c",
- #"opus/celt/arm/armcpu.c",
- #"opus/celt/arm/celt_neon_intr.c",
- #"opus/celt/arm/celt_ne10_mdct.c",
- #"opus/celt/arm/celt_ne10_fft.c",
- #"opus/celt/arm/arm_celt_map.c",
- "opus/celt/celt_encoder.c",
- "opus/celt/celt.c",
- "opus/celt/bands.c",
- "opus/celt/cwrs.c",
- "opus/celt/entdec.c",
- "opus/celt/celt_decoder.c",
- "opus/celt/mdct.c",
- "opus/celt/modes.c",
- "opus/repacketizer.c",
- "opus/mlp_data.c",
- "opus/opus_multistream.c",
- "opus/opusfile.c",
- "opus/opus_encoder.c",
- "opus/analysis.c",
- "opus/mlp.c",
- "opus/info.c",
- "opus/stream.c",
- "opus/opus_decoder.c",
- "opus/internal.c",
- "opus/wincerts.c",
- "opus/opus.c",
- "opus/opus_multistream_encoder.c",
- "opus/http.c",
- "opus/opus_multistream_decoder.c"
-]
-
-if("opus_fixed_point" in env and env.opus_fixed_point=="yes"):
- env.Append(CFLAGS=["-DOPUS_FIXED_POINT"])
- opus_sources_silk = [
- "opus/silk/fixed/schur64_FIX.c",
- "opus/silk/fixed/residual_energy16_FIX.c",
- "opus/silk/fixed/encode_frame_FIX.c",
- "opus/silk/fixed/regularize_correlations_FIX.c",
- "opus/silk/fixed/apply_sine_window_FIX.c",
- "opus/silk/fixed/solve_LS_FIX.c",
- "opus/silk/fixed/schur_FIX.c",
- "opus/silk/fixed/pitch_analysis_core_FIX.c",
- "opus/silk/fixed/noise_shape_analysis_FIX.c",
- "opus/silk/fixed/find_LTP_FIX.c",
- "opus/silk/fixed/vector_ops_FIX.c",
- "opus/silk/fixed/autocorr_FIX.c",
- "opus/silk/fixed/warped_autocorrelation_FIX.c",
- "opus/silk/fixed/find_pitch_lags_FIX.c",
- "opus/silk/fixed/k2a_Q16_FIX.c",
- "opus/silk/fixed/LTP_scale_ctrl_FIX.c",
- "opus/silk/fixed/corrMatrix_FIX.c",
- "opus/silk/fixed/prefilter_FIX.c",
- "opus/silk/fixed/find_LPC_FIX.c",
- "opus/silk/fixed/residual_energy_FIX.c",
- "opus/silk/fixed/process_gains_FIX.c",
- "opus/silk/fixed/LTP_analysis_filter_FIX.c",
- "opus/silk/fixed/k2a_FIX.c",
- "opus/silk/fixed/burg_modified_FIX.c",
- "opus/silk/fixed/find_pred_coefs_FIX.c"
- ]
-else:
- opus_sources_silk = [
- "opus/silk/float/LTP_scale_ctrl_FLP.c",
- "opus/silk/float/regularize_correlations_FLP.c",
- "opus/silk/float/corrMatrix_FLP.c",
- "opus/silk/float/LPC_analysis_filter_FLP.c",
- "opus/silk/float/levinsondurbin_FLP.c",
- "opus/silk/float/schur_FLP.c",
- "opus/silk/float/scale_vector_FLP.c",
- "opus/silk/float/apply_sine_window_FLP.c",
- "opus/silk/float/pitch_analysis_core_FLP.c",
- "opus/silk/float/wrappers_FLP.c",
- "opus/silk/float/bwexpander_FLP.c",
- "opus/silk/float/warped_autocorrelation_FLP.c",
- "opus/silk/float/solve_LS_FLP.c",
- "opus/silk/float/find_LPC_FLP.c",
- "opus/silk/float/autocorrelation_FLP.c",
- "opus/silk/float/find_pred_coefs_FLP.c",
- "opus/silk/float/find_pitch_lags_FLP.c",
- "opus/silk/float/burg_modified_FLP.c",
- "opus/silk/float/find_LTP_FLP.c",
- "opus/silk/float/energy_FLP.c",
- "opus/silk/float/sort_FLP.c",
- "opus/silk/float/LPC_inv_pred_gain_FLP.c",
- "opus/silk/float/k2a_FLP.c",
- "opus/silk/float/noise_shape_analysis_FLP.c",
- "opus/silk/float/inner_product_FLP.c",
- "opus/silk/float/process_gains_FLP.c",
- "opus/silk/float/encode_frame_FLP.c",
- "opus/silk/float/scale_copy_vector_FLP.c",
- "opus/silk/float/residual_energy_FLP.c",
- "opus/silk/float/LTP_analysis_filter_FLP.c",
- "opus/silk/float/prefilter_FLP.c"
- ]
-
-
-env.drivers_sources+=opus_sources_silk
-env.drivers_sources+=opus_sources_lib
-env.drivers_sources+=opus_sources
-
-Export('env')
diff --git a/drivers/register_driver_types.cpp b/drivers/register_driver_types.cpp
index cd4fcd18f2..14af9ac1a6 100644
--- a/drivers/register_driver_types.cpp
+++ b/drivers/register_driver_types.cpp
@@ -45,18 +45,6 @@
#include "platform/windows/export/export.h"
#endif
-#ifdef TREMOR_ENABLED
-#include "teora/audio_stream_ogg.h"
-#endif
-
-#ifdef VORBIS_ENABLED
-#include "vorbis/audio_stream_ogg_vorbis.h"
-#endif
-
-#ifdef OPUS_ENABLED
-#include "opus/audio_stream_opus.h"
-#endif
-
#ifdef THEORA_ENABLED
#include "theora/video_stream_theora.h"
#endif
@@ -71,18 +59,6 @@
static ImageLoaderPNG *image_loader_png=NULL;
static ResourceSaverPNG *resource_saver_png=NULL;
-#ifdef TREMOR_ENABLED
-static ResourceFormatLoaderAudioStreamOGG *vorbis_stream_loader=NULL;
-#endif
-
-#ifdef VORBIS_ENABLED
-static ResourceFormatLoaderAudioStreamOGGVorbis *vorbis_stream_loader=NULL;
-#endif
-
-#ifdef OPUS_ENABLED
-static ResourceFormatLoaderAudioStreamOpus *opus_stream_loader=NULL;
-#endif
-
#ifdef THEORA_ENABLED
static ResourceFormatLoaderVideoStreamTheora* theora_stream_loader = NULL;
#endif
@@ -118,24 +94,6 @@ void unregister_core_driver_types() {
void register_driver_types() {
-#ifdef TREMOR_ENABLED
- vorbis_stream_loader=memnew( ResourceFormatLoaderAudioStreamOGG );
- ResourceLoader::add_resource_format_loader(vorbis_stream_loader );
- ObjectTypeDB::register_type<AudioStreamOGG>();
-#endif
-
-#ifdef VORBIS_ENABLED
- vorbis_stream_loader=memnew( ResourceFormatLoaderAudioStreamOGGVorbis );
- ResourceLoader::add_resource_format_loader(vorbis_stream_loader );
- ObjectTypeDB::register_type<AudioStreamOGGVorbis>();
-#endif
-
-#ifdef OPUS_ENABLED
- opus_stream_loader=memnew( ResourceFormatLoaderAudioStreamOpus );
- ResourceLoader::add_resource_format_loader( opus_stream_loader );
- ObjectTypeDB::register_type<AudioStreamOpus>();
-#endif
-
#ifdef TOOLS_ENABLED
Geometry::_decompose_func=b2d_decompose;
@@ -174,19 +132,6 @@ void register_driver_types() {
void unregister_driver_types() {
-
-#ifdef TREMOR_ENABLED
- memdelete( vorbis_stream_loader );
-#endif
-
-#ifdef VORBIS_ENABLED
- memdelete( vorbis_stream_loader );
-#endif
-
-#ifdef OPUS_ENABLED
- memdelete( opus_stream_loader );
-#endif
-
#ifdef THEORA_ENABLED
memdelete (theora_stream_loader);
#endif
diff --git a/drivers/vorbis/SCsub b/drivers/vorbis/SCsub
deleted file mode 100644
index 4afafcc4ba..0000000000
--- a/drivers/vorbis/SCsub
+++ /dev/null
@@ -1,36 +0,0 @@
-Import('env')
-
-sources = [
- "vorbis/audio_stream_ogg_vorbis.cpp",
-]
-
-sources_lib = [
- #"vorbis/analysis.c",
- #"vorbis/barkmel.c",
- "vorbis/bitrate.c",
- "vorbis/block.c",
- "vorbis/codebook.c",
- "vorbis/envelope.c",
- "vorbis/floor0.c",
- "vorbis/floor1.c",
- "vorbis/info.c",
- "vorbis/lookup.c",
- "vorbis/lpc.c",
- "vorbis/lsp.c",
- "vorbis/mapping0.c",
- "vorbis/mdct.c",
- "vorbis/psy.c",
- #"vorbis/psytune.c",
- "vorbis/registry.c",
- "vorbis/res0.c",
- "vorbis/sharedbook.c",
- "vorbis/smallft.c",
- "vorbis/synthesis.c",
- #"vorbis/tone.c",
- #"vorbis/vorbisenc.c",
- "vorbis/vorbisfile.c",
- "vorbis/window.c",
-]
-
-env.drivers_sources += sources
-env.drivers_sources += sources_lib
diff --git a/modules/ogg/SCsub b/modules/ogg/SCsub
new file mode 100644
index 0000000000..42d593f88e
--- /dev/null
+++ b/modules/ogg/SCsub
@@ -0,0 +1,20 @@
+Import('env')
+Import('env_modules')
+
+# Thirdparty source files
+if (env["libogg"] != "system"): # builtin
+ thirdparty_dir = "#thirdparty/libogg/"
+ thirdparty_libogg_sources = [
+ "bitwise.c",
+ "framing.c",
+ ]
+ thirdparty_libogg_sources = [thirdparty_dir + file for file in thirdparty_libogg_sources]
+
+ env_modules.add_source_files(env.modules_sources, thirdparty_libogg_sources)
+ env_modules.Append(CPPPATH = [thirdparty_dir])
+
+# Godot source files
+env_modules.add_source_files(env.modules_sources, "*.cpp")
+
+Export('env_modules')
+Export('env')
diff --git a/modules/ogg/config.py b/modules/ogg/config.py
new file mode 100644
index 0000000000..368e97e152
--- /dev/null
+++ b/modules/ogg/config.py
@@ -0,0 +1,6 @@
+
+def can_build(platform):
+ return True
+
+def configure(env):
+ pass
diff --git a/modules/ogg/register_types.cpp b/modules/ogg/register_types.cpp
new file mode 100644
index 0000000000..823ca510ca
--- /dev/null
+++ b/modules/ogg/register_types.cpp
@@ -0,0 +1,35 @@
+/*************************************************************************/
+/* register_types.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+#include "register_types.h"
+
+// Dummy module as libogg is needed by other modules (vorbis, theora, opus, ...)
+
+void register_ogg_types() {}
+
+void unregister_ogg_types() {}
diff --git a/modules/ogg/register_types.h b/modules/ogg/register_types.h
new file mode 100644
index 0000000000..b5268a1df4
--- /dev/null
+++ b/modules/ogg/register_types.h
@@ -0,0 +1,30 @@
+/*************************************************************************/
+/* register_types.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+void register_ogg_types();
+void unregister_ogg_types();
diff --git a/modules/opus/SCsub b/modules/opus/SCsub
new file mode 100644
index 0000000000..a18e008fe0
--- /dev/null
+++ b/modules/opus/SCsub
@@ -0,0 +1,211 @@
+Import('env')
+Import('env_modules')
+
+# Thirdparty source files
+if (env["opus"] != "system"): # builtin
+ thirdparty_dir = "#thirdparty/opus/"
+
+ thirdparty_opus_sources = [
+ "silk/tables_other.c",
+ "silk/sum_sqr_shift.c",
+ "silk/PLC.c",
+ "silk/dec_API.c",
+ "silk/decode_pulses.c",
+ "silk/inner_prod_aligned.c",
+ "silk/init_encoder.c",
+ "silk/interpolate.c",
+ "silk/stereo_encode_pred.c",
+ "silk/decode_frame.c",
+ "silk/NLSF_del_dec_quant.c",
+ "silk/VAD.c",
+ "silk/resampler_private_AR2.c",
+ "silk/NLSF_unpack.c",
+ "silk/resampler_down2.c",
+ "silk/sort.c",
+ "silk/resampler_private_IIR_FIR.c",
+ "silk/resampler_down2_3.c",
+ "silk/resampler_private_up2_HQ.c",
+ "silk/tables_gain.c",
+ "silk/stereo_find_predictor.c",
+ "silk/stereo_quant_pred.c",
+ "silk/NLSF_stabilize.c",
+ "silk/ana_filt_bank_1.c",
+ "silk/check_control_input.c",
+ "silk/bwexpander.c",
+ "silk/A2NLSF.c",
+ "silk/LPC_inv_pred_gain.c",
+ "silk/log2lin.c",
+ "silk/process_NLSFs.c",
+ "silk/sigm_Q15.c",
+ "silk/VQ_WMat_EC.c",
+ "silk/quant_LTP_gains.c",
+ "silk/resampler_private_down_FIR.c",
+ "silk/NLSF_decode.c",
+ "silk/control_codec.c",
+ "silk/NLSF_VQ_weights_laroia.c",
+ "silk/decode_pitch.c",
+ "silk/stereo_decode_pred.c",
+ "silk/tables_pulses_per_block.c",
+ "silk/init_decoder.c",
+ "silk/table_LSF_cos.c",
+ "silk/decode_core.c",
+ "silk/code_signs.c",
+ "silk/enc_API.c",
+ "silk/tables_LTP.c",
+ "silk/pitch_est_tables.c",
+ "silk/biquad_alt.c",
+ "silk/encode_indices.c",
+ "silk/tables_NLSF_CB_WB.c",
+ "silk/debug.c",
+ "silk/decode_parameters.c",
+ "silk/tables_pitch_lag.c",
+ "silk/NLSF2A.c",
+ "silk/resampler.c",
+ "silk/decode_indices.c",
+ "silk/NLSF_VQ.c",
+ "silk/bwexpander_32.c",
+ "silk/tables_NLSF_CB_NB_MB.c",
+ "silk/encode_pulses.c",
+ "silk/NSQ_del_dec.c",
+ "silk/control_SNR.c",
+ "silk/shell_coder.c",
+ "silk/NLSF_encode.c",
+ "silk/stereo_MS_to_LR.c",
+ "silk/stereo_LR_to_MS.c",
+ "silk/HP_variable_cutoff.c",
+ "silk/LPC_analysis_filter.c",
+ "silk/CNG.c",
+ "silk/decoder_set_fs.c",
+ "silk/resampler_rom.c",
+ "silk/control_audio_bandwidth.c",
+ "silk/lin2log.c",
+ "silk/LP_variable_cutoff.c",
+ "silk/NSQ.c",
+ "silk/gain_quant.c",
+ "celt/laplace.c",
+ "celt/vq.c",
+ "celt/quant_bands.c",
+ "celt/kiss_fft.c",
+ "celt/entcode.c",
+ "celt/entenc.c",
+ "celt/celt_lpc.c",
+ "celt/pitch.c",
+ "celt/rate.c",
+ "celt/mathops.c",
+ #"celt/arm/armcpu.c",
+ #"celt/arm/celt_neon_intr.c",
+ #"celt/arm/celt_ne10_mdct.c",
+ #"celt/arm/celt_ne10_fft.c",
+ #"celt/arm/arm_celt_map.c",
+ "celt/celt_encoder.c",
+ "celt/celt.c",
+ "celt/bands.c",
+ "celt/cwrs.c",
+ "celt/entdec.c",
+ "celt/celt_decoder.c",
+ "celt/mdct.c",
+ "celt/modes.c",
+ "repacketizer.c",
+ "mlp_data.c",
+ "opus_multistream.c",
+ "opusfile.c",
+ "opus_encoder.c",
+ "analysis.c",
+ "mlp.c",
+ "info.c",
+ "stream.c",
+ "opus_decoder.c",
+ "internal.c",
+ "wincerts.c",
+ "opus.c",
+ "opus_multistream_encoder.c",
+ "http.c",
+ "opus_multistream_decoder.c"
+ ]
+
+ opus_sources_silk = []
+
+ if("opus_fixed_point" in env and env.opus_fixed_point=="yes"):
+ env_modules.Append(CFLAGS = ["-DFIXED_POINT"])
+ opus_sources_silk = [
+ "silk/fixed/schur64_FIX.c",
+ "silk/fixed/residual_energy16_FIX.c",
+ "silk/fixed/encode_frame_FIX.c",
+ "silk/fixed/regularize_correlations_FIX.c",
+ "silk/fixed/apply_sine_window_FIX.c",
+ "silk/fixed/solve_LS_FIX.c",
+ "silk/fixed/schur_FIX.c",
+ "silk/fixed/pitch_analysis_core_FIX.c",
+ "silk/fixed/noise_shape_analysis_FIX.c",
+ "silk/fixed/find_LTP_FIX.c",
+ "silk/fixed/vector_ops_FIX.c",
+ "silk/fixed/autocorr_FIX.c",
+ "silk/fixed/warped_autocorrelation_FIX.c",
+ "silk/fixed/find_pitch_lags_FIX.c",
+ "silk/fixed/k2a_Q16_FIX.c",
+ "silk/fixed/LTP_scale_ctrl_FIX.c",
+ "silk/fixed/corrMatrix_FIX.c",
+ "silk/fixed/prefilter_FIX.c",
+ "silk/fixed/find_LPC_FIX.c",
+ "silk/fixed/residual_energy_FIX.c",
+ "silk/fixed/process_gains_FIX.c",
+ "silk/fixed/LTP_analysis_filter_FIX.c",
+ "silk/fixed/k2a_FIX.c",
+ "silk/fixed/burg_modified_FIX.c",
+ "silk/fixed/find_pred_coefs_FIX.c"
+ ]
+ else:
+ opus_sources_silk = [
+ "silk/float/LTP_scale_ctrl_FLP.c",
+ "silk/float/regularize_correlations_FLP.c",
+ "silk/float/corrMatrix_FLP.c",
+ "silk/float/LPC_analysis_filter_FLP.c",
+ "silk/float/levinsondurbin_FLP.c",
+ "silk/float/schur_FLP.c",
+ "silk/float/scale_vector_FLP.c",
+ "silk/float/apply_sine_window_FLP.c",
+ "silk/float/pitch_analysis_core_FLP.c",
+ "silk/float/wrappers_FLP.c",
+ "silk/float/bwexpander_FLP.c",
+ "silk/float/warped_autocorrelation_FLP.c",
+ "silk/float/solve_LS_FLP.c",
+ "silk/float/find_LPC_FLP.c",
+ "silk/float/autocorrelation_FLP.c",
+ "silk/float/find_pred_coefs_FLP.c",
+ "silk/float/find_pitch_lags_FLP.c",
+ "silk/float/burg_modified_FLP.c",
+ "silk/float/find_LTP_FLP.c",
+ "silk/float/energy_FLP.c",
+ "silk/float/sort_FLP.c",
+ "silk/float/LPC_inv_pred_gain_FLP.c",
+ "silk/float/k2a_FLP.c",
+ "silk/float/noise_shape_analysis_FLP.c",
+ "silk/float/inner_product_FLP.c",
+ "silk/float/process_gains_FLP.c",
+ "silk/float/encode_frame_FLP.c",
+ "silk/float/scale_copy_vector_FLP.c",
+ "silk/float/residual_energy_FLP.c",
+ "silk/float/LTP_analysis_filter_FLP.c",
+ "silk/float/prefilter_FLP.c"
+ ]
+
+ thirdparty_opus_sources = [thirdparty_dir + file for file in thirdparty_opus_sources + opus_sources_silk]
+
+ env_modules.add_source_files(env.modules_sources, thirdparty_opus_sources)
+ # FIXME: Clone the environment to make a env_opus and not pollute the modules env
+ env_modules.Append(CFLAGS=["-DHAVE_CONFIG_H"])
+
+ thirdparty_include_paths = [
+ "",
+ "celt",
+ "silk",
+ "silk/fixed",
+ "silk/float",
+ ]
+ env_modules.Append(CPPPATH = [thirdparty_dir + "/" + dir for dir in thirdparty_include_paths])
+
+# Module files
+env_modules.add_source_files(env.modules_sources, "*.cpp")
+
+Export('env_modules')
+Export('env')
diff --git a/drivers/opus/audio_stream_opus.cpp b/modules/opus/audio_stream_opus.cpp
index ab53fee0c9..ab53fee0c9 100644
--- a/drivers/opus/audio_stream_opus.cpp
+++ b/modules/opus/audio_stream_opus.cpp
diff --git a/drivers/opus/audio_stream_opus.h b/modules/opus/audio_stream_opus.h
index fc5531470d..4da66fe167 100644
--- a/drivers/opus/audio_stream_opus.h
+++ b/modules/opus/audio_stream_opus.h
@@ -32,11 +32,11 @@
#ifndef AUDIO_STREAM_OPUS_H
#define AUDIO_STREAM_OPUS_H
-#include "scene/resources/audio_stream.h"
-#include "opus/opusfile.h"
-#include "opus/internal.h"
-#include "os/file_access.h"
#include "io/resource_loader.h"
+#include "os/file_access.h"
+#include "scene/resources/audio_stream.h"
+
+#include <opusfile.h>
class AudioStreamPlaybackOpus : public AudioStreamPlayback {
diff --git a/modules/opus/config.py b/modules/opus/config.py
new file mode 100644
index 0000000000..368e97e152
--- /dev/null
+++ b/modules/opus/config.py
@@ -0,0 +1,6 @@
+
+def can_build(platform):
+ return True
+
+def configure(env):
+ pass
diff --git a/modules/opus/register_types.cpp b/modules/opus/register_types.cpp
new file mode 100644
index 0000000000..a4d71a52c7
--- /dev/null
+++ b/modules/opus/register_types.cpp
@@ -0,0 +1,45 @@
+/*************************************************************************/
+/* register_types.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+#include "register_types.h"
+
+#include "audio_stream_opus.h"
+
+static ResourceFormatLoaderAudioStreamOpus *opus_stream_loader = NULL;
+
+void register_opus_types() {
+
+ opus_stream_loader = memnew( ResourceFormatLoaderAudioStreamOpus );
+ ResourceLoader::add_resource_format_loader(opus_stream_loader);
+ ObjectTypeDB::register_type<AudioStreamOpus>();
+}
+
+void unregister_opus_types() {
+
+ memdelete( opus_stream_loader );
+}
diff --git a/modules/opus/register_types.h b/modules/opus/register_types.h
new file mode 100644
index 0000000000..f4386c373a
--- /dev/null
+++ b/modules/opus/register_types.h
@@ -0,0 +1,30 @@
+/*************************************************************************/
+/* register_types.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+void register_opus_types();
+void unregister_opus_types();
diff --git a/modules/vorbis/SCsub b/modules/vorbis/SCsub
new file mode 100644
index 0000000000..5427348c39
--- /dev/null
+++ b/modules/vorbis/SCsub
@@ -0,0 +1,44 @@
+Import('env')
+Import('env_modules')
+
+# Thirdparty source files
+if (env["libvorbis"] != "system"): # builtin
+ thirdparty_dir = "#thirdparty/libvorbis/"
+ thirdparty_libvorbis_sources = [
+ #"analysis.c",
+ #"barkmel.c",
+ "bitrate.c",
+ "block.c",
+ "codebook.c",
+ "envelope.c",
+ "floor0.c",
+ "floor1.c",
+ "info.c",
+ "lookup.c",
+ "lpc.c",
+ "lsp.c",
+ "mapping0.c",
+ "mdct.c",
+ "psy.c",
+ #"psytune.c",
+ "registry.c",
+ "res0.c",
+ "sharedbook.c",
+ "smallft.c",
+ "synthesis.c",
+ #"tone.c",
+ #"vorbisenc.c",
+ "vorbisfile.c",
+ "window.c",
+ ]
+
+ thirdparty_libvorbis_sources = [thirdparty_dir + file for file in thirdparty_libvorbis_sources]
+
+ env_modules.add_source_files(env.modules_sources, thirdparty_libvorbis_sources)
+ env_modules.Append(CPPPATH = [thirdparty_dir])
+
+# Godot source files
+env_modules.add_source_files(env.modules_sources, "*.cpp")
+
+Export('env_modules')
+Export('env')
diff --git a/drivers/vorbis/audio_stream_ogg_vorbis.cpp b/modules/vorbis/audio_stream_ogg_vorbis.cpp
index 4ce7940a01..4ce7940a01 100644
--- a/drivers/vorbis/audio_stream_ogg_vorbis.cpp
+++ b/modules/vorbis/audio_stream_ogg_vorbis.cpp
diff --git a/drivers/vorbis/audio_stream_ogg_vorbis.h b/modules/vorbis/audio_stream_ogg_vorbis.h
index bb4d521c1e..8d8d7392b5 100644
--- a/drivers/vorbis/audio_stream_ogg_vorbis.h
+++ b/modules/vorbis/audio_stream_ogg_vorbis.h
@@ -29,12 +29,12 @@
#ifndef AUDIO_STREAM_OGG_VORBIS_H
#define AUDIO_STREAM_OGG_VORBIS_H
-#include "scene/resources/audio_stream.h"
-#include "vorbis/vorbisfile.h"
-#include "os/file_access.h"
#include "io/resource_loader.h"
+#include "os/file_access.h"
#include "os/thread_safe.h"
+#include "scene/resources/audio_stream.h"
+#include <vorbis/vorbisfile.h>
class AudioStreamPlaybackOGGVorbis : public AudioStreamPlayback {
diff --git a/modules/vorbis/config.py b/modules/vorbis/config.py
new file mode 100644
index 0000000000..368e97e152
--- /dev/null
+++ b/modules/vorbis/config.py
@@ -0,0 +1,6 @@
+
+def can_build(platform):
+ return True
+
+def configure(env):
+ pass
diff --git a/modules/vorbis/register_types.cpp b/modules/vorbis/register_types.cpp
new file mode 100644
index 0000000000..ae63b5af3c
--- /dev/null
+++ b/modules/vorbis/register_types.cpp
@@ -0,0 +1,45 @@
+/*************************************************************************/
+/* register_types.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+#include "register_types.h"
+
+#include "audio_stream_ogg_vorbis.h"
+
+static ResourceFormatLoaderAudioStreamOGGVorbis *vorbis_stream_loader = NULL;
+
+void register_vorbis_types() {
+
+ vorbis_stream_loader = memnew( ResourceFormatLoaderAudioStreamOGGVorbis );
+ ResourceLoader::add_resource_format_loader(vorbis_stream_loader);
+ ObjectTypeDB::register_type<AudioStreamOGGVorbis>();
+}
+
+void unregister_vorbis_types() {
+
+ memdelete( vorbis_stream_loader );
+}
diff --git a/modules/vorbis/register_types.h b/modules/vorbis/register_types.h
new file mode 100644
index 0000000000..6baaed7ce8
--- /dev/null
+++ b/modules/vorbis/register_types.h
@@ -0,0 +1,30 @@
+/*************************************************************************/
+/* register_types.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+void register_vorbis_types();
+void unregister_vorbis_types();
diff --git a/platform/android/detect.py b/platform/android/detect.py
index 8e9a58da19..9087d5343e 100644
--- a/platform/android/detect.py
+++ b/platform/android/detect.py
@@ -203,7 +203,8 @@ def configure(env):
env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL','-DMPC_FIXED_POINT'])
# env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED','-DMPC_FIXED_POINT'])
- if(env["opus"]=="yes"):
+ # TODO: Move that to opus module's config
+ if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"):
if (env["android_arch"]=="armv6" or env["android_arch"]=="armv7"):
env.Append(CFLAGS=["-DOPUS_ARM_OPT"])
env.opus_fixed_point="yes"
diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py
index 9cb52d4561..3de0ba0db9 100644
--- a/platform/iphone/detect.py
+++ b/platform/iphone/detect.py
@@ -165,7 +165,8 @@ def configure(env):
env['ENV']['CODESIGN_ALLOCATE'] = '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate'
env.Append(CPPFLAGS=['-DIPHONE_ENABLED', '-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DMPC_FIXED_POINT'])
- if(env["opus"]=="yes"):
+ # TODO: Move that to opus module's config
+ if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"):
env.opus_fixed_point="yes"
if env["arch"]=="x86":
pass
diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py
index 0f1fd23177..f80c3b4915 100644
--- a/platform/javascript/detect.py
+++ b/platform/javascript/detect.py
@@ -70,8 +70,9 @@ def configure(env):
#env.Append(CCFLAGS=['-D_DEBUG', '-Wall', '-g4', '-DDEBUG_ENABLED'])
env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ALLOC'])
- if(env["opus"]=="yes"):
- env.opus_fixed_point="yes"
+ # TODO: Move that to opus module's config
+ if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"):
+ env.opus_fixed_point = "yes"
env.Append(CPPFLAGS=["-fno-exceptions",'-DNO_SAFE_CAST','-fno-rtti'])
env.Append(CPPFLAGS=['-DJAVASCRIPT_ENABLED', '-DUNIX_ENABLED', '-DPTHREAD_NO_RENAME', '-DNO_FCNTL','-DMPC_FIXED_POINT','-DTYPED_METHOD_BIND','-DNO_THREADS'])
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index 6a5ca84cbe..8a156a6bce 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -155,6 +155,17 @@ def configure(env):
if (env["enet"] == "system"):
env.ParseConfig('pkg-config libenet --cflags --libs')
+ if (env["libogg"] == "system"):
+ env.ParseConfig('pkg-config ogg --cflags --libs')
+
+ if (env["libvorbis"] == "system"):
+ env["libogg"] = "system" # Needed to link against system libvorbis
+ env.ParseConfig('pkg-config vorbis vorbisfile ogg --cflags --libs')
+
+ if (env["opus"] == "system"):
+ env["libogg"] = "system" # Needed to link against system opus
+ env.ParseConfig('pkg-config opus opusfile ogg --cflags --libs')
+
env.Append(CPPFLAGS=['-DOPENGL_ENABLED'])
diff --git a/thirdparty/README.md b/thirdparty/README.md
index b3aebb5180..be4d717bfe 100644
--- a/thirdparty/README.md
+++ b/thirdparty/README.md
@@ -29,6 +29,19 @@ Files extracted from upstream source:
- jpgd.{c,h}
+## libogg
+
+- Upstream: https://www.xiph.org/ogg
+- Version: 1.3.2
+- License: BSD-3-Clause
+
+Files extracted from upstream source:
+
+- src/\*.c
+- include/ogg/\*.h in ogg/
+- COPYING
+
+
## libpng
- Upstream: http://libpng.org/pub/png/libpng.html
@@ -44,6 +57,19 @@ Files extracted from upstream source:
- scripts/pnglibconf.h.prebuilt as pnglibconf.h
+## libvorbis
+
+- Upstream: https://www.xiph.org/vorbis
+- Version: 1.3.5
+- License: BSD-3-Clause
+
+Files extracted from upstream source:
+
+- src/\* except from: lookups.pl, Makefile.\*
+- include/vorbis/\*.h as vorbis/
+- COPYING
+
+
## libwebp
- Upstream: https://chromium.googlesource.com/webm/libwebp/
@@ -60,6 +86,20 @@ changes to ensure they build for Javascript/HTML5. Those
changes are marked with `// -- GODOT --` comments.
+## opus
+
+- Upstream: https://opus-codec.org
+- Version: 1.1.2 (opus) and 0.7 (opusfile)
+- License: BSD-3-Clause
+
+Files extracted from upstream source:
+
+- all .c and .h files in src/ (both opus and opusfile),
+ except opus_demo.c
+- all .h files in include/ (both opus and opusfile)
+- COPYING
+
+
## pvrtccompressor
- Upstream: https://bitbucket.org/jthlim/pvrtccompressor
diff --git a/drivers/ogg/COPYING b/thirdparty/libogg/COPYING
index 6111c6c5a6..6111c6c5a6 100644
--- a/drivers/ogg/COPYING
+++ b/thirdparty/libogg/COPYING
diff --git a/drivers/ogg/bitwise.c b/thirdparty/libogg/bitwise.c
index 145901d185..145901d185 100644
--- a/drivers/ogg/bitwise.c
+++ b/thirdparty/libogg/bitwise.c
diff --git a/drivers/ogg/framing.c b/thirdparty/libogg/framing.c
index 3a2f0a6058..3a2f0a6058 100644
--- a/drivers/ogg/framing.c
+++ b/thirdparty/libogg/framing.c
diff --git a/drivers/ogg/config_types.h b/thirdparty/libogg/ogg/config_types.h
index 5ea49b8abd..5ea49b8abd 100644
--- a/drivers/ogg/config_types.h
+++ b/thirdparty/libogg/ogg/config_types.h
diff --git a/drivers/ogg/ogg.h b/thirdparty/libogg/ogg/ogg.h
index cea4ebed75..cea4ebed75 100644
--- a/drivers/ogg/ogg.h
+++ b/thirdparty/libogg/ogg/ogg.h
diff --git a/drivers/ogg/os_types.h b/thirdparty/libogg/ogg/os_types.h
index 8bf82107e5..8bf82107e5 100644
--- a/drivers/ogg/os_types.h
+++ b/thirdparty/libogg/ogg/os_types.h
diff --git a/drivers/vorbis/COPYING b/thirdparty/libvorbis/COPYING
index 8f1d18cc2b..8f1d18cc2b 100644
--- a/drivers/vorbis/COPYING
+++ b/thirdparty/libvorbis/COPYING
diff --git a/drivers/vorbis/analysis.c b/thirdparty/libvorbis/analysis.c
index 01aa6f30db..01aa6f30db 100644
--- a/drivers/vorbis/analysis.c
+++ b/thirdparty/libvorbis/analysis.c
diff --git a/drivers/vorbis/backends.h b/thirdparty/libvorbis/backends.h
index ff5bcc95fe..ff5bcc95fe 100644
--- a/drivers/vorbis/backends.h
+++ b/thirdparty/libvorbis/backends.h
diff --git a/drivers/vorbis/barkmel.c b/thirdparty/libvorbis/barkmel.c
index 37b6c4c7ba..37b6c4c7ba 100644
--- a/drivers/vorbis/barkmel.c
+++ b/thirdparty/libvorbis/barkmel.c
diff --git a/drivers/vorbis/bitrate.c b/thirdparty/libvorbis/bitrate.c
index 3a71b1dc23..3a71b1dc23 100644
--- a/drivers/vorbis/bitrate.c
+++ b/thirdparty/libvorbis/bitrate.c
diff --git a/drivers/vorbis/bitrate.h b/thirdparty/libvorbis/bitrate.h
index db48fcb645..db48fcb645 100644
--- a/drivers/vorbis/bitrate.h
+++ b/thirdparty/libvorbis/bitrate.h
diff --git a/drivers/vorbis/block.c b/thirdparty/libvorbis/block.c
index 345c042769..345c042769 100644
--- a/drivers/vorbis/block.c
+++ b/thirdparty/libvorbis/block.c
diff --git a/drivers/vorbis/books/coupled/res_books_51.h b/thirdparty/libvorbis/books/coupled/res_books_51.h
index 93910ff481..93910ff481 100644
--- a/drivers/vorbis/books/coupled/res_books_51.h
+++ b/thirdparty/libvorbis/books/coupled/res_books_51.h
diff --git a/drivers/vorbis/books/coupled/res_books_stereo.h b/thirdparty/libvorbis/books/coupled/res_books_stereo.h
index 9a9049f6ed..9a9049f6ed 100644
--- a/drivers/vorbis/books/coupled/res_books_stereo.h
+++ b/thirdparty/libvorbis/books/coupled/res_books_stereo.h
diff --git a/drivers/vorbis/books/floor/floor_books.h b/thirdparty/libvorbis/books/floor/floor_books.h
index e925313f7b..e925313f7b 100644
--- a/drivers/vorbis/books/floor/floor_books.h
+++ b/thirdparty/libvorbis/books/floor/floor_books.h
diff --git a/drivers/vorbis/books/uncoupled/res_books_uncoupled.h b/thirdparty/libvorbis/books/uncoupled/res_books_uncoupled.h
index 736353b675..736353b675 100644
--- a/drivers/vorbis/books/uncoupled/res_books_uncoupled.h
+++ b/thirdparty/libvorbis/books/uncoupled/res_books_uncoupled.h
diff --git a/drivers/vorbis/codebook.c b/thirdparty/libvorbis/codebook.c
index 72f8a17a35..72f8a17a35 100644
--- a/drivers/vorbis/codebook.c
+++ b/thirdparty/libvorbis/codebook.c
diff --git a/drivers/vorbis/codebook.h b/thirdparty/libvorbis/codebook.h
index 537d6c12d3..537d6c12d3 100644
--- a/drivers/vorbis/codebook.h
+++ b/thirdparty/libvorbis/codebook.h
diff --git a/drivers/vorbis/codec_internal.h b/thirdparty/libvorbis/codec_internal.h
index de1bccaedf..de1bccaedf 100644
--- a/drivers/vorbis/codec_internal.h
+++ b/thirdparty/libvorbis/codec_internal.h
diff --git a/drivers/vorbis/envelope.c b/thirdparty/libvorbis/envelope.c
index 010c66e2d6..010c66e2d6 100644
--- a/drivers/vorbis/envelope.c
+++ b/thirdparty/libvorbis/envelope.c
diff --git a/drivers/vorbis/envelope.h b/thirdparty/libvorbis/envelope.h
index fd15fb32a7..fd15fb32a7 100644
--- a/drivers/vorbis/envelope.h
+++ b/thirdparty/libvorbis/envelope.h
diff --git a/drivers/vorbis/floor0.c b/thirdparty/libvorbis/floor0.c
index 213cce4ec8..213cce4ec8 100644
--- a/drivers/vorbis/floor0.c
+++ b/thirdparty/libvorbis/floor0.c
diff --git a/drivers/vorbis/floor1.c b/thirdparty/libvorbis/floor1.c
index d8bd4645c1..d8bd4645c1 100644
--- a/drivers/vorbis/floor1.c
+++ b/thirdparty/libvorbis/floor1.c
diff --git a/drivers/vorbis/highlevel.h b/thirdparty/libvorbis/highlevel.h
index e38f370fd6..e38f370fd6 100644
--- a/drivers/vorbis/highlevel.h
+++ b/thirdparty/libvorbis/highlevel.h
diff --git a/drivers/vorbis/info.c b/thirdparty/libvorbis/info.c
index 8a2a001f99..8a2a001f99 100644
--- a/drivers/vorbis/info.c
+++ b/thirdparty/libvorbis/info.c
diff --git a/drivers/vorbis/lookup.c b/thirdparty/libvorbis/lookup.c
index 3321ed3dbc..3321ed3dbc 100644
--- a/drivers/vorbis/lookup.c
+++ b/thirdparty/libvorbis/lookup.c
diff --git a/drivers/vorbis/lookup.h b/thirdparty/libvorbis/lookup.h
index f8b5b82730..f8b5b82730 100644
--- a/drivers/vorbis/lookup.h
+++ b/thirdparty/libvorbis/lookup.h
diff --git a/drivers/vorbis/lookup_data.h b/thirdparty/libvorbis/lookup_data.h
index 2424a1b386..2424a1b386 100644
--- a/drivers/vorbis/lookup_data.h
+++ b/thirdparty/libvorbis/lookup_data.h
diff --git a/drivers/vorbis/lpc.c b/thirdparty/libvorbis/lpc.c
index f5199ec235..f5199ec235 100644
--- a/drivers/vorbis/lpc.c
+++ b/thirdparty/libvorbis/lpc.c
diff --git a/drivers/vorbis/lpc.h b/thirdparty/libvorbis/lpc.h
index 39d237601b..39d237601b 100644
--- a/drivers/vorbis/lpc.h
+++ b/thirdparty/libvorbis/lpc.h
diff --git a/drivers/vorbis/lsp.c b/thirdparty/libvorbis/lsp.c
index 6a619f7b0c..6a619f7b0c 100644
--- a/drivers/vorbis/lsp.c
+++ b/thirdparty/libvorbis/lsp.c
diff --git a/drivers/vorbis/lsp.h b/thirdparty/libvorbis/lsp.h
index bacfb0971f..bacfb0971f 100644
--- a/drivers/vorbis/lsp.h
+++ b/thirdparty/libvorbis/lsp.h
diff --git a/drivers/vorbis/mapping0.c b/thirdparty/libvorbis/mapping0.c
index 85c7d22d83..85c7d22d83 100644
--- a/drivers/vorbis/mapping0.c
+++ b/thirdparty/libvorbis/mapping0.c
diff --git a/drivers/vorbis/masking.h b/thirdparty/libvorbis/masking.h
index 3576ab7885..3576ab7885 100644
--- a/drivers/vorbis/masking.h
+++ b/thirdparty/libvorbis/masking.h
diff --git a/drivers/vorbis/mdct.c b/thirdparty/libvorbis/mdct.c
index 0816331805..0816331805 100644
--- a/drivers/vorbis/mdct.c
+++ b/thirdparty/libvorbis/mdct.c
diff --git a/drivers/vorbis/mdct.h b/thirdparty/libvorbis/mdct.h
index 3ed94333c5..3ed94333c5 100644
--- a/drivers/vorbis/mdct.h
+++ b/thirdparty/libvorbis/mdct.h
diff --git a/drivers/vorbis/misc.h b/thirdparty/libvorbis/misc.h
index 73b4519898..73b4519898 100644
--- a/drivers/vorbis/misc.h
+++ b/thirdparty/libvorbis/misc.h
diff --git a/drivers/vorbis/modes/floor_all.h b/thirdparty/libvorbis/modes/floor_all.h
index 4292be326e..4292be326e 100644
--- a/drivers/vorbis/modes/floor_all.h
+++ b/thirdparty/libvorbis/modes/floor_all.h
diff --git a/drivers/vorbis/modes/psych_11.h b/thirdparty/libvorbis/modes/psych_11.h
index 844a8ed3cd..844a8ed3cd 100644
--- a/drivers/vorbis/modes/psych_11.h
+++ b/thirdparty/libvorbis/modes/psych_11.h
diff --git a/drivers/vorbis/modes/psych_16.h b/thirdparty/libvorbis/modes/psych_16.h
index 1c10b3954e..1c10b3954e 100644
--- a/drivers/vorbis/modes/psych_16.h
+++ b/thirdparty/libvorbis/modes/psych_16.h
diff --git a/drivers/vorbis/modes/psych_44.h b/thirdparty/libvorbis/modes/psych_44.h
index f05c032653..f05c032653 100644
--- a/drivers/vorbis/modes/psych_44.h
+++ b/thirdparty/libvorbis/modes/psych_44.h
diff --git a/drivers/vorbis/modes/psych_8.h b/thirdparty/libvorbis/modes/psych_8.h
index 0e2dd57371..0e2dd57371 100644
--- a/drivers/vorbis/modes/psych_8.h
+++ b/thirdparty/libvorbis/modes/psych_8.h
diff --git a/drivers/vorbis/modes/residue_16.h b/thirdparty/libvorbis/modes/residue_16.h
index dcaca5451e..dcaca5451e 100644
--- a/drivers/vorbis/modes/residue_16.h
+++ b/thirdparty/libvorbis/modes/residue_16.h
diff --git a/drivers/vorbis/modes/residue_44.h b/thirdparty/libvorbis/modes/residue_44.h
index 236c18341b..236c18341b 100644
--- a/drivers/vorbis/modes/residue_44.h
+++ b/thirdparty/libvorbis/modes/residue_44.h
diff --git a/drivers/vorbis/modes/residue_44p51.h b/thirdparty/libvorbis/modes/residue_44p51.h
index a52cc5245e..a52cc5245e 100644
--- a/drivers/vorbis/modes/residue_44p51.h
+++ b/thirdparty/libvorbis/modes/residue_44p51.h
diff --git a/drivers/vorbis/modes/residue_44u.h b/thirdparty/libvorbis/modes/residue_44u.h
index 92c4a09ce3..92c4a09ce3 100644
--- a/drivers/vorbis/modes/residue_44u.h
+++ b/thirdparty/libvorbis/modes/residue_44u.h
diff --git a/drivers/vorbis/modes/residue_8.h b/thirdparty/libvorbis/modes/residue_8.h
index 94c6d84c44..94c6d84c44 100644
--- a/drivers/vorbis/modes/residue_8.h
+++ b/thirdparty/libvorbis/modes/residue_8.h
diff --git a/drivers/vorbis/modes/setup_11.h b/thirdparty/libvorbis/modes/setup_11.h
index 4c2d619ca2..4c2d619ca2 100644
--- a/drivers/vorbis/modes/setup_11.h
+++ b/thirdparty/libvorbis/modes/setup_11.h
diff --git a/drivers/vorbis/modes/setup_16.h b/thirdparty/libvorbis/modes/setup_16.h
index 336007f98e..336007f98e 100644
--- a/drivers/vorbis/modes/setup_16.h
+++ b/thirdparty/libvorbis/modes/setup_16.h
diff --git a/drivers/vorbis/modes/setup_22.h b/thirdparty/libvorbis/modes/setup_22.h
index 4fd5e57111..4fd5e57111 100644
--- a/drivers/vorbis/modes/setup_22.h
+++ b/thirdparty/libvorbis/modes/setup_22.h
diff --git a/drivers/vorbis/modes/setup_32.h b/thirdparty/libvorbis/modes/setup_32.h
index 2275ac9615..2275ac9615 100644
--- a/drivers/vorbis/modes/setup_32.h
+++ b/thirdparty/libvorbis/modes/setup_32.h
diff --git a/drivers/vorbis/modes/setup_44.h b/thirdparty/libvorbis/modes/setup_44.h
index 3b88a89ac5..3b88a89ac5 100644
--- a/drivers/vorbis/modes/setup_44.h
+++ b/thirdparty/libvorbis/modes/setup_44.h
diff --git a/drivers/vorbis/modes/setup_44p51.h b/thirdparty/libvorbis/modes/setup_44p51.h
index 67d9979608..67d9979608 100644
--- a/drivers/vorbis/modes/setup_44p51.h
+++ b/thirdparty/libvorbis/modes/setup_44p51.h
diff --git a/drivers/vorbis/modes/setup_44u.h b/thirdparty/libvorbis/modes/setup_44u.h
index 568b5f8959..568b5f8959 100644
--- a/drivers/vorbis/modes/setup_44u.h
+++ b/thirdparty/libvorbis/modes/setup_44u.h
diff --git a/drivers/vorbis/modes/setup_8.h b/thirdparty/libvorbis/modes/setup_8.h
index 14c48374fa..14c48374fa 100644
--- a/drivers/vorbis/modes/setup_8.h
+++ b/thirdparty/libvorbis/modes/setup_8.h
diff --git a/drivers/vorbis/modes/setup_X.h b/thirdparty/libvorbis/modes/setup_X.h
index a69f5d40a2..a69f5d40a2 100644
--- a/drivers/vorbis/modes/setup_X.h
+++ b/thirdparty/libvorbis/modes/setup_X.h
diff --git a/drivers/vorbis/os.h b/thirdparty/libvorbis/os.h
index 8bc3e5fe9c..8bc3e5fe9c 100644
--- a/drivers/vorbis/os.h
+++ b/thirdparty/libvorbis/os.h
diff --git a/drivers/vorbis/psy.c b/thirdparty/libvorbis/psy.c
index f7a44c6d00..f7a44c6d00 100644
--- a/drivers/vorbis/psy.c
+++ b/thirdparty/libvorbis/psy.c
diff --git a/drivers/vorbis/psy.h b/thirdparty/libvorbis/psy.h
index c1ea824401..c1ea824401 100644
--- a/drivers/vorbis/psy.h
+++ b/thirdparty/libvorbis/psy.h
diff --git a/drivers/vorbis/psytune.c b/thirdparty/libvorbis/psytune.c
index 64c13171f7..64c13171f7 100644
--- a/drivers/vorbis/psytune.c
+++ b/thirdparty/libvorbis/psytune.c
diff --git a/drivers/vorbis/registry.c b/thirdparty/libvorbis/registry.c
index 3961ed1403..3961ed1403 100644
--- a/drivers/vorbis/registry.c
+++ b/thirdparty/libvorbis/registry.c
diff --git a/drivers/vorbis/registry.h b/thirdparty/libvorbis/registry.h
index 3ae04776d8..3ae04776d8 100644
--- a/drivers/vorbis/registry.h
+++ b/thirdparty/libvorbis/registry.h
diff --git a/drivers/vorbis/res0.c b/thirdparty/libvorbis/res0.c
index ec11488c2f..ec11488c2f 100644
--- a/drivers/vorbis/res0.c
+++ b/thirdparty/libvorbis/res0.c
diff --git a/drivers/vorbis/scales.h b/thirdparty/libvorbis/scales.h
index 613f796e77..613f796e77 100644
--- a/drivers/vorbis/scales.h
+++ b/thirdparty/libvorbis/scales.h
diff --git a/drivers/vorbis/sharedbook.c b/thirdparty/libvorbis/sharedbook.c
index 6bfdf7311e..6bfdf7311e 100644
--- a/drivers/vorbis/sharedbook.c
+++ b/thirdparty/libvorbis/sharedbook.c
diff --git a/drivers/vorbis/smallft.c b/thirdparty/libvorbis/smallft.c
index ae2bc41b6b..ae2bc41b6b 100644
--- a/drivers/vorbis/smallft.c
+++ b/thirdparty/libvorbis/smallft.c
diff --git a/drivers/vorbis/smallft.h b/thirdparty/libvorbis/smallft.h
index 456497326c..456497326c 100644
--- a/drivers/vorbis/smallft.h
+++ b/thirdparty/libvorbis/smallft.h
diff --git a/drivers/vorbis/synthesis.c b/thirdparty/libvorbis/synthesis.c
index 932d271a63..932d271a63 100644
--- a/drivers/vorbis/synthesis.c
+++ b/thirdparty/libvorbis/synthesis.c
diff --git a/drivers/vorbis/tone.c b/thirdparty/libvorbis/tone.c
index 73afc67d4c..73afc67d4c 100644
--- a/drivers/vorbis/tone.c
+++ b/thirdparty/libvorbis/tone.c
diff --git a/drivers/vorbis/codec.h b/thirdparty/libvorbis/vorbis/codec.h
index 999aa33510..999aa33510 100644
--- a/drivers/vorbis/codec.h
+++ b/thirdparty/libvorbis/vorbis/codec.h
diff --git a/drivers/vorbis/vorbisenc.h b/thirdparty/libvorbis/vorbis/vorbisenc.h
index 02332b50ca..02332b50ca 100644
--- a/drivers/vorbis/vorbisenc.h
+++ b/thirdparty/libvorbis/vorbis/vorbisenc.h
diff --git a/drivers/vorbis/vorbisfile.h b/thirdparty/libvorbis/vorbis/vorbisfile.h
index 9271331e72..9271331e72 100644
--- a/drivers/vorbis/vorbisfile.h
+++ b/thirdparty/libvorbis/vorbis/vorbisfile.h
diff --git a/drivers/vorbis/vorbisenc.c b/thirdparty/libvorbis/vorbisenc.c
index b5d621e900..b5d621e900 100644
--- a/drivers/vorbis/vorbisenc.c
+++ b/thirdparty/libvorbis/vorbisenc.c
diff --git a/drivers/vorbis/vorbisfile.c b/thirdparty/libvorbis/vorbisfile.c
index fc0c86ff11..fc0c86ff11 100644
--- a/drivers/vorbis/vorbisfile.c
+++ b/thirdparty/libvorbis/vorbisfile.c
diff --git a/drivers/vorbis/window.c b/thirdparty/libvorbis/window.c
index 0305b79297..0305b79297 100644
--- a/drivers/vorbis/window.c
+++ b/thirdparty/libvorbis/window.c
diff --git a/drivers/vorbis/window.h b/thirdparty/libvorbis/window.h
index 51f97599f5..51f97599f5 100644
--- a/drivers/vorbis/window.h
+++ b/thirdparty/libvorbis/window.h
diff --git a/drivers/opus/COPYING b/thirdparty/opus/COPYING
index 7b53d665df..7b53d665df 100644
--- a/drivers/opus/COPYING
+++ b/thirdparty/opus/COPYING
diff --git a/drivers/opus/analysis.c b/thirdparty/opus/analysis.c
index 6a0cd30113..360ebcc8dd 100644
--- a/drivers/opus/analysis.c
+++ b/thirdparty/opus/analysis.c
@@ -24,17 +24,20 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/celt/kiss_fft.h"
-#include "opus/celt/celt.h"
-#include "opus/celt/modes.h"
-#include "opus/celt/arch.h"
-#include "opus/celt/quant_bands.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "kiss_fft.h"
+#include "celt.h"
+#include "modes.h"
+#include "arch.h"
+#include "quant_bands.h"
#include <stdio.h>
-#include "opus/analysis.h"
-#include "opus/mlp.h"
-#include "opus/celt/stack_alloc.h"
+#include "analysis.h"
+#include "mlp.h"
+#include "stack_alloc.h"
#ifndef M_PI
#define M_PI 3.141592653
@@ -273,7 +276,7 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt
downmix(x, &tonal->inmem[240], remaining, offset+ANALYSIS_BUF_SIZE-tonal->mem_fill, c1, c2, C);
tonal->mem_fill = 240 + remaining;
opus_fft(kfft, in, out, tonal->arch);
-#ifndef OPUS_FIXED_POINT
+#ifndef FIXED_POINT
/* If there's any NaN on the input, the entire output will be NaN, so we only need to check one value. */
if (celt_isnan(out[0].r))
{
@@ -345,7 +348,7 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt
{
float binE = out[i].r*(float)out[i].r + out[N-i].r*(float)out[N-i].r
+ out[i].i*(float)out[i].i + out[N-i].i*(float)out[N-i].i;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
/* FIXME: It's probably best to change the BFCC filter initial state instead */
binE *= 5.55e-17f;
#endif
@@ -353,7 +356,7 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt
tE += binE*tonality[i];
nE += binE*2.f*(.5f-noisiness[i]);
}
-#ifndef OPUS_FIXED_POINT
+#ifndef FIXED_POINT
/* Check for extreme band energies that could cause NaNs later. */
if (!(E<1e9f) || celt_isnan(E))
{
@@ -411,7 +414,7 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt
bandwidth = 0;
maxE = 0;
noise_floor = 5.7e-4f/(1<<(IMAX(0,lsb_depth-8)));
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
noise_floor *= 1<<(15+SIG_SHIFT);
#endif
noise_floor *= noise_floor;
diff --git a/drivers/opus/analysis.h b/thirdparty/opus/analysis.h
index 9d81164e25..9eae56a525 100644
--- a/drivers/opus/analysis.h
+++ b/thirdparty/opus/analysis.h
@@ -28,8 +28,8 @@
#ifndef ANALYSIS_H
#define ANALYSIS_H
-#include "opus/celt/celt.h"
-#include "opus/opus_private.h"
+#include "celt.h"
+#include "opus_private.h"
#define NB_FRAMES 8
#define NB_TBANDS 18
diff --git a/drivers/opus/celt/_kiss_fft_guts.h b/thirdparty/opus/celt/_kiss_fft_guts.h
index a41f9a1a05..5e3d58fd66 100644
--- a/drivers/opus/celt/_kiss_fft_guts.h
+++ b/thirdparty/opus/celt/_kiss_fft_guts.h
@@ -33,7 +33,7 @@
defines kiss_fft_scalar as either short or a float type
and defines
typedef struct { kiss_fft_scalar r; kiss_fft_scalar i; }kiss_fft_cpx; */
-#include "opus/celt/kiss_fft.h"
+#include "kiss_fft.h"
/*
Explanation of macros dealing with complex math:
@@ -44,8 +44,8 @@
C_SUBFROM( res , a) : res -= a
C_ADDTO( res , a) : res += a
* */
-#ifdef OPUS_FIXED_POINT
-#include "opus/celt/arch.h"
+#ifdef FIXED_POINT
+#include "arch.h"
#define SAMP_MAX 2147483647
@@ -91,14 +91,14 @@
}while(0)
#if defined(OPUS_ARM_INLINE_ASM)
-#include "opus/celt/arm/kiss_fft_armv4.h"
+#include "arm/kiss_fft_armv4.h"
#endif
#if defined(OPUS_ARM_INLINE_EDSP)
-#include "opus/celt/arm/kiss_fft_armv5e.h"
+#include "arm/kiss_fft_armv5e.h"
#endif
#if defined(MIPSr1_ASM)
-#include "opus/celt/mips/kiss_fft_mipsr1.h"
+#include "mips/kiss_fft_mipsr1.h"
#endif
#else /* not FIXED_POINT*/
@@ -151,7 +151,7 @@
}while(0)
#endif /* C_ADD defined */
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
/*# define KISS_FFT_COS(phase) TRIG_UPSCALE*floor(MIN(32767,MAX(-32767,.5+32768 * cos (phase))))
# define KISS_FFT_SIN(phase) TRIG_UPSCALE*floor(MIN(32767,MAX(-32767,.5+32768 * sin (phase))))*/
# define KISS_FFT_COS(phase) floor(.5+TWID_MAX*cos (phase))
diff --git a/drivers/opus/celt/arch.h b/thirdparty/opus/celt/arch.h
index 7fb036e9fe..9f74ddd267 100644
--- a/drivers/opus/celt/arch.h
+++ b/thirdparty/opus/celt/arch.h
@@ -34,8 +34,8 @@
#ifndef ARCH_H
#define ARCH_H
-#include "opus/opus_types.h"
-#include "opus/opus_defines.h"
+#include "opus_types.h"
+#include "opus_defines.h"
# if !defined(__GNUC_PREREQ)
# if defined(__GNUC__)&&defined(__GNUC_MINOR__)
@@ -80,7 +80,7 @@ static OPUS_INLINE void _celt_fatal(const char *str, const char *file, int line)
#define PRINT_MIPS(file)
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
typedef opus_int16 opus_val16;
typedef opus_int32 opus_val32;
@@ -113,15 +113,15 @@ static OPUS_INLINE opus_int16 SAT16(opus_int32 x) {
}
#ifdef FIXED_DEBUG
-#include "opus/celt/fixed_debug.h"
+#include "fixed_debug.h"
#else
-#include "opus/celt/fixed_generic.h"
+#include "fixed_generic.h"
#ifdef OPUS_ARM_INLINE_EDSP
-#include "opus/celt/arm/fixed_armv5e.h"
+#include "arm/fixed_armv5e.h"
#elif defined (OPUS_ARM_INLINE_ASM)
-#include "opus/celt/arm/fixed_armv4.h"
+#include "arm/fixed_armv4.h"
#elif defined (BFIN_ASM)
#include "fixed_bfin.h"
#elif defined (TI_C5X_ASM)
@@ -231,7 +231,7 @@ static OPUS_INLINE int celt_isnan(float x)
#endif /* !FIXED_POINT */
#ifndef GLOBAL_STACK_SIZE
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
#define GLOBAL_STACK_SIZE 100000
#else
#define GLOBAL_STACK_SIZE 100000
diff --git a/drivers/opus/celt/arm/arm2gnu.pl b/thirdparty/opus/celt/arm/arm2gnu.pl
index 6c922ac819..6c922ac819 100755
--- a/drivers/opus/celt/arm/arm2gnu.pl
+++ b/thirdparty/opus/celt/arm/arm2gnu.pl
diff --git a/drivers/opus/celt/arm/arm_celt_map.c b/thirdparty/opus/celt/arm/arm_celt_map.c
index 92c83c1763..ee6c244786 100644
--- a/drivers/opus/celt/arm/arm_celt_map.c
+++ b/thirdparty/opus/celt/arm/arm_celt_map.c
@@ -24,11 +24,14 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/celt/pitch.h"
-#include "opus/celt/kiss_fft.h"
-#include "opus/celt/mdct.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "pitch.h"
+#include "kiss_fft.h"
+#include "mdct.h"
#if defined(OPUS_HAVE_RTCD)
diff --git a/drivers/opus/celt/arm/armcpu.c b/thirdparty/opus/celt/arm/armcpu.c
index ac8ad2ec14..5e5d10c344 100644
--- a/drivers/opus/celt/arm/armcpu.c
+++ b/thirdparty/opus/celt/arm/armcpu.c
@@ -26,14 +26,17 @@
*/
/* Original code from libtheora modified to suit to Opus */
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#ifdef OPUS_HAVE_RTCD
-#include "opus/celt/arm/armcpu.h"
-#include "opus/celt/cpu_support.h"
-#include "opus/celt/os_support.h"
-#include "opus/opus_types.h"
+#include "armcpu.h"
+#include "cpu_support.h"
+#include "os_support.h"
+#include "opus_types.h"
#define OPUS_CPU_ARM_V4 (1)
#define OPUS_CPU_ARM_EDSP (1<<1)
diff --git a/drivers/opus/celt/arm/armcpu.h b/thirdparty/opus/celt/arm/armcpu.h
index ac5744606e..ac5744606e 100644
--- a/drivers/opus/celt/arm/armcpu.h
+++ b/thirdparty/opus/celt/arm/armcpu.h
diff --git a/drivers/opus/celt/arm/armopts.s.in b/thirdparty/opus/celt/arm/armopts.s.in
index 3d8aaf2754..3d8aaf2754 100644
--- a/drivers/opus/celt/arm/armopts.s.in
+++ b/thirdparty/opus/celt/arm/armopts.s.in
diff --git a/drivers/opus/celt/arm/celt_ne10_fft.c b/thirdparty/opus/celt/arm/celt_ne10_fft.c
index e57d23ee1d..42d96a7117 100644
--- a/drivers/opus/celt/arm/celt_ne10_fft.c
+++ b/thirdparty/opus/celt/arm/celt_ne10_fft.c
@@ -31,14 +31,16 @@
*/
#ifndef SKIP_CONFIG_H
-#include "opus/opus_config.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#endif
#include <NE10_init.h>
#include <NE10_dsp.h>
-#include "opus/celt/os_support.h"
-#include "opus/celt/kiss_fft.h"
-#include "opus/celt/stack_alloc.h"
+#include "os_support.h"
+#include "kiss_fft.h"
+#include "stack_alloc.h"
#if !defined(FIXED_POINT)
# define NE10_FFT_ALLOC_C2C_TYPE_NEON ne10_fft_alloc_c2c_float32_neon
diff --git a/drivers/opus/celt/arm/celt_ne10_mdct.c b/thirdparty/opus/celt/arm/celt_ne10_mdct.c
index eb407b674f..293c3efd7a 100644
--- a/drivers/opus/celt/arm/celt_ne10_mdct.c
+++ b/thirdparty/opus/celt/arm/celt_ne10_mdct.c
@@ -31,13 +31,15 @@
*/
#ifndef SKIP_CONFIG_H
-#include "opus/opus_config.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#endif
-#include "opus/celt/kiss_fft.h"
-#include "opus/celt/_kiss_fft_guts.h"
-#include "opus/celt/mdct.h"
-#include "opus/celt/stack_alloc.h"
+#include "kiss_fft.h"
+#include "_kiss_fft_guts.h"
+#include "mdct.h"
+#include "stack_alloc.h"
void clt_mdct_forward_neon(const mdct_lookup *l,
kiss_fft_scalar *in,
diff --git a/drivers/opus/celt/arm/celt_neon_intr.c b/thirdparty/opus/celt/arm/celt_neon_intr.c
index 82b6958644..47dce15ba5 100644
--- a/drivers/opus/celt/arm/celt_neon_intr.c
+++ b/thirdparty/opus/celt/arm/celt_neon_intr.c
@@ -29,10 +29,13 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <arm_neon.h>
-#include "opus/celt/pitch.h"
+#include "../pitch.h"
#if !defined(FIXED_POINT)
/*
diff --git a/drivers/opus/celt/arm/celt_pitch_xcorr_arm-gnu.S b/thirdparty/opus/celt/arm/celt_pitch_xcorr_arm-gnu.S
index 5b2ee55a10..5b2ee55a10 100644
--- a/drivers/opus/celt/arm/celt_pitch_xcorr_arm-gnu.S
+++ b/thirdparty/opus/celt/arm/celt_pitch_xcorr_arm-gnu.S
diff --git a/drivers/opus/celt/arm/celt_pitch_xcorr_arm.s b/thirdparty/opus/celt/arm/celt_pitch_xcorr_arm.s
index f96e0a88bb..f96e0a88bb 100644
--- a/drivers/opus/celt/arm/celt_pitch_xcorr_arm.s
+++ b/thirdparty/opus/celt/arm/celt_pitch_xcorr_arm.s
diff --git a/drivers/opus/celt/arm/fft_arm.h b/thirdparty/opus/celt/arm/fft_arm.h
index c99458b4af..0cb55d8e22 100644
--- a/drivers/opus/celt/arm/fft_arm.h
+++ b/thirdparty/opus/celt/arm/fft_arm.h
@@ -34,8 +34,8 @@
#if !defined(FFT_ARM_H)
#define FFT_ARM_H
-#include "opus/opus_config.h"
-#include "opus/celt/kiss_fft.h"
+#include "config.h"
+#include "kiss_fft.h"
#if defined(HAVE_ARM_NE10)
diff --git a/thirdparty/opus/celt/arm/fixed_arm64.h b/thirdparty/opus/celt/arm/fixed_arm64.h
new file mode 100644
index 0000000000..c6fbd3db2c
--- /dev/null
+++ b/thirdparty/opus/celt/arm/fixed_arm64.h
@@ -0,0 +1,35 @@
+/* Copyright (C) 2015 Vidyo */
+/*
+ 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.
+
+ 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 COPYRIGHT OWNER
+ 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.
+*/
+
+#ifndef FIXED_ARM64_H
+#define FIXED_ARM64_H
+
+#include <arm_neon.h>
+
+#undef SIG2WORD16
+#define SIG2WORD16(x) (vqmovns_s32(PSHR32((x), SIG_SHIFT)))
+
+#endif
diff --git a/drivers/opus/celt/arm/fixed_armv4.h b/thirdparty/opus/celt/arm/fixed_armv4.h
index efb3b1896a..efb3b1896a 100644
--- a/drivers/opus/celt/arm/fixed_armv4.h
+++ b/thirdparty/opus/celt/arm/fixed_armv4.h
diff --git a/drivers/opus/celt/arm/fixed_armv5e.h b/thirdparty/opus/celt/arm/fixed_armv5e.h
index 2db23262e8..36a6321101 100644
--- a/drivers/opus/celt/arm/fixed_armv5e.h
+++ b/thirdparty/opus/celt/arm/fixed_armv5e.h
@@ -30,7 +30,7 @@
#ifndef FIXED_ARMv5E_H
#define FIXED_ARMv5E_H
-#include "opus/celt/arm/fixed_armv4.h"
+#include "fixed_armv4.h"
/** 16x32 multiplication, followed by a 16-bit shift right. Results fits in 32 bits */
#undef MULT16_32_Q16
diff --git a/drivers/opus/celt/arm/kiss_fft_armv4.h b/thirdparty/opus/celt/arm/kiss_fft_armv4.h
index 0f5617324d..e4faad6f2b 100644
--- a/drivers/opus/celt/arm/kiss_fft_armv4.h
+++ b/thirdparty/opus/celt/arm/kiss_fft_armv4.h
@@ -30,7 +30,7 @@
#error "This file should only be included from _kiss_fft_guts.h"
#endif
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
#undef C_MUL
#define C_MUL(m,a,b) \
diff --git a/drivers/opus/celt/arm/kiss_fft_armv5e.h b/thirdparty/opus/celt/arm/kiss_fft_armv5e.h
index 0ab75fbc58..9eca183d77 100644
--- a/drivers/opus/celt/arm/kiss_fft_armv5e.h
+++ b/thirdparty/opus/celt/arm/kiss_fft_armv5e.h
@@ -30,7 +30,7 @@
#error "This file should only be included from _kiss_fft_guts.h"
#endif
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
#if defined(__thumb__)||defined(__thumb2__)
#define LDRD_CONS "Q"
diff --git a/drivers/opus/celt/arm/mdct_arm.h b/thirdparty/opus/celt/arm/mdct_arm.h
index faf3c8acab..49cbb44576 100644
--- a/drivers/opus/celt/arm/mdct_arm.h
+++ b/thirdparty/opus/celt/arm/mdct_arm.h
@@ -33,8 +33,8 @@
#if !defined(MDCT_ARM_H)
#define MDCT_ARM_H
-#include "opus/opus_config.h"
-#include "opus/celt/mdct.h"
+#include "config.h"
+#include "mdct.h"
#if defined(HAVE_ARM_NE10)
/** Compute a forward MDCT and scale by 4/N, trashes the input array */
diff --git a/drivers/opus/celt/arm/pitch_arm.h b/thirdparty/opus/celt/arm/pitch_arm.h
index 996fbc7fd9..8626ed75b9 100644
--- a/drivers/opus/celt/arm/pitch_arm.h
+++ b/thirdparty/opus/celt/arm/pitch_arm.h
@@ -28,7 +28,7 @@
#if !defined(PITCH_ARM_H)
# define PITCH_ARM_H
-# include "opus/celt/arm/armcpu.h"
+# include "armcpu.h"
# if defined(FIXED_POINT)
diff --git a/drivers/opus/celt/bands.c b/thirdparty/opus/celt/bands.c
index bdd87dd327..25f229e267 100644
--- a/drivers/opus/celt/bands.c
+++ b/thirdparty/opus/celt/bands.c
@@ -26,19 +26,22 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <math.h>
-#include "opus/celt/bands.h"
-#include "opus/celt/modes.h"
-#include "opus/celt/vq.h"
-#include "opus/celt/cwrs.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/celt/os_support.h"
-#include "opus/celt/mathops.h"
-#include "opus/celt/rate.h"
-#include "opus/celt/quant_bands.h"
-#include "opus/celt/pitch.h"
+#include "bands.h"
+#include "modes.h"
+#include "vq.h"
+#include "cwrs.h"
+#include "stack_alloc.h"
+#include "os_support.h"
+#include "mathops.h"
+#include "rate.h"
+#include "quant_bands.h"
+#include "pitch.h"
int hysteresis_decision(opus_val16 val, const opus_val16 *thresholds, const opus_val16 *hysteresis, int N, int prev)
{
@@ -87,7 +90,7 @@ static int bitexact_log2tan(int isin,int icos)
-FRAC_MUL16(icos, FRAC_MUL16(icos, -2597) + 7932);
}
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
/* Compute the amplitude (sqrt energy) in each of the bands */
void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int LM)
{
@@ -216,13 +219,13 @@ void denormalise_bands(const CELTMode *m, const celt_norm * OPUS_RESTRICT X,
int j, band_end;
opus_val16 g;
opus_val16 lg;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
int shift;
#endif
j=M*eBands[i];
band_end = M*eBands[i+1];
lg = ADD16(bandLogE[i], SHL16((opus_val16)eMeans[i],6));
-#ifndef OPUS_FIXED_POINT
+#ifndef FIXED_POINT
g = celt_exp2(lg);
#else
/* Handle the integer part of the log energy */
@@ -271,7 +274,7 @@ void anti_collapse(const CELTMode *m, celt_norm *X_, unsigned char *collapse_mas
int N0;
opus_val16 thresh, sqrt_1;
int depth;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
int shift;
opus_val32 thresh32;
#endif
@@ -281,7 +284,7 @@ void anti_collapse(const CELTMode *m, celt_norm *X_, unsigned char *collapse_mas
celt_assert(pulses[i]>=0);
depth = celt_udiv(1+pulses[i], (m->eBands[i+1]-m->eBands[i]))>>LM;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
thresh32 = SHR32(celt_exp2(-SHL16(depth, 10-BITRES)),1);
thresh = MULT16_32_Q15(QCONST16(0.5f, 15), MIN32(32767,thresh32));
{
@@ -314,7 +317,7 @@ void anti_collapse(const CELTMode *m, celt_norm *X_, unsigned char *collapse_mas
Ediff = EXTEND32(logE[c*m->nbEBands+i])-EXTEND32(MIN16(prev1,prev2));
Ediff = MAX32(0, Ediff);
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
if (Ediff < 16384)
{
opus_val32 r32 = SHR32(celt_exp2(-EXTRACT16(Ediff)),1);
@@ -364,7 +367,7 @@ static void intensity_stereo(const CELTMode *m, celt_norm * OPUS_RESTRICT X, con
opus_val16 a1, a2;
opus_val16 left, right;
opus_val16 norm;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
int shift = celt_zlog2(MAX32(bandE[i], bandE[i+m->nbEBands]))-13;
#endif
left = VSHR32(bandE[i],shift);
@@ -401,7 +404,7 @@ static void stereo_merge(celt_norm * OPUS_RESTRICT X, celt_norm * OPUS_RESTRICT
opus_val32 xp=0, side=0;
opus_val32 El, Er;
opus_val16 mid2;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
int kl, kr;
#endif
opus_val32 t, lgain, rgain;
@@ -420,7 +423,7 @@ static void stereo_merge(celt_norm * OPUS_RESTRICT X, celt_norm * OPUS_RESTRICT
return;
}
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
kl = celt_ilog2(El)>>1;
kr = celt_ilog2(Er)>>1;
#endif
@@ -429,7 +432,7 @@ static void stereo_merge(celt_norm * OPUS_RESTRICT X, celt_norm * OPUS_RESTRICT
t = VSHR32(Er, (kr-7)<<1);
rgain = celt_rsqrt_norm(t);
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
if (kl < 7)
kl = 7;
if (kr < 7)
@@ -939,7 +942,7 @@ static unsigned quant_partition(struct band_ctx *ctx, celt_norm *X,
delta = sctx.delta;
itheta = sctx.itheta;
qalloc = sctx.qalloc;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
mid = imid;
side = iside;
#else
@@ -1237,7 +1240,7 @@ static unsigned quant_band_stereo(struct band_ctx *ctx, celt_norm *X, celt_norm
delta = sctx.delta;
itheta = sctx.itheta;
qalloc = sctx.qalloc;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
mid = imid;
side = iside;
#else
diff --git a/drivers/opus/celt/bands.h b/thirdparty/opus/celt/bands.h
index eb7ea4cc24..e8bef4bad0 100644
--- a/drivers/opus/celt/bands.h
+++ b/thirdparty/opus/celt/bands.h
@@ -30,11 +30,11 @@
#ifndef BANDS_H
#define BANDS_H
-#include "opus/celt/arch.h"
-#include "opus/celt/modes.h"
-#include "opus/celt/entenc.h"
-#include "opus/celt/entdec.h"
-#include "opus/celt/rate.h"
+#include "arch.h"
+#include "modes.h"
+#include "entenc.h"
+#include "entdec.h"
+#include "rate.h"
/** Compute the amplitude (sqrt energy) in each of the bands
* @param m Mode data
diff --git a/drivers/opus/celt/celt.c b/thirdparty/opus/celt/celt.c
index 4a16651441..b121c51a1f 100644
--- a/drivers/opus/celt/celt.c
+++ b/thirdparty/opus/celt/celt.c
@@ -26,33 +26,36 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#define CELT_C
-#include "opus/celt/os_support.h"
-#include "opus/celt/mdct.h"
+#include "os_support.h"
+#include "mdct.h"
#include <math.h>
-#include "opus/celt/celt.h"
-#include "opus/celt/pitch.h"
-#include "opus/celt/bands.h"
-#include "opus/celt/modes.h"
-#include "opus/celt/entcode.h"
-#include "opus/celt/quant_bands.h"
-#include "opus/celt/rate.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/celt/mathops.h"
-#include "opus/celt/float_cast.h"
+#include "celt.h"
+#include "pitch.h"
+#include "bands.h"
+#include "modes.h"
+#include "entcode.h"
+#include "quant_bands.h"
+#include "rate.h"
+#include "stack_alloc.h"
+#include "mathops.h"
+#include "float_cast.h"
#include <stdarg.h>
-#include "opus/celt/celt_lpc.h"
-#include "opus/celt/vq.h"
+#include "celt_lpc.h"
+#include "vq.h"
#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION "unknown"
#endif
#if defined(MIPSr1_ASM)
-#include "opus/celt/mips/celt_mipsr1.h"
+#include "mips/celt_mipsr1.h"
#endif
@@ -286,7 +289,7 @@ const char *opus_get_version_string(void)
/* Applications may rely on the presence of this substring in the version
string to determine if they have a fixed-point or floating-point build
at runtime. */
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
"-fixed"
#endif
#ifdef FUZZING
diff --git a/drivers/opus/celt/celt.h b/thirdparty/opus/celt/celt.h
index 72814dc0de..a423b95046 100644
--- a/drivers/opus/celt/celt.h
+++ b/thirdparty/opus/celt/celt.h
@@ -35,12 +35,12 @@
#ifndef CELT_H
#define CELT_H
-#include "opus/opus_types.h"
-#include "opus/opus_defines.h"
-#include "opus/opus_custom.h"
-#include "opus/celt/entenc.h"
-#include "opus/celt/entdec.h"
-#include "opus/celt/arch.h"
+#include "opus_types.h"
+#include "opus_defines.h"
+#include "opus_custom.h"
+#include "entenc.h"
+#include "entdec.h"
+#include "arch.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/opus/celt/celt_decoder.c b/thirdparty/opus/celt/celt_decoder.c
index 88072ed110..b688f2a4e3 100644
--- a/drivers/opus/celt/celt_decoder.c
+++ b/thirdparty/opus/celt/celt_decoder.c
@@ -26,27 +26,30 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#define CELT_DECODER_C
-#include "opus/celt/cpu_support.h"
-#include "opus/celt/os_support.h"
-#include "opus/celt/mdct.h"
+#include "cpu_support.h"
+#include "os_support.h"
+#include "mdct.h"
#include <math.h>
-#include "opus/celt/celt.h"
-#include "opus/celt/pitch.h"
-#include "opus/celt/bands.h"
-#include "opus/celt/modes.h"
-#include "opus/celt/entcode.h"
-#include "opus/celt/quant_bands.h"
-#include "opus/celt/rate.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/celt/mathops.h"
-#include "opus/celt/float_cast.h"
+#include "celt.h"
+#include "pitch.h"
+#include "bands.h"
+#include "modes.h"
+#include "entcode.h"
+#include "quant_bands.h"
+#include "rate.h"
+#include "stack_alloc.h"
+#include "mathops.h"
+#include "float_cast.h"
#include <stdarg.h>
-#include "opus/celt/celt_lpc.h"
-#include "opus/celt/vq.h"
+#include "celt_lpc.h"
+#include "vq.h"
#if defined(SMALL_FOOTPRINT) && defined(FIXED_POINT)
#define NORM_ALIASING_HACK
@@ -188,7 +191,7 @@ void deemphasis(celt_sig *in[], opus_val16 *pcm, int N, int C, int downsample, c
opus_val16 coef0;
VARDECL(celt_sig, scratch);
SAVE_STACK;
-#ifndef OPUS_FIXED_POINT
+#ifndef FIXED_POINT
(void)accum;
celt_assert(accum==0);
#endif
@@ -230,7 +233,7 @@ void deemphasis(celt_sig *in[], opus_val16 *pcm, int N, int C, int downsample, c
apply_downsampling=1;
} else {
/* Shortcut for the standard (non-custom modes) case */
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
if (accum)
{
for (j=0;j<N;j++)
@@ -255,7 +258,7 @@ void deemphasis(celt_sig *in[], opus_val16 *pcm, int N, int C, int downsample, c
if (apply_downsampling)
{
/* Perform down-sampling */
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
if (accum)
{
for (j=0;j<Nd;j++)
@@ -543,7 +546,7 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, int N, int LM)
_celt_autocorr(exc, ac, window, overlap,
LPC_ORDER, MAX_PERIOD, st->arch);
/* Add a noise floor of -40 dB. */
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
ac[0] += SHR32(ac[0],13);
#else
ac[0] *= 1.0001f;
@@ -552,7 +555,7 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, int N, int LM)
for (i=1;i<=LPC_ORDER;i++)
{
/*ac[i] *= exp(-.5*(2*M_PI*.002*i)*(2*M_PI*.002*i));*/
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
ac[i] -= MULT16_32_Q15(2*i*i, ac[i]);
#else
ac[i] -= ac[i]*(0.008f*0.008f)*i*i;
@@ -583,7 +586,7 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, int N, int LM)
{
opus_val32 E1=1, E2=1;
int decay_length;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
int shift = IMAX(0,2*celt_zlog2(celt_maxabs16(&exc[MAX_PERIOD-exc_length], exc_length))-20);
#endif
decay_length = exc_length>>1;
@@ -655,7 +658,7 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, int N, int LM)
S2 += SHR32(MULT16_16(tmp, tmp), 8);
}
/* This checks for an "explosion" in the synthesis. */
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
if (!(S1 > SHR32(S2,2)))
#else
/* The float test is written this way to catch NaNs in the output
@@ -1071,7 +1074,7 @@ int celt_decode_with_ec(CELTDecoder * OPUS_RESTRICT st, const unsigned char *dat
#ifdef CUSTOM_MODES
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
int opus_custom_decode(CELTDecoder * OPUS_RESTRICT st, const unsigned char *data, int len, opus_int16 * OPUS_RESTRICT pcm, int frame_size)
{
return celt_decode_with_ec(st, data, len, pcm, frame_size, NULL, 0);
diff --git a/drivers/opus/celt/celt_encoder.c b/thirdparty/opus/celt/celt_encoder.c
index 9099bcd278..41fbfd49c8 100644
--- a/drivers/opus/celt/celt_encoder.c
+++ b/thirdparty/opus/celt/celt_encoder.c
@@ -26,27 +26,30 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#define CELT_ENCODER_C
-#include "opus/celt/cpu_support.h"
-#include "opus/celt/os_support.h"
-#include "opus/celt/mdct.h"
+#include "cpu_support.h"
+#include "os_support.h"
+#include "mdct.h"
#include <math.h>
-#include "opus/celt/celt.h"
-#include "opus/celt/pitch.h"
-#include "opus/celt/bands.h"
-#include "opus/celt/modes.h"
-#include "opus/celt/entcode.h"
-#include "opus/celt/quant_bands.h"
-#include "opus/celt/rate.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/celt/mathops.h"
-#include "opus/celt/float_cast.h"
+#include "celt.h"
+#include "pitch.h"
+#include "bands.h"
+#include "modes.h"
+#include "entcode.h"
+#include "quant_bands.h"
+#include "rate.h"
+#include "stack_alloc.h"
+#include "mathops.h"
+#include "float_cast.h"
#include <stdarg.h>
-#include "opus/celt/celt_lpc.h"
-#include "opus/celt/vq.h"
+#include "celt_lpc.h"
+#include "vq.h"
/** Encoder state
@@ -259,7 +262,7 @@ static int transient_analysis(const opus_val32 * OPUS_RESTRICT in, int len, int
opus_val32 x,y;
x = SHR32(in[i+c*len],SIG_SHIFT);
y = ADD32(mem0, x);
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
mem0 = mem1 + y - SHL32(x,1);
mem1 = x - SHR32(y,1);
#else
@@ -273,7 +276,7 @@ static int transient_analysis(const opus_val32 * OPUS_RESTRICT in, int len, int
/* First few samples are bad because we don't propagate the memory */
OPUS_CLEAR(tmp, 12);
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
/* Normalize tmp to max range */
{
int shift=0;
@@ -294,7 +297,7 @@ static int transient_analysis(const opus_val32 * OPUS_RESTRICT in, int len, int
{
opus_val16 x2 = PSHR32(MULT16_16(tmp[2*i],tmp[2*i]) + MULT16_16(tmp[2*i+1],tmp[2*i+1]),16);
mean += x2;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
/* FIXME: Use PSHR16() instead */
tmp[i] = mem0 + PSHR32(x2-mem0,4);
#else
@@ -308,7 +311,7 @@ static int transient_analysis(const opus_val32 * OPUS_RESTRICT in, int len, int
/* Backward pass to compute the pre-echo threshold */
for (i=len2-1;i>=0;i--)
{
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
/* FIXME: Use PSHR16() instead */
tmp[i] = mem0 + PSHR32(tmp[i]-mem0,3);
#else
@@ -325,7 +328,7 @@ static int transient_analysis(const opus_val32 * OPUS_RESTRICT in, int len, int
/* As a compromise with the old transient detector, frame energy is the
geometric mean of the energy and half the max */
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
/* Costs two sqrt() to avoid overflows */
mean = MULT16_16(celt_sqrt(mean), celt_sqrt(MULT16_16(maxE,len2>>1)));
#else
@@ -339,7 +342,7 @@ static int transient_analysis(const opus_val32 * OPUS_RESTRICT in, int len, int
for (i=12;i<len2-5;i+=4)
{
int id;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
id = MAX32(0,MIN32(127,MULT16_32_Q15(tmp[i]+EPSILON,norm))); /* Do not round to nearest */
#else
id = (int)MAX32(0,MIN32(127,floor(64*norm*(tmp[i]+EPSILON)))); /* Do not round to nearest */
@@ -490,7 +493,7 @@ void celt_preemphasis(const opus_val16 * OPUS_RESTRICT pcmp, celt_sig * OPUS_RES
for (i=0;i<Nu;i++)
inp[i*upsample] = SCALEIN(pcmp[CC*i]);
-#ifndef OPUS_FIXED_POINT
+#ifndef FIXED_POINT
if (clip)
{
/* Clip input to avoid encoding non-portable files */
@@ -787,7 +790,7 @@ static int alloc_trim_analysis(const CELTMode *m, const celt_norm *X,
logXC = celt_log2(QCONST32(1.001f, 20)-MULT16_16(sum, sum));
/* mid-side savings estimations based on min correlation */
logXC2 = MAX16(HALF16(logXC), celt_log2(QCONST32(1.001f, 20)-MULT16_16(minXC, minXC)));
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
/* Compensate for Q20 vs Q14 input and convert output to Q8 */
logXC = PSHR32(logXC-QCONST16(6.f, DB_SHIFT),DB_SHIFT-8);
logXC2 = PSHR32(logXC2-QCONST16(6.f, DB_SHIFT),DB_SHIFT-8);
@@ -819,7 +822,7 @@ static int alloc_trim_analysis(const CELTMode *m, const celt_norm *X,
(void)analysis;
#endif
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
trim_index = PSHR32(trim, 8);
#else
trim_index = (int)floor(.5f+trim);
@@ -1145,7 +1148,7 @@ static int run_prefilter(CELTEncoder *st, celt_sig *in, celt_sig *prefilter_mem,
if (ABS16(gain1-st->prefilter_gain)<QCONST16(.1f,15))
gain1=st->prefilter_gain;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
qg = ((gain1+1536)>>10)/3-1;
#else
qg = (int)floor(.5f+gain1*32/3)-1;
@@ -1279,7 +1282,7 @@ static int compute_vbr(const CELTMode *mode, AnalysisInfo *analysis, opus_int32
if ((!has_surround_mask||lfe) && (constrained_vbr || bitrate<64000))
{
opus_val16 rate_factor;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
rate_factor = MAX16(0,(bitrate-32000));
#else
rate_factor = MAX16(0,(1.f/32768)*(bitrate-32000));
@@ -1509,7 +1512,7 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm,
sample_max=MAX32(st->overlap_max, celt_maxabs16(pcm, C*(N-overlap)/st->upsample));
st->overlap_max=celt_maxabs16(pcm+C*(N-overlap)/st->upsample, C*overlap/st->upsample);
sample_max=MAX32(sample_max, st->overlap_max);
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
silence = (sample_max==0);
#else
silence = (sample_max <= (opus_val16)1/(1<<st->lsb_depth));
@@ -1539,7 +1542,7 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm,
}
c=0; do {
int need_clip=0;
-#ifndef OPUS_FIXED_POINT
+#ifndef FIXED_POINT
need_clip = st->clip && sample_max>65536.f;
#endif
celt_preemphasis(pcm+c, in+c*(N+overlap)+overlap, N, CC, st->upsample,
@@ -2156,7 +2159,7 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm,
#ifdef CUSTOM_MODES
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
int opus_custom_encode(CELTEncoder * OPUS_RESTRICT st, const opus_int16 * pcm, int frame_size, unsigned char *compressed, int nbCompressedBytes)
{
return celt_encode_with_ec(st, pcm, frame_size, compressed, nbCompressedBytes, NULL);
diff --git a/drivers/opus/celt/celt_lpc.c b/thirdparty/opus/celt/celt_lpc.c
index 5b8c01021f..f02145af0d 100644
--- a/drivers/opus/celt/celt_lpc.c
+++ b/thirdparty/opus/celt/celt_lpc.c
@@ -24,12 +24,15 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/celt/celt_lpc.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/celt/mathops.h"
-#include "opus/celt/pitch.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "celt_lpc.h"
+#include "stack_alloc.h"
+#include "mathops.h"
+#include "pitch.h"
void _celt_lpc(
opus_val16 *_lpc, /* out: [0...p-1] LPC coefficients */
@@ -40,7 +43,7 @@ int p
int i, j;
opus_val32 r;
opus_val32 error = ac[0];
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
opus_val32 lpc[LPC_ORDER];
#else
float *lpc = _lpc;
@@ -70,7 +73,7 @@ int p
error = error - MULT32_32_Q31(MULT32_32_Q31(r,r),error);
/* Bail out once we get 30 dB gain */
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
if (error<SHR32(ac[0],10))
break;
#else
@@ -79,7 +82,7 @@ int p
#endif
}
}
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
for (i=0;i<p;i++)
_lpc[i] = ROUND16(lpc[i],16);
#endif
@@ -257,7 +260,7 @@ int _celt_autocorr(
xptr = xx;
}
shift=0;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
{
opus_val32 ac0;
ac0 = 1+(n<<7);
@@ -286,7 +289,7 @@ int _celt_autocorr(
d = MAC16_16(d, xptr[i], xptr[i-k]);
ac[k] += d;
}
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
shift = 2*shift;
if (shift<=0)
ac[0] += SHL32((opus_int32)1, -shift);
diff --git a/drivers/opus/celt/celt_lpc.h b/thirdparty/opus/celt/celt_lpc.h
index dc0352d468..323459eb1a 100644
--- a/drivers/opus/celt/celt_lpc.h
+++ b/thirdparty/opus/celt/celt_lpc.h
@@ -28,11 +28,11 @@
#ifndef PLC_H
#define PLC_H
-#include "opus/celt/arch.h"
-#include "opus/celt/cpu_support.h"
+#include "arch.h"
+#include "cpu_support.h"
#if defined(OPUS_X86_MAY_HAVE_SSE4_1)
-#include "opus/celt/x86/celt_lpc_sse.h"
+#include "x86/celt_lpc_sse.h"
#endif
#define LPC_ORDER 24
diff --git a/drivers/opus/celt/cpu_support.h b/thirdparty/opus/celt/cpu_support.h
index 2507e1861e..68fc60678f 100644
--- a/drivers/opus/celt/cpu_support.h
+++ b/thirdparty/opus/celt/cpu_support.h
@@ -28,12 +28,12 @@
#ifndef CPU_SUPPORT_H
#define CPU_SUPPORT_H
-#include "opus/opus_types.h"
-#include "opus/opus_defines.h"
+#include "opus_types.h"
+#include "opus_defines.h"
#if defined(OPUS_HAVE_RTCD) && \
(defined(OPUS_ARM_ASM) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR))
-#include "opus/celt/arm/armcpu.h"
+#include "arm/armcpu.h"
/* We currently support 4 ARM variants:
* arch[0] -> ARMv4
@@ -48,7 +48,7 @@
(defined(OPUS_X86_MAY_HAVE_SSE4_1) && !defined(OPUS_X86_PRESUME_SSE4_1)) || \
(defined(OPUS_X86_MAY_HAVE_AVX) && !defined(OPUS_X86_PRESUME_AVX))
-#include "opus/celt/x86/x86cpu.h"
+#include "x86/x86cpu.h"
/* We currently support 5 x86 variants:
* arch[0] -> non-sse
* arch[1] -> sse
diff --git a/drivers/opus/celt/cwrs.c b/thirdparty/opus/celt/cwrs.c
index 983d4580a9..2fa9f89cd6 100644
--- a/drivers/opus/celt/cwrs.c
+++ b/thirdparty/opus/celt/cwrs.c
@@ -26,12 +26,15 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/celt/os_support.h"
-#include "opus/celt/cwrs.h"
-#include "opus/celt/mathops.h"
-#include "opus/celt/arch.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "os_support.h"
+#include "cwrs.h"
+#include "mathops.h"
+#include "arch.h"
#ifdef CUSTOM_MODES
diff --git a/drivers/opus/celt/cwrs.h b/thirdparty/opus/celt/cwrs.h
index f0ea844e5e..7cd4717459 100644
--- a/drivers/opus/celt/cwrs.h
+++ b/thirdparty/opus/celt/cwrs.h
@@ -30,10 +30,10 @@
#ifndef CWRS_H
#define CWRS_H
-#include "opus/celt/arch.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/celt/entenc.h"
-#include "opus/celt/entdec.h"
+#include "arch.h"
+#include "stack_alloc.h"
+#include "entenc.h"
+#include "entdec.h"
#ifdef CUSTOM_MODES
int log2_frac(opus_uint32 val, int frac);
diff --git a/drivers/opus/celt/ecintrin.h b/thirdparty/opus/celt/ecintrin.h
index 6ed8fb280e..2263cff6bd 100644
--- a/drivers/opus/celt/ecintrin.h
+++ b/thirdparty/opus/celt/ecintrin.h
@@ -26,10 +26,10 @@
*/
/*Some common macros for potential platform-specific optimization.*/
-#include "opus/opus_types.h"
+#include "opus_types.h"
#include <math.h>
#include <limits.h>
-#include "opus/celt/arch.h"
+#include "arch.h"
#if !defined(_ecintrin_H)
# define _ecintrin_H (1)
diff --git a/drivers/opus/celt/entcode.c b/thirdparty/opus/celt/entcode.c
index d1c6b25c7f..70f32016ec 100644
--- a/drivers/opus/celt/entcode.c
+++ b/thirdparty/opus/celt/entcode.c
@@ -24,10 +24,13 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/celt/entcode.h"
-#include "opus/celt/arch.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "entcode.h"
+#include "arch.h"
#if !defined(EC_CLZ)
/*This is a fallback for systems where we don't know how to access
diff --git a/drivers/opus/celt/entcode.h b/thirdparty/opus/celt/entcode.h
index 4d736d4dca..13d6c84ef0 100644
--- a/drivers/opus/celt/entcode.h
+++ b/thirdparty/opus/celt/entcode.h
@@ -25,14 +25,14 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_types.h"
-#include "opus/opus_defines.h"
+#include "opus_types.h"
+#include "opus_defines.h"
#if !defined(_entcode_H)
# define _entcode_H (1)
# include <limits.h>
# include <stddef.h>
-# include "opus/celt/ecintrin.h"
+# include "ecintrin.h"
extern const opus_uint32 SMALL_DIV_TABLE[129];
diff --git a/drivers/opus/celt/entdec.c b/thirdparty/opus/celt/entdec.c
index fdc49c92c1..0b3433ed8b 100644
--- a/drivers/opus/celt/entdec.c
+++ b/thirdparty/opus/celt/entdec.c
@@ -24,13 +24,16 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <stddef.h>
-#include "opus/celt/os_support.h"
-#include "opus/celt/arch.h"
-#include "opus/celt/entdec.h"
-#include "opus/celt/mfrngcod.h"
+#include "os_support.h"
+#include "arch.h"
+#include "entdec.h"
+#include "mfrngcod.h"
/*A range decoder.
This is an entropy decoder based upon \cite{Mar79}, which is itself a
diff --git a/drivers/opus/celt/entdec.h b/thirdparty/opus/celt/entdec.h
index fda60ab326..d8ab318730 100644
--- a/drivers/opus/celt/entdec.h
+++ b/thirdparty/opus/celt/entdec.h
@@ -28,7 +28,7 @@
#if !defined(_entdec_H)
# define _entdec_H (1)
# include <limits.h>
-# include "opus/celt/entcode.h"
+# include "entcode.h"
/*Initializes the decoder.
_buf: The input buffer to use.
diff --git a/drivers/opus/celt/entenc.c b/thirdparty/opus/celt/entenc.c
index da7f2c8e62..f1750d25b8 100644
--- a/drivers/opus/celt/entenc.c
+++ b/thirdparty/opus/celt/entenc.c
@@ -24,11 +24,14 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/celt/os_support.h"
-#include "opus/celt/arch.h"
-#include "opus/celt/entenc.h"
-#include "opus/celt/mfrngcod.h"
+
+#if defined(HAVE_CONFIG_H)
+# include "config.h"
+#endif
+#include "os_support.h"
+#include "arch.h"
+#include "entenc.h"
+#include "mfrngcod.h"
/*A range encoder.
See entdec.c and the references for implementation details \cite{Mar79,MNW98}.
diff --git a/drivers/opus/celt/entenc.h b/thirdparty/opus/celt/entenc.h
index 3f4a3acc93..796bc4d572 100644
--- a/drivers/opus/celt/entenc.h
+++ b/thirdparty/opus/celt/entenc.h
@@ -28,7 +28,7 @@
#if !defined(_entenc_H)
# define _entenc_H (1)
# include <stddef.h>
-# include "opus/celt/entcode.h"
+# include "entcode.h"
/*Initializes the encoder.
_buf: The buffer to store output bytes in.
diff --git a/drivers/opus/celt/fixed_debug.h b/thirdparty/opus/celt/fixed_debug.h
index 3b8d5ef7a9..d28227f5dc 100644
--- a/drivers/opus/celt/fixed_debug.h
+++ b/thirdparty/opus/celt/fixed_debug.h
@@ -33,7 +33,7 @@
#define FIXED_DEBUG_H
#include <stdio.h>
-#include "opus/opus_defines.h"
+#include "opus_defines.h"
#ifdef CELT_C
OPUS_EXPORT opus_int64 celt_mips=0;
diff --git a/drivers/opus/celt/fixed_generic.h b/thirdparty/opus/celt/fixed_generic.h
index 71ab048e4a..ac67d37ce8 100644
--- a/drivers/opus/celt/fixed_generic.h
+++ b/thirdparty/opus/celt/fixed_generic.h
@@ -136,7 +136,7 @@
#define DIV32(a,b) (((opus_val32)(a))/((opus_val32)(b)))
#if defined(MIPSr1_ASM)
-#include "opus/celt/mips/fixed_generic_mipsr1.h"
+#include "mips/fixed_generic_mipsr1.h"
#endif
static OPUS_INLINE opus_val16 SIG2WORD16_generic(celt_sig x)
diff --git a/drivers/opus/celt/float_cast.h b/thirdparty/opus/celt/float_cast.h
index 36a1bfe671..ed5a39b543 100644
--- a/drivers/opus/celt/float_cast.h
+++ b/thirdparty/opus/celt/float_cast.h
@@ -30,7 +30,7 @@
#define FLOAT_CAST_H
-#include "opus/celt/arch.h"
+#include "arch.h"
/*============================================================================
** On Intel Pentium processors (especially PIII and probably P4), converting
diff --git a/drivers/opus/celt/kiss_fft.c b/thirdparty/opus/celt/kiss_fft.c
index cf8d049fa1..4ed37d2bb7 100644
--- a/drivers/opus/celt/kiss_fft.c
+++ b/thirdparty/opus/celt/kiss_fft.c
@@ -30,14 +30,16 @@
heavily modified to better suit Opus */
#ifndef SKIP_CONFIG_H
-#include "opus/opus_config.h"
+# ifdef HAVE_CONFIG_H
+# include "config.h"
+# endif
#endif
-#include "opus/celt/_kiss_fft_guts.h"
-#include "opus/celt/arch.h"
-#include "opus/celt/os_support.h"
-#include "opus/celt/mathops.h"
-#include "opus/celt/stack_alloc.h"
+#include "_kiss_fft_guts.h"
+#include "arch.h"
+#include "os_support.h"
+#include "mathops.h"
+#include "stack_alloc.h"
/* The guts header contains all the multiplication and addition macros that are defined for
complex numbers. It also delares the kf_ internal functions.
@@ -188,7 +190,7 @@ static void kf_bfly3(
kiss_twiddle_cpx epi3;
kiss_fft_cpx * Fout_beg = Fout;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
epi3.r = -16384;
epi3.i = -28378;
#else
@@ -246,7 +248,7 @@ static void kf_bfly5(
kiss_twiddle_cpx ya,yb;
kiss_fft_cpx * Fout_beg = Fout;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
ya.r = 10126;
ya.i = -31164;
yb.r = -26510;
@@ -407,7 +409,7 @@ int kf_factor(int n,opus_int16 * facbuf)
static void compute_twiddles(kiss_twiddle_cpx *twiddles, int nfft)
{
int i;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
for (i=0;i<nfft;++i) {
opus_val32 phase = -i;
kf_cexp2(twiddles+i, DIV32(SHL32(phase,17),nfft));
@@ -450,7 +452,7 @@ kiss_fft_state *opus_fft_alloc_twiddles(int nfft,void * mem,size_t * lenmem,
kiss_twiddle_cpx *twiddles;
st->nfft=nfft;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
st->scale_shift = celt_ilog2(st->nfft);
if (st->nfft == 1<<st->scale_shift)
st->scale = Q15ONE;
@@ -568,7 +570,7 @@ void opus_fft_c(const kiss_fft_state *st,const kiss_fft_cpx *fin,kiss_fft_cpx *f
{
int i;
opus_val16 scale;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
/* Allows us to scale with MULT16_32_Q16(), which is faster than
MULT16_32_Q15() on ARM. */
int scale_shift = st->scale_shift-1;
diff --git a/drivers/opus/celt/kiss_fft.h b/thirdparty/opus/celt/kiss_fft.h
index 6229044c43..bffa2bfad6 100644
--- a/drivers/opus/celt/kiss_fft.h
+++ b/thirdparty/opus/celt/kiss_fft.h
@@ -31,8 +31,8 @@
#include <stdlib.h>
#include <math.h>
-#include "opus/celt/arch.h"
-#include "opus/celt/cpu_support.h"
+#include "arch.h"
+#include "cpu_support.h"
#ifdef __cplusplus
extern "C" {
@@ -46,8 +46,8 @@ extern "C" {
#define KISS_FFT_MALLOC opus_alloc
#endif
-#ifdef OPUS_FIXED_POINT
-#include "opus/celt/arch.h"
+#ifdef FIXED_POINT
+#include "arch.h"
# define kiss_fft_scalar opus_int32
# define kiss_twiddle_scalar opus_int16
@@ -86,7 +86,7 @@ typedef struct arch_fft_state{
typedef struct kiss_fft_state{
int nfft;
opus_val16 scale;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
int scale_shift;
#endif
int shift;
@@ -97,7 +97,7 @@ typedef struct kiss_fft_state{
} kiss_fft_state;
#if defined(HAVE_ARM_NE10)
-#include "opus/celt/arm/fft_arm.h"
+#include "arm/fft_arm.h"
#endif
/*typedef struct kiss_fft_state* kiss_fft_cfg;*/
diff --git a/drivers/opus/celt/laplace.c b/thirdparty/opus/celt/laplace.c
index 5bc956af45..a7bca874b6 100644
--- a/drivers/opus/celt/laplace.c
+++ b/thirdparty/opus/celt/laplace.c
@@ -25,10 +25,13 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/celt/laplace.h"
-#include "opus/celt/mathops.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "laplace.h"
+#include "mathops.h"
/* The minimum probability of an energy delta (out of 32768). */
#define LAPLACE_LOG_MINP (0)
diff --git a/drivers/opus/celt/laplace.h b/thirdparty/opus/celt/laplace.h
index 9efcc73aa2..46c14b5da5 100644
--- a/drivers/opus/celt/laplace.h
+++ b/thirdparty/opus/celt/laplace.h
@@ -26,8 +26,8 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/celt/entenc.h"
-#include "opus/celt/entdec.h"
+#include "entenc.h"
+#include "entdec.h"
/** Encode a value that is assumed to be the realisation of a
Laplace-distributed random process
diff --git a/drivers/opus/celt/mathops.c b/thirdparty/opus/celt/mathops.c
index 3f7c1a8bdd..3f8c5dcc0e 100644
--- a/drivers/opus/celt/mathops.c
+++ b/thirdparty/opus/celt/mathops.c
@@ -30,9 +30,12 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/celt/mathops.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "mathops.h"
/*Compute floor(sqrt(_val)) with exact arithmetic.
This has been tested on all possible 32-bit inputs.*/
@@ -61,7 +64,7 @@ unsigned isqrt32(opus_uint32 _val){
return g;
}
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
opus_val32 frac_div32(opus_val32 a, opus_val32 b)
{
diff --git a/drivers/opus/celt/mathops.h b/thirdparty/opus/celt/mathops.h
index a008d71e18..a0525a9610 100644
--- a/drivers/opus/celt/mathops.h
+++ b/thirdparty/opus/celt/mathops.h
@@ -34,9 +34,9 @@
#ifndef MATHOPS_H
#define MATHOPS_H
-#include "opus/celt/arch.h"
-#include "opus/celt/entcode.h"
-#include "opus/celt/os_support.h"
+#include "arch.h"
+#include "entcode.h"
+#include "os_support.h"
/* Multiplies two 16-bit fractional values. Bit-exactness of this macro is important */
#define FRAC_MUL16(a,b) ((16384+((opus_int32)(opus_int16)(a)*(opus_int16)(b)))>>15)
@@ -59,7 +59,7 @@ static OPUS_INLINE opus_val32 celt_maxabs16(const opus_val16 *x, int len)
#endif
#ifndef OVERRIDE_CELT_MAXABS32
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
static OPUS_INLINE opus_val32 celt_maxabs32(const opus_val32 *x, int len)
{
int i;
@@ -78,7 +78,7 @@ static OPUS_INLINE opus_val32 celt_maxabs32(const opus_val32 *x, int len)
#endif
-#ifndef OPUS_FIXED_POINT
+#ifndef FIXED_POINT
#define PI 3.141592653f
#define celt_sqrt(x) ((float)sqrt(x))
@@ -139,9 +139,9 @@ static OPUS_INLINE float celt_exp2(float x)
#endif
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
-#include "opus/celt/os_support.h"
+#include "os_support.h"
#ifndef OVERRIDE_CELT_ILOG2
/** Integer log in base2. Undefined for zero and negative numbers */
diff --git a/drivers/opus/celt/mdct.c b/thirdparty/opus/celt/mdct.c
index 641a20e49a..5315ad11a3 100644
--- a/drivers/opus/celt/mdct.c
+++ b/thirdparty/opus/celt/mdct.c
@@ -40,19 +40,21 @@
*/
#ifndef SKIP_CONFIG_H
-#include "opus/opus_config.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#endif
-#include "opus/celt/mdct.h"
-#include "opus/celt/kiss_fft.h"
-#include "opus/celt/_kiss_fft_guts.h"
+#include "mdct.h"
+#include "kiss_fft.h"
+#include "_kiss_fft_guts.h"
#include <math.h>
-#include "opus/celt/os_support.h"
-#include "opus/celt/mathops.h"
-#include "opus/celt/stack_alloc.h"
+#include "os_support.h"
+#include "mathops.h"
+#include "stack_alloc.h"
#if defined(MIPSr1_ASM)
-#include "opus/celt/mips/mdct_mipsr1.h"
+#include "mips/mdct_mipsr1.h"
#endif
@@ -124,7 +126,7 @@ void clt_mdct_forward_c(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scal
const kiss_fft_state *st = l->kfft[shift];
const kiss_twiddle_scalar *trig;
opus_val16 scale;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
/* Allows us to scale with MULT16_32_Q16(), which is faster than
MULT16_32_Q15() on ARM. */
int scale_shift = st->scale_shift-1;
diff --git a/drivers/opus/celt/mdct.h b/thirdparty/opus/celt/mdct.h
index 2ec98a92e5..160ae4e0f3 100644
--- a/drivers/opus/celt/mdct.h
+++ b/thirdparty/opus/celt/mdct.h
@@ -42,9 +42,9 @@
#ifndef MDCT_H
#define MDCT_H
-#include "opus/opus_defines.h"
-#include "opus/celt/kiss_fft.h"
-#include "opus/celt/arch.h"
+#include "opus_defines.h"
+#include "kiss_fft.h"
+#include "arch.h"
typedef struct {
int n;
@@ -54,7 +54,7 @@ typedef struct {
} mdct_lookup;
#if defined(HAVE_ARM_NE10)
-#include "opus/celt/arm/mdct_arm.h"
+#include "arm/mdct_arm.h"
#endif
diff --git a/drivers/opus/celt/mfrngcod.h b/thirdparty/opus/celt/mfrngcod.h
index c24d98cde2..809152a59a 100644
--- a/drivers/opus/celt/mfrngcod.h
+++ b/thirdparty/opus/celt/mfrngcod.h
@@ -27,7 +27,7 @@
#if !defined(_mfrngcode_H)
# define _mfrngcode_H (1)
-# include "opus/celt/entcode.h"
+# include "entcode.h"
/*Constants used by the entropy encoder/decoder.*/
diff --git a/drivers/opus/celt/mips/celt_mipsr1.h b/thirdparty/opus/celt/mips/celt_mipsr1.h
index 906848f1ec..e85661a661 100644
--- a/drivers/opus/celt/mips/celt_mipsr1.h
+++ b/thirdparty/opus/celt/mips/celt_mipsr1.h
@@ -29,26 +29,29 @@
#ifndef __CELT_MIPSR1_H__
#define __CELT_MIPSR1_H__
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#define CELT_C
-#include "opus/celt/os_support.h"
-#include "opus/celt/mdct.h"
+#include "os_support.h"
+#include "mdct.h"
#include <math.h>
-#include "opus/celt/celt.h"
-#include "opus/celt/pitch.h"
-#include "opus/celt/bands.h"
-#include "opus/celt/modes.h"
-#include "opus/celt/entcode.h"
-#include "opus/celt/quant_bands.h"
-#include "opus/celt/rate.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/celt/mathops.h"
-#include "opus/celt/float_cast.h"
+#include "celt.h"
+#include "pitch.h"
+#include "bands.h"
+#include "modes.h"
+#include "entcode.h"
+#include "quant_bands.h"
+#include "rate.h"
+#include "stack_alloc.h"
+#include "mathops.h"
+#include "float_cast.h"
#include <stdarg.h>
-#include "opus/celt/celt_lpc.h"
-#include "opus/celt/vq.h"
+#include "celt_lpc.h"
+#include "vq.h"
#define OVERRIDE_comb_filter
void comb_filter(opus_val32 *y, opus_val32 *x, int T0, int T1, int N,
diff --git a/drivers/opus/celt/mips/fixed_generic_mipsr1.h b/thirdparty/opus/celt/mips/fixed_generic_mipsr1.h
index 4a05efbf85..4a05efbf85 100644
--- a/drivers/opus/celt/mips/fixed_generic_mipsr1.h
+++ b/thirdparty/opus/celt/mips/fixed_generic_mipsr1.h
diff --git a/drivers/opus/celt/mips/kiss_fft_mipsr1.h b/thirdparty/opus/celt/mips/kiss_fft_mipsr1.h
index 09dc9af464..400ca4de9c 100644
--- a/drivers/opus/celt/mips/kiss_fft_mipsr1.h
+++ b/thirdparty/opus/celt/mips/kiss_fft_mipsr1.h
@@ -30,7 +30,7 @@
#error "This file should only be included from _kiss_fft_guts.h"
#endif
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
#define S_MUL_ADD(a, b, c, d) (S_MUL(a,b)+S_MUL(c,d))
#define S_MUL_SUB(a, b, c, d) (S_MUL(a,b)-S_MUL(c,d))
@@ -102,7 +102,7 @@ static void kf_bfly5(
kiss_twiddle_cpx ya,yb;
kiss_fft_cpx * Fout_beg = Fout;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
ya.r = 10126;
ya.i = -31164;
yb.r = -26510;
diff --git a/drivers/opus/celt/mips/mdct_mipsr1.h b/thirdparty/opus/celt/mips/mdct_mipsr1.h
index 0bb8b5a056..2934dab776 100644
--- a/drivers/opus/celt/mips/mdct_mipsr1.h
+++ b/thirdparty/opus/celt/mips/mdct_mipsr1.h
@@ -42,16 +42,18 @@
#define __MDCT_MIPSR1_H__
#ifndef SKIP_CONFIG_H
-#include "opus/opus_config.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#endif
-#include "opus/celt/mdct.h"
-#include "opus/celt/kiss_fft.h"
-#include "opus/celt/_kiss_fft_guts.h"
+#include "mdct.h"
+#include "kiss_fft.h"
+#include "_kiss_fft_guts.h"
#include <math.h>
-#include "opus/celt/os_support.h"
-#include "opus/celt/mathops.h"
-#include "opus/celt/stack_alloc.h"
+#include "os_support.h"
+#include "mathops.h"
+#include "stack_alloc.h"
/* Forward MDCT trashes the input array */
#define OVERRIDE_clt_mdct_forward
@@ -65,7 +67,7 @@ void clt_mdct_forward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar
const kiss_fft_state *st = l->kfft[shift];
const kiss_twiddle_scalar *trig;
opus_val16 scale;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
/* Allows us to scale with MULT16_32_Q16(), which is faster than
MULT16_32_Q15() on ARM. */
int scale_shift = st->scale_shift-1;
diff --git a/drivers/opus/celt/mips/pitch_mipsr1.h b/thirdparty/opus/celt/mips/pitch_mipsr1.h
index a9500aff58..a9500aff58 100644
--- a/drivers/opus/celt/mips/pitch_mipsr1.h
+++ b/thirdparty/opus/celt/mips/pitch_mipsr1.h
diff --git a/drivers/opus/celt/mips/vq_mipsr1.h b/thirdparty/opus/celt/mips/vq_mipsr1.h
index c68159972f..54cef86133 100644
--- a/drivers/opus/celt/mips/vq_mipsr1.h
+++ b/thirdparty/opus/celt/mips/vq_mipsr1.h
@@ -28,10 +28,13 @@
#ifndef __VQ_MIPSR1_H__
#define __VQ_MIPSR1_H__
-#include "opus/opus_config.h"
-#include "opus/celt/mathops.h"
-#include "opus/celt/arch.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "mathops.h"
+#include "arch.h"
static unsigned extract_collapse_mask(int *iy, int N, int B);
static void normalise_residual(int * OPUS_RESTRICT iy, celt_norm * OPUS_RESTRICT X, int N, opus_val32 Ryy, opus_val16 gain);
@@ -73,7 +76,7 @@ static void exp_rotation1(celt_norm *X, int len, int stride, opus_val16 c, opus_
void renormalise_vector_mips(celt_norm *X, int N, opus_val16 gain, int arch)
{
int i;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
int k;
#endif
opus_val32 E = EPSILON;
@@ -104,7 +107,7 @@ void renormalise_vector_mips(celt_norm *X, int N, opus_val16 gain, int arch)
}
asm volatile("MFLO %0, $ac1" : "=r" (E));
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
k = celt_ilog2(E)>>1;
#endif
t = VSHR32(E, 2*(k-7));
diff --git a/drivers/opus/celt/modes.c b/thirdparty/opus/celt/modes.c
index d628f1468b..911686e905 100644
--- a/drivers/opus/celt/modes.c
+++ b/thirdparty/opus/celt/modes.c
@@ -26,15 +26,18 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/celt/celt.h"
-#include "opus/celt/modes.h"
-#include "opus/celt/rate.h"
-#include "opus/celt/os_support.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/celt/quant_bands.h"
-#include "opus/celt/cpu_support.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "celt.h"
+#include "modes.h"
+#include "rate.h"
+#include "os_support.h"
+#include "stack_alloc.h"
+#include "quant_bands.h"
+#include "cpu_support.h"
static const opus_int16 eband5ms[] = {
/*0 200 400 600 800 1k 1.2 1.4 1.6 2k 2.4 2.8 3.2 4k 4.8 5.6 6.8 8k 9.6 12k 15.6 */
@@ -60,10 +63,10 @@ static const unsigned char band_allocation[] = {
};
#ifndef CUSTOM_MODES_ONLY
- #ifdef OPUS_FIXED_POINT
- #include "opus/celt/static_modes_fixed.h"
+ #ifdef FIXED_POINT
+ #include "static_modes_fixed.h"
#else
- #include "opus/celt/static_modes_float.h"
+ #include "static_modes_float.h"
#endif
#endif /* CUSTOM_MODES_ONLY */
@@ -368,7 +371,7 @@ CELTMode *opus_custom_mode_create(opus_int32 Fs, int frame_size, int *error)
if (window==NULL)
goto failure;
-#ifndef OPUS_FIXED_POINT
+#ifndef FIXED_POINT
for (i=0;i<mode->overlap;i++)
window[i] = Q15ONE*sin(.5*M_PI* sin(.5*M_PI*(i+.5)/mode->overlap) * sin(.5*M_PI*(i+.5)/mode->overlap));
#else
diff --git a/drivers/opus/celt/modes.h b/thirdparty/opus/celt/modes.h
index a5f1c30ac9..be813ccc8b 100644
--- a/drivers/opus/celt/modes.h
+++ b/thirdparty/opus/celt/modes.h
@@ -30,12 +30,12 @@
#ifndef MODES_H
#define MODES_H
-#include "opus/opus_types.h"
-#include "opus/celt/celt.h"
-#include "opus/celt/arch.h"
-#include "opus/celt/mdct.h"
-#include "opus/celt/entenc.h"
-#include "opus/celt/entdec.h"
+#include "opus_types.h"
+#include "celt.h"
+#include "arch.h"
+#include "mdct.h"
+#include "entenc.h"
+#include "entdec.h"
#define MAX_PERIOD 1024
diff --git a/drivers/opus/celt/opus_custom_demo.c b/thirdparty/opus/celt/opus_custom_demo.c
index 956bec4e45..ae41c0de5a 100644
--- a/drivers/opus/celt/opus_custom_demo.c
+++ b/thirdparty/opus/celt/opus_custom_demo.c
@@ -25,10 +25,13 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/opus_custom.h"
-#include "opus/celt/arch.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "opus_custom.h"
+#include "arch.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
diff --git a/drivers/opus/celt/os_support.h b/thirdparty/opus/celt/os_support.h
index 5e36b3ae56..a2171971e9 100644
--- a/drivers/opus/celt/os_support.h
+++ b/thirdparty/opus/celt/os_support.h
@@ -35,8 +35,8 @@
# include "custom_support.h"
#endif
-#include "opus/opus_types.h"
-#include "opus/opus_defines.h"
+#include "opus_types.h"
+#include "opus_defines.h"
#include <string.h>
#include <stdio.h>
diff --git a/drivers/opus/celt/pitch.c b/thirdparty/opus/celt/pitch.c
index 1bcbabe943..1d89cb0342 100644
--- a/drivers/opus/celt/pitch.c
+++ b/thirdparty/opus/celt/pitch.c
@@ -30,18 +30,21 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/celt/pitch.h"
-#include "opus/celt/os_support.h"
-#include "opus/celt/modes.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/celt/mathops.h"
-#include "opus/celt/celt_lpc.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "pitch.h"
+#include "os_support.h"
+#include "modes.h"
+#include "stack_alloc.h"
+#include "mathops.h"
+#include "celt_lpc.h"
static void find_best_pitch(opus_val32 *xcorr, opus_val16 *y, int len,
int max_pitch, int *best_pitch
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
, int yshift, opus_val32 maxcorr
#endif
)
@@ -50,7 +53,7 @@ static void find_best_pitch(opus_val32 *xcorr, opus_val16 *y, int len,
opus_val32 Syy=1;
opus_val16 best_num[2];
opus_val32 best_den[2];
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
int xshift;
xshift = celt_ilog2(maxcorr)-14;
@@ -71,7 +74,7 @@ static void find_best_pitch(opus_val32 *xcorr, opus_val16 *y, int len,
opus_val16 num;
opus_val32 xcorr16;
xcorr16 = EXTRACT16(VSHR32(xcorr[i], xshift));
-#ifndef OPUS_FIXED_POINT
+#ifndef FIXED_POINT
/* Considering the range of xcorr16, this should avoid both underflows
and overflows (inf) when squaring xcorr16 */
xcorr16 *= 1e-12f;
@@ -150,7 +153,7 @@ void pitch_downsample(celt_sig * OPUS_RESTRICT x[], opus_val16 * OPUS_RESTRICT x
opus_val16 lpc[4], mem[5]={0,0,0,0,0};
opus_val16 lpc2[5];
opus_val16 c1 = QCONST16(.8f,15);
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
int shift;
opus_val32 maxabs = celt_maxabs32(x[0], len);
if (C==2)
@@ -180,7 +183,7 @@ void pitch_downsample(celt_sig * OPUS_RESTRICT x[], opus_val16 * OPUS_RESTRICT x
4, len>>1, arch);
/* Noise floor -40 dB */
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
ac[0] += SHR32(ac[0],13);
#else
ac[0] *= 1.0001f;
@@ -189,7 +192,7 @@ void pitch_downsample(celt_sig * OPUS_RESTRICT x[], opus_val16 * OPUS_RESTRICT x
for (i=1;i<=4;i++)
{
/*ac[i] *= exp(-.5*(2*M_PI*.002*i)*(2*M_PI*.002*i));*/
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
ac[i] -= MULT16_32_Q15(2*i*i, ac[i]);
#else
ac[i] -= ac[i]*(.008f*i)*(.008f*i);
@@ -212,7 +215,7 @@ void pitch_downsample(celt_sig * OPUS_RESTRICT x[], opus_val16 * OPUS_RESTRICT x
}
/* Pure C implementation. */
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
opus_val32
#else
void
@@ -229,7 +232,7 @@ celt_pitch_xcorr(const opus_val16 *_x, const opus_val16 *_y,
#if 0 /* This is a simple version of the pitch correlation that should work
well on DSPs like Blackfin and TI C5x/C6x */
int i, j;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
opus_val32 maxcorr=1;
#endif
#if !defined(OVERRIDE_PITCH_XCORR)
@@ -241,11 +244,11 @@ celt_pitch_xcorr(const opus_val16 *_x, const opus_val16 *_y,
for (j=0;j<len;j++)
sum = MAC16_16(sum, _x[j], _y[i+j]);
xcorr[i] = sum;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
maxcorr = MAX32(maxcorr, sum);
#endif
}
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
return maxcorr;
#endif
@@ -254,7 +257,7 @@ celt_pitch_xcorr(const opus_val16 *_x, const opus_val16 *_y,
/*The EDSP version requires that max_pitch is at least 1, and that _x is
32-bit aligned.
Since it's hard to put asserts in assembly, put them here.*/
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
opus_val32 maxcorr=1;
#endif
celt_assert(max_pitch>0);
@@ -271,7 +274,7 @@ celt_pitch_xcorr(const opus_val16 *_x, const opus_val16 *_y,
xcorr[i+1]=sum[1];
xcorr[i+2]=sum[2];
xcorr[i+3]=sum[3];
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
sum[0] = MAX32(sum[0], sum[1]);
sum[2] = MAX32(sum[2], sum[3]);
sum[0] = MAX32(sum[0], sum[2]);
@@ -288,11 +291,11 @@ celt_pitch_xcorr(const opus_val16 *_x, const opus_val16 *_y,
sum = celt_inner_prod(_x, _y+i, len, arch);
#endif
xcorr[i] = sum;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
maxcorr = MAX32(maxcorr, sum);
#endif
}
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
return maxcorr;
#endif
#endif
@@ -307,7 +310,7 @@ void pitch_search(const opus_val16 * OPUS_RESTRICT x_lp, opus_val16 * OPUS_RESTR
VARDECL(opus_val16, x_lp4);
VARDECL(opus_val16, y_lp4);
VARDECL(opus_val32, xcorr);
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
opus_val32 maxcorr;
opus_val32 xmax, ymax;
int shift=0;
@@ -330,7 +333,7 @@ void pitch_search(const opus_val16 * OPUS_RESTRICT x_lp, opus_val16 * OPUS_RESTR
for (j=0;j<lag>>2;j++)
y_lp4[j] = y[2*j];
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
xmax = celt_maxabs16(x_lp4, len>>2);
ymax = celt_maxabs16(y_lp4, lag>>2);
shift = celt_ilog2(MAX32(1, MAX32(xmax, ymax)))-11;
@@ -349,19 +352,19 @@ void pitch_search(const opus_val16 * OPUS_RESTRICT x_lp, opus_val16 * OPUS_RESTR
/* Coarse search with 4x decimation */
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
maxcorr =
#endif
celt_pitch_xcorr(x_lp4, y_lp4, xcorr, len>>2, max_pitch>>2, arch);
find_best_pitch(xcorr, y_lp4, len>>2, max_pitch>>2, best_pitch
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
, 0, maxcorr
#endif
);
/* Finer search with 2x decimation */
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
maxcorr=1;
#endif
for (i=0;i<max_pitch>>1;i++)
@@ -370,7 +373,7 @@ void pitch_search(const opus_val16 * OPUS_RESTRICT x_lp, opus_val16 * OPUS_RESTR
xcorr[i] = 0;
if (abs(i-2*best_pitch[0])>2 && abs(i-2*best_pitch[1])>2)
continue;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
sum = 0;
for (j=0;j<len>>1;j++)
sum += SHR32(MULT16_16(x_lp[j],y[i+j]), shift);
@@ -378,12 +381,12 @@ void pitch_search(const opus_val16 * OPUS_RESTRICT x_lp, opus_val16 * OPUS_RESTR
sum = celt_inner_prod_c(x_lp, y+i, len>>1);
#endif
xcorr[i] = MAX32(-1, sum);
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
maxcorr = MAX32(maxcorr, sum);
#endif
}
find_best_pitch(xcorr, y, len>>1, max_pitch>>1, best_pitch
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
, shift+1, maxcorr
#endif
);
@@ -447,7 +450,7 @@ opus_val16 remove_doubling(opus_val16 *x, int maxperiod, int minperiod,
yy = yy_lookup[T0];
best_xy = xy;
best_yy = yy;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
{
opus_val32 x2y2;
int sh, t;
@@ -483,7 +486,7 @@ opus_val16 remove_doubling(opus_val16 *x, int maxperiod, int minperiod,
dual_inner_prod(x, &x[-T1], &x[-T1b], N, &xy, &xy2, arch);
xy += xy2;
yy = yy_lookup[T1] + yy_lookup[T1b];
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
{
opus_val32 x2y2;
int sh, t;
diff --git a/drivers/opus/celt/pitch.h b/thirdparty/opus/celt/pitch.h
index ecae7667b8..65a77a6ecc 100644
--- a/drivers/opus/celt/pitch.h
+++ b/thirdparty/opus/celt/pitch.h
@@ -34,21 +34,21 @@
#ifndef PITCH_H
#define PITCH_H
-#include "opus/celt/modes.h"
-#include "opus/celt/cpu_support.h"
+#include "modes.h"
+#include "cpu_support.h"
#if (defined(OPUS_X86_MAY_HAVE_SSE) && !defined(FIXED_POINT)) \
|| ((defined(OPUS_X86_MAY_HAVE_SSE4_1) || defined(OPUS_X86_MAY_HAVE_SSE2)) && defined(FIXED_POINT))
-#include "opus/celt/x86/pitch_sse.h"
+#include "x86/pitch_sse.h"
#endif
#if defined(MIPSr1_ASM)
-#include "opus/celt/mips/pitch_mipsr1.h"
+#include "mips/pitch_mipsr1.h"
#endif
#if ((defined(OPUS_ARM_ASM) && defined(FIXED_POINT)) \
|| defined(OPUS_ARM_MAY_HAVE_NEON_INTR))
-# include "opus/celt/arm/pitch_arm.h"
+# include "arm/pitch_arm.h"
#endif
void pitch_downsample(celt_sig * OPUS_RESTRICT x[], opus_val16 * OPUS_RESTRICT x_lp,
@@ -178,7 +178,7 @@ void comb_filter_const_c(opus_val32 *y, opus_val32 *x, int T, int N,
#endif
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
opus_val32
#else
void
@@ -206,7 +206,7 @@ void
xcorr, len, max_pitch))
# else
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
opus_val32
#else
void
diff --git a/drivers/opus/celt/quant_bands.c b/thirdparty/opus/celt/quant_bands.c
index b38bfa8b8e..95076e0af2 100644
--- a/drivers/opus/celt/quant_bands.c
+++ b/thirdparty/opus/celt/quant_bands.c
@@ -25,18 +25,21 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/celt/quant_bands.h"
-#include "opus/celt/laplace.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "quant_bands.h"
+#include "laplace.h"
#include <math.h>
-#include "opus/celt/os_support.h"
-#include "opus/celt/arch.h"
-#include "opus/celt/mathops.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/celt/rate.h"
+#include "os_support.h"
+#include "arch.h"
+#include "mathops.h"
+#include "stack_alloc.h"
+#include "rate.h"
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
/* Mean energy in each band quantized in Q4 */
const signed char eMeans[25] = {
103,100, 92, 85, 81,
@@ -56,7 +59,7 @@ const opus_val16 eMeans[25] = {
};
#endif
/* prediction coefficients: 0.9, 0.8, 0.65, 0.5 */
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
static const opus_val16 pred_coef[4] = {29440, 26112, 21248, 16384};
static const opus_val16 beta_coef[4] = {30147, 22282, 12124, 6554};
static const opus_val16 beta_intra = 4915;
@@ -187,7 +190,7 @@ static int quant_coarse_energy_impl(const CELTMode *m, int start, int end,
opus_val16 decay_bound;
x = eBands[i+c*m->nbEBands];
oldE = MAX16(-QCONST16(9.f,DB_SHIFT), oldEBands[i+c*m->nbEBands]);
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
f = SHL32(EXTEND32(x),7) - PSHR32(MULT16_16(coef,oldE), 8) - prev[c];
/* Rounding to nearest integer here is really important! */
qi = (f+QCONST32(.5f,DB_SHIFT+7))>>(DB_SHIFT+7);
@@ -245,7 +248,7 @@ static int quant_coarse_energy_impl(const CELTMode *m, int start, int end,
q = (opus_val32)SHL32(EXTEND32(qi),DB_SHIFT);
tmp = PSHR32(MULT16_16(coef,oldE),8) + prev[c] + SHL32(q,7);
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
tmp = MAX32(-QCONST32(28.f, DB_SHIFT+7), tmp);
#endif
oldEBands[i+c*m->nbEBands] = PSHR32(tmp, 7);
@@ -282,7 +285,7 @@ void quant_coarse_energy(const CELTMode *m, int start, int end, int effEnd,
max_decay = QCONST16(16.f,DB_SHIFT);
if (end-start>10)
{
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
max_decay = MIN32(max_decay, SHL32(EXTEND32(nbAvailableBytes),DB_SHIFT-3));
#else
max_decay = MIN32(max_decay, .125f*nbAvailableBytes);
@@ -369,7 +372,7 @@ void quant_fine_energy(const CELTMode *m, int start, int end, opus_val16 *oldEBa
do {
int q2;
opus_val16 offset;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
/* Has to be without rounding */
q2 = (error[i+c*m->nbEBands]+QCONST16(.5f,DB_SHIFT))>>(DB_SHIFT-fine_quant[i]);
#else
@@ -380,7 +383,7 @@ void quant_fine_energy(const CELTMode *m, int start, int end, opus_val16 *oldEBa
if (q2<0)
q2 = 0;
ec_enc_bits(enc, q2, fine_quant[i]);
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
offset = SUB16(SHR32(SHL32(EXTEND32(q2),DB_SHIFT)+QCONST16(.5f,DB_SHIFT),fine_quant[i]),QCONST16(.5f,DB_SHIFT));
#else
offset = (q2+.5f)*(1<<(14-fine_quant[i]))*(1.f/16384) - .5f;
@@ -409,7 +412,7 @@ void quant_energy_finalise(const CELTMode *m, int start, int end, opus_val16 *ol
opus_val16 offset;
q2 = error[i+c*m->nbEBands]<0 ? 0 : 1;
ec_enc_bits(enc, q2, 1);
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
offset = SHR16(SHL16(q2,DB_SHIFT)-QCONST16(.5f,DB_SHIFT),fine_quant[i]+1);
#else
offset = (q2-.5f)*(1<<(14-fine_quant[i]-1))*(1.f/16384);
@@ -477,7 +480,7 @@ void unquant_coarse_energy(const CELTMode *m, int start, int end, opus_val16 *ol
oldEBands[i+c*m->nbEBands] = MAX16(-QCONST16(9.f,DB_SHIFT), oldEBands[i+c*m->nbEBands]);
tmp = PSHR32(MULT16_16(coef,oldEBands[i+c*m->nbEBands]),8) + prev[c] + SHL32(q,7);
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
tmp = MAX32(-QCONST32(28.f, DB_SHIFT+7), tmp);
#endif
oldEBands[i+c*m->nbEBands] = PSHR32(tmp, 7);
@@ -499,7 +502,7 @@ void unquant_fine_energy(const CELTMode *m, int start, int end, opus_val16 *oldE
int q2;
opus_val16 offset;
q2 = ec_dec_bits(dec, fine_quant[i]);
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
offset = SUB16(SHR32(SHL32(EXTEND32(q2),DB_SHIFT)+QCONST16(.5f,DB_SHIFT),fine_quant[i]),QCONST16(.5f,DB_SHIFT));
#else
offset = (q2+.5f)*(1<<(14-fine_quant[i]))*(1.f/16384) - .5f;
@@ -525,7 +528,7 @@ void unquant_energy_finalise(const CELTMode *m, int start, int end, opus_val16 *
int q2;
opus_val16 offset;
q2 = ec_dec_bits(dec, 1);
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
offset = SHR16(SHL16(q2,DB_SHIFT)-QCONST16(.5f,DB_SHIFT),fine_quant[i]+1);
#else
offset = (q2-.5f)*(1<<(14-fine_quant[i]-1))*(1.f/16384);
diff --git a/drivers/opus/celt/quant_bands.h b/thirdparty/opus/celt/quant_bands.h
index 31d4b94e41..0490bca4b4 100644
--- a/drivers/opus/celt/quant_bands.h
+++ b/thirdparty/opus/celt/quant_bands.h
@@ -29,13 +29,13 @@
#ifndef QUANT_BANDS
#define QUANT_BANDS
-#include "opus/celt/arch.h"
-#include "opus/celt/modes.h"
-#include "opus/celt/entenc.h"
-#include "opus/celt/entdec.h"
-#include "opus/celt/mathops.h"
+#include "arch.h"
+#include "modes.h"
+#include "entenc.h"
+#include "entdec.h"
+#include "mathops.h"
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
extern const signed char eMeans[25];
#else
extern const opus_val16 eMeans[25];
diff --git a/drivers/opus/celt/rate.c b/thirdparty/opus/celt/rate.c
index e69fb3f030..b28d8feccd 100644
--- a/drivers/opus/celt/rate.c
+++ b/thirdparty/opus/celt/rate.c
@@ -25,16 +25,19 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <math.h>
-#include "opus/celt/modes.h"
-#include "opus/celt/cwrs.h"
-#include "opus/celt/arch.h"
-#include "opus/celt/os_support.h"
+#include "modes.h"
+#include "cwrs.h"
+#include "arch.h"
+#include "os_support.h"
-#include "opus/celt/entcode.h"
-#include "opus/celt/rate.h"
+#include "entcode.h"
+#include "rate.h"
static const unsigned char LOG2_FRAC_TABLE[24]={
0,
diff --git a/drivers/opus/celt/rate.h b/thirdparty/opus/celt/rate.h
index cf8085fccf..515f7687ce 100644
--- a/drivers/opus/celt/rate.h
+++ b/thirdparty/opus/celt/rate.h
@@ -40,8 +40,8 @@
#define QTHETA_OFFSET 4
#define QTHETA_OFFSET_TWOPHASE 16
-#include "opus/celt/cwrs.h"
-#include "opus/celt/modes.h"
+#include "cwrs.h"
+#include "modes.h"
void compute_pulse_cache(CELTMode *m, int LM);
diff --git a/drivers/opus/celt/stack_alloc.h b/thirdparty/opus/celt/stack_alloc.h
index 7cd6c56ccf..2b51c8d80c 100644
--- a/drivers/opus/celt/stack_alloc.h
+++ b/thirdparty/opus/celt/stack_alloc.h
@@ -32,8 +32,8 @@
#ifndef STACK_ALLOC_H
#define STACK_ALLOC_H
-#include "opus/opus_types.h"
-#include "opus/opus_defines.h"
+#include "opus_types.h"
+#include "opus_defines.h"
#if (!defined (VAR_ARRAYS) && !defined (USE_ALLOCA) && !defined (NONTHREADSAFE_PSEUDOSTACK))
#error "Opus requires one of VAR_ARRAYS, USE_ALLOCA, or NONTHREADSAFE_PSEUDOSTACK be defined to select the temporary allocation mode."
@@ -151,7 +151,7 @@ extern char *global_stack_top;
#endif /* ENABLE_VALGRIND */
-#include "opus/celt/os_support.h"
+#include "os_support.h"
#define VARDECL(type, var) type *var
#define ALLOC(var, size, type) var = PUSH(global_stack, size, type)
#define SAVE_STACK char *_saved_stack = global_stack;
diff --git a/drivers/opus/celt/static_modes_fixed.h b/thirdparty/opus/celt/static_modes_fixed.h
index 352642f507..8717d626cb 100644
--- a/drivers/opus/celt/static_modes_fixed.h
+++ b/thirdparty/opus/celt/static_modes_fixed.h
@@ -1,12 +1,12 @@
/* The contents of this file was automatically generated by dump_modes.c
with arguments: 48000 960
It contains static definitions for some pre-defined modes. */
-#include "opus/celt/modes.h"
-#include "opus/celt/rate.h"
+#include "modes.h"
+#include "rate.h"
#ifdef HAVE_ARM_NE10
#define OVERRIDE_FFT 1
-#include "opus/celt/static_modes_fixed_arm_ne10.h"
+#include "static_modes_fixed_arm_ne10.h"
#endif
#ifndef DEF_WINDOW120
diff --git a/drivers/opus/celt/static_modes_fixed_arm_ne10.h b/thirdparty/opus/celt/static_modes_fixed_arm_ne10.h
index b8ef0cee98..b8ef0cee98 100644
--- a/drivers/opus/celt/static_modes_fixed_arm_ne10.h
+++ b/thirdparty/opus/celt/static_modes_fixed_arm_ne10.h
diff --git a/drivers/opus/celt/static_modes_float.h b/thirdparty/opus/celt/static_modes_float.h
index f7d501a993..e102a38391 100644
--- a/drivers/opus/celt/static_modes_float.h
+++ b/thirdparty/opus/celt/static_modes_float.h
@@ -1,12 +1,12 @@
/* The contents of this file was automatically generated by dump_modes.c
with arguments: 48000 960
It contains static definitions for some pre-defined modes. */
-#include "opus/celt/modes.h"
-#include "opus/celt/rate.h"
+#include "modes.h"
+#include "rate.h"
#ifdef HAVE_ARM_NE10
#define OVERRIDE_FFT 1
-#include "opus/celt/static_modes_float_arm_ne10.h"
+#include "static_modes_float_arm_ne10.h"
#endif
#ifndef DEF_WINDOW120
diff --git a/drivers/opus/celt/static_modes_float_arm_ne10.h b/thirdparty/opus/celt/static_modes_float_arm_ne10.h
index 934a82a420..934a82a420 100644
--- a/drivers/opus/celt/static_modes_float_arm_ne10.h
+++ b/thirdparty/opus/celt/static_modes_float_arm_ne10.h
diff --git a/thirdparty/opus/celt/tests/test_unit_cwrs32.c b/thirdparty/opus/celt/tests/test_unit_cwrs32.c
new file mode 100644
index 0000000000..36dd8af5f5
--- /dev/null
+++ b/thirdparty/opus/celt/tests/test_unit_cwrs32.c
@@ -0,0 +1,161 @@
+/* Copyright (c) 2008-2011 Xiph.Org Foundation, Mozilla Corporation,
+ Gregory Maxwell
+ Written by Jean-Marc Valin, Gregory Maxwell, and Timothy B. Terriberry */
+/*
+ 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.
+
+ 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 COPYRIGHT OWNER
+ 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.
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+
+#ifndef CUSTOM_MODES
+#define CUSTOM_MODES
+#else
+#define TEST_CUSTOM_MODES
+#endif
+
+#define CELT_C
+#include "stack_alloc.h"
+#include "entenc.c"
+#include "entdec.c"
+#include "entcode.c"
+#include "cwrs.c"
+#include "mathops.c"
+#include "rate.h"
+
+#define NMAX (240)
+#define KMAX (128)
+
+#ifdef TEST_CUSTOM_MODES
+
+#define NDIMS (44)
+static const int pn[NDIMS]={
+ 2, 3, 4, 5, 6, 7, 8, 9, 10,
+ 11, 12, 13, 14, 15, 16, 18, 20, 22,
+ 24, 26, 28, 30, 32, 36, 40, 44, 48,
+ 52, 56, 60, 64, 72, 80, 88, 96, 104,
+ 112, 120, 128, 144, 160, 176, 192, 208
+};
+static const int pkmax[NDIMS]={
+ 128, 128, 128, 128, 88, 52, 36, 26, 22,
+ 18, 16, 15, 13, 12, 12, 11, 10, 9,
+ 9, 8, 8, 7, 7, 7, 7, 6, 6,
+ 6, 6, 6, 5, 5, 5, 5, 5, 5,
+ 4, 4, 4, 4, 4, 4, 4, 4
+};
+
+#else /* TEST_CUSTOM_MODES */
+
+#define NDIMS (22)
+static const int pn[NDIMS]={
+ 2, 3, 4, 6, 8, 9, 11, 12, 16,
+ 18, 22, 24, 32, 36, 44, 48, 64, 72,
+ 88, 96, 144, 176
+};
+static const int pkmax[NDIMS]={
+ 128, 128, 128, 88, 36, 26, 18, 16, 12,
+ 11, 9, 9, 7, 7, 6, 6, 5, 5,
+ 5, 5, 4, 4
+};
+
+#endif
+
+int main(void){
+ int t;
+ int n;
+ ALLOC_STACK;
+ for(t=0;t<NDIMS;t++){
+ int pseudo;
+ n=pn[t];
+ for(pseudo=1;pseudo<41;pseudo++)
+ {
+ int k;
+#if defined(SMALL_FOOTPRINT)
+ opus_uint32 uu[KMAX+2U];
+#endif
+ opus_uint32 inc;
+ opus_uint32 nc;
+ opus_uint32 i;
+ k=get_pulses(pseudo);
+ if (k>pkmax[t])break;
+ printf("Testing CWRS with N=%i, K=%i...\n",n,k);
+#if defined(SMALL_FOOTPRINT)
+ nc=ncwrs_urow(n,k,uu);
+#else
+ nc=CELT_PVQ_V(n,k);
+#endif
+ inc=nc/20000;
+ if(inc<1)inc=1;
+ for(i=0;i<nc;i+=inc){
+#if defined(SMALL_FOOTPRINT)
+ opus_uint32 u[KMAX+2U];
+#endif
+ int y[NMAX];
+ int sy;
+ opus_uint32 v;
+ opus_uint32 ii;
+ int j;
+#if defined(SMALL_FOOTPRINT)
+ memcpy(u,uu,(k+2U)*sizeof(*u));
+ cwrsi(n,k,i,y,u);
+#else
+ cwrsi(n,k,i,y);
+#endif
+ sy=0;
+ for(j=0;j<n;j++)sy+=abs(y[j]);
+ if(sy!=k){
+ fprintf(stderr,"N=%d Pulse count mismatch in cwrsi (%d!=%d).\n",
+ n,sy,k);
+ return 99;
+ }
+ /*printf("%6u of %u:",i,nc);
+ for(j=0;j<n;j++)printf(" %+3i",y[j]);
+ printf(" ->");*/
+#if defined(SMALL_FOOTPRINT)
+ ii=icwrs(n,k,&v,y,u);
+#else
+ ii=icwrs(n,y);
+ v=CELT_PVQ_V(n,k);
+#endif
+ if(ii!=i){
+ fprintf(stderr,"Combination-index mismatch (%lu!=%lu).\n",
+ (long)ii,(long)i);
+ return 1;
+ }
+ if(v!=nc){
+ fprintf(stderr,"Combination count mismatch (%lu!=%lu).\n",
+ (long)v,(long)nc);
+ return 2;
+ }
+ /*printf(" %6u\n",i);*/
+ }
+ /*printf("\n");*/
+ }
+ }
+ return 0;
+}
diff --git a/thirdparty/opus/celt/tests/test_unit_dft.c b/thirdparty/opus/celt/tests/test_unit_dft.c
new file mode 100644
index 0000000000..6166eb0e4f
--- /dev/null
+++ b/thirdparty/opus/celt/tests/test_unit_dft.c
@@ -0,0 +1,189 @@
+/* Copyright (c) 2008 Xiph.Org Foundation
+ Written by Jean-Marc Valin */
+/*
+ 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.
+
+ 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 COPYRIGHT OWNER
+ 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.
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define SKIP_CONFIG_H
+
+#ifndef CUSTOM_MODES
+#define CUSTOM_MODES
+#endif
+
+#include <stdio.h>
+
+#define CELT_C
+#define TEST_UNIT_DFT_C
+#include "stack_alloc.h"
+#include "kiss_fft.h"
+#include "kiss_fft.c"
+#include "mathops.c"
+#include "entcode.c"
+
+#if defined(OPUS_X86_MAY_HAVE_SSE2) || defined(OPUS_X86_MAY_HAVE_SSE4_1)
+# include "x86/x86cpu.c"
+#elif defined(OPUS_ARM_ASM) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
+# include "arm/armcpu.c"
+# include "celt_lpc.c"
+# include "pitch.c"
+# if defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
+# include "arm/celt_neon_intr.c"
+# if defined(HAVE_ARM_NE10)
+# include "mdct.c"
+# include "arm/celt_ne10_fft.c"
+# include "arm/celt_ne10_mdct.c"
+# endif
+# endif
+# include "arm/arm_celt_map.c"
+#endif
+
+#ifndef M_PI
+#define M_PI 3.141592653
+#endif
+
+int ret = 0;
+
+void check(kiss_fft_cpx * in,kiss_fft_cpx * out,int nfft,int isinverse)
+{
+ int bin,k;
+ double errpow=0,sigpow=0, snr;
+
+ for (bin=0;bin<nfft;++bin) {
+ double ansr = 0;
+ double ansi = 0;
+ double difr;
+ double difi;
+
+ for (k=0;k<nfft;++k) {
+ double phase = -2*M_PI*bin*k/nfft;
+ double re = cos(phase);
+ double im = sin(phase);
+ if (isinverse)
+ im = -im;
+
+ if (!isinverse)
+ {
+ re /= nfft;
+ im /= nfft;
+ }
+
+ ansr += in[k].r * re - in[k].i * im;
+ ansi += in[k].r * im + in[k].i * re;
+ }
+ /*printf ("%d %d ", (int)ansr, (int)ansi);*/
+ difr = ansr - out[bin].r;
+ difi = ansi - out[bin].i;
+ errpow += difr*difr + difi*difi;
+ sigpow += ansr*ansr+ansi*ansi;
+ }
+ snr = 10*log10(sigpow/errpow);
+ printf("nfft=%d inverse=%d,snr = %f\n",nfft,isinverse,snr );
+ if (snr<60) {
+ printf( "** poor snr: %f ** \n", snr);
+ ret = 1;
+ }
+}
+
+void test1d(int nfft,int isinverse,int arch)
+{
+ size_t buflen = sizeof(kiss_fft_cpx)*nfft;
+
+ kiss_fft_cpx * in = (kiss_fft_cpx*)malloc(buflen);
+ kiss_fft_cpx * out= (kiss_fft_cpx*)malloc(buflen);
+ kiss_fft_state *cfg = opus_fft_alloc(nfft,0,0,arch);
+ int k;
+
+ for (k=0;k<nfft;++k) {
+ in[k].r = (rand() % 32767) - 16384;
+ in[k].i = (rand() % 32767) - 16384;
+ }
+
+ for (k=0;k<nfft;++k) {
+ in[k].r *= 32768;
+ in[k].i *= 32768;
+ }
+
+ if (isinverse)
+ {
+ for (k=0;k<nfft;++k) {
+ in[k].r /= nfft;
+ in[k].i /= nfft;
+ }
+ }
+
+ /*for (k=0;k<nfft;++k) printf("%d %d ", in[k].r, in[k].i);printf("\n");*/
+
+ if (isinverse)
+ opus_ifft(cfg,in,out, arch);
+ else
+ opus_fft(cfg,in,out, arch);
+
+ /*for (k=0;k<nfft;++k) printf("%d %d ", out[k].r, out[k].i);printf("\n");*/
+
+ check(in,out,nfft,isinverse);
+
+ free(in);
+ free(out);
+ opus_fft_free(cfg, arch);
+}
+
+int main(int argc,char ** argv)
+{
+ ALLOC_STACK;
+ int arch = opus_select_arch();
+
+ if (argc>1) {
+ int k;
+ for (k=1;k<argc;++k) {
+ test1d(atoi(argv[k]),0,arch);
+ test1d(atoi(argv[k]),1,arch);
+ }
+ }else{
+ test1d(32,0,arch);
+ test1d(32,1,arch);
+ test1d(128,0,arch);
+ test1d(128,1,arch);
+ test1d(256,0,arch);
+ test1d(256,1,arch);
+#ifndef RADIX_TWO_ONLY
+ test1d(36,0,arch);
+ test1d(36,1,arch);
+ test1d(50,0,arch);
+ test1d(50,1,arch);
+ test1d(60,0,arch);
+ test1d(60,1,arch);
+ test1d(120,0,arch);
+ test1d(120,1,arch);
+ test1d(240,0,arch);
+ test1d(240,1,arch);
+ test1d(480,0,arch);
+ test1d(480,1,arch);
+#endif
+ }
+ return ret;
+}
diff --git a/thirdparty/opus/celt/tests/test_unit_entropy.c b/thirdparty/opus/celt/tests/test_unit_entropy.c
new file mode 100644
index 0000000000..ff9265864c
--- /dev/null
+++ b/thirdparty/opus/celt/tests/test_unit_entropy.c
@@ -0,0 +1,382 @@
+/* Copyright (c) 2007-2011 Xiph.Org Foundation, Mozilla Corporation,
+ Gregory Maxwell
+ Written by Jean-Marc Valin, Gregory Maxwell, and Timothy B. Terriberry */
+/*
+ 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.
+
+ 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 COPYRIGHT OWNER
+ 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.
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include <time.h>
+#include "entcode.h"
+#include "entenc.h"
+#include "entdec.h"
+#include <string.h>
+
+#include "entenc.c"
+#include "entdec.c"
+#include "entcode.c"
+
+#ifndef M_LOG2E
+# define M_LOG2E 1.4426950408889634074
+#endif
+#define DATA_SIZE 10000000
+#define DATA_SIZE2 10000
+
+int main(int _argc,char **_argv){
+ ec_enc enc;
+ ec_dec dec;
+ long nbits;
+ long nbits2;
+ double entropy;
+ int ft;
+ int ftb;
+ int sz;
+ int i;
+ int ret;
+ unsigned int sym;
+ unsigned int seed;
+ unsigned char *ptr;
+ const char *env_seed;
+ ret=0;
+ entropy=0;
+ if (_argc > 2) {
+ fprintf(stderr, "Usage: %s [<seed>]\n", _argv[0]);
+ return 1;
+ }
+ env_seed = getenv("SEED");
+ if (_argc > 1)
+ seed = atoi(_argv[1]);
+ else if (env_seed)
+ seed = atoi(env_seed);
+ else
+ seed = time(NULL);
+ /*Testing encoding of raw bit values.*/
+ ptr = (unsigned char *)malloc(DATA_SIZE);
+ ec_enc_init(&enc,ptr, DATA_SIZE);
+ for(ft=2;ft<1024;ft++){
+ for(i=0;i<ft;i++){
+ entropy+=log(ft)*M_LOG2E;
+ ec_enc_uint(&enc,i,ft);
+ }
+ }
+ /*Testing encoding of raw bit values.*/
+ for(ftb=1;ftb<16;ftb++){
+ for(i=0;i<(1<<ftb);i++){
+ entropy+=ftb;
+ nbits=ec_tell(&enc);
+ ec_enc_bits(&enc,i,ftb);
+ nbits2=ec_tell(&enc);
+ if(nbits2-nbits!=ftb){
+ fprintf(stderr,"Used %li bits to encode %i bits directly.\n",
+ nbits2-nbits,ftb);
+ ret=-1;
+ }
+ }
+ }
+ nbits=ec_tell_frac(&enc);
+ ec_enc_done(&enc);
+ fprintf(stderr,
+ "Encoded %0.2lf bits of entropy to %0.2lf bits (%0.3lf%% wasted).\n",
+ entropy,ldexp(nbits,-3),100*(nbits-ldexp(entropy,3))/nbits);
+ fprintf(stderr,"Packed to %li bytes.\n",(long)ec_range_bytes(&enc));
+ ec_dec_init(&dec,ptr,DATA_SIZE);
+ for(ft=2;ft<1024;ft++){
+ for(i=0;i<ft;i++){
+ sym=ec_dec_uint(&dec,ft);
+ if(sym!=(unsigned)i){
+ fprintf(stderr,"Decoded %i instead of %i with ft of %i.\n",sym,i,ft);
+ ret=-1;
+ }
+ }
+ }
+ for(ftb=1;ftb<16;ftb++){
+ for(i=0;i<(1<<ftb);i++){
+ sym=ec_dec_bits(&dec,ftb);
+ if(sym!=(unsigned)i){
+ fprintf(stderr,"Decoded %i instead of %i with ftb of %i.\n",sym,i,ftb);
+ ret=-1;
+ }
+ }
+ }
+ nbits2=ec_tell_frac(&dec);
+ if(nbits!=nbits2){
+ fprintf(stderr,
+ "Reported number of bits used was %0.2lf, should be %0.2lf.\n",
+ ldexp(nbits2,-3),ldexp(nbits,-3));
+ ret=-1;
+ }
+ /*Testing an encoder bust prefers range coder data over raw bits.
+ This isn't a general guarantee, will only work for data that is buffered in
+ the encoder state and not yet stored in the user buffer, and should never
+ get used in practice.
+ It's mostly here for code coverage completeness.*/
+ /*Start with a 16-bit buffer.*/
+ ec_enc_init(&enc,ptr,2);
+ /*Write 7 raw bits.*/
+ ec_enc_bits(&enc,0x55,7);
+ /*Write 12.3 bits of range coder data.*/
+ ec_enc_uint(&enc,1,2);
+ ec_enc_uint(&enc,1,3);
+ ec_enc_uint(&enc,1,4);
+ ec_enc_uint(&enc,1,5);
+ ec_enc_uint(&enc,2,6);
+ ec_enc_uint(&enc,6,7);
+ ec_enc_done(&enc);
+ ec_dec_init(&dec,ptr,2);
+ if(!enc.error
+ /*The raw bits should have been overwritten by the range coder data.*/
+ ||ec_dec_bits(&dec,7)!=0x05
+ /*And all the range coder data should have been encoded correctly.*/
+ ||ec_dec_uint(&dec,2)!=1
+ ||ec_dec_uint(&dec,3)!=1
+ ||ec_dec_uint(&dec,4)!=1
+ ||ec_dec_uint(&dec,5)!=1
+ ||ec_dec_uint(&dec,6)!=2
+ ||ec_dec_uint(&dec,7)!=6){
+ fprintf(stderr,"Encoder bust overwrote range coder data with raw bits.\n");
+ ret=-1;
+ }
+ srand(seed);
+ fprintf(stderr,"Testing random streams... Random seed: %u (%.4X)\n", seed, rand() % 65536);
+ for(i=0;i<409600;i++){
+ unsigned *data;
+ unsigned *tell;
+ unsigned tell_bits;
+ int j;
+ int zeros;
+ ft=rand()/((RAND_MAX>>(rand()%11U))+1U)+10;
+ sz=rand()/((RAND_MAX>>(rand()%9U))+1U);
+ data=(unsigned *)malloc(sz*sizeof(*data));
+ tell=(unsigned *)malloc((sz+1)*sizeof(*tell));
+ ec_enc_init(&enc,ptr,DATA_SIZE2);
+ zeros = rand()%13==0;
+ tell[0]=ec_tell_frac(&enc);
+ for(j=0;j<sz;j++){
+ if (zeros)
+ data[j]=0;
+ else
+ data[j]=rand()%ft;
+ ec_enc_uint(&enc,data[j],ft);
+ tell[j+1]=ec_tell_frac(&enc);
+ }
+ if (rand()%2==0)
+ while(ec_tell(&enc)%8 != 0)
+ ec_enc_uint(&enc, rand()%2, 2);
+ tell_bits = ec_tell(&enc);
+ ec_enc_done(&enc);
+ if(tell_bits!=(unsigned)ec_tell(&enc)){
+ fprintf(stderr,"ec_tell() changed after ec_enc_done(): %i instead of %i (Random seed: %u)\n",
+ ec_tell(&enc),tell_bits,seed);
+ ret=-1;
+ }
+ if ((tell_bits+7)/8 < ec_range_bytes(&enc))
+ {
+ fprintf (stderr, "ec_tell() lied, there's %i bytes instead of %d (Random seed: %u)\n",
+ ec_range_bytes(&enc), (tell_bits+7)/8,seed);
+ ret=-1;
+ }
+ ec_dec_init(&dec,ptr,DATA_SIZE2);
+ if(ec_tell_frac(&dec)!=tell[0]){
+ fprintf(stderr,
+ "Tell mismatch between encoder and decoder at symbol %i: %i instead of %i (Random seed: %u).\n",
+ 0,ec_tell_frac(&dec),tell[0],seed);
+ }
+ for(j=0;j<sz;j++){
+ sym=ec_dec_uint(&dec,ft);
+ if(sym!=data[j]){
+ fprintf(stderr,
+ "Decoded %i instead of %i with ft of %i at position %i of %i (Random seed: %u).\n",
+ sym,data[j],ft,j,sz,seed);
+ ret=-1;
+ }
+ if(ec_tell_frac(&dec)!=tell[j+1]){
+ fprintf(stderr,
+ "Tell mismatch between encoder and decoder at symbol %i: %i instead of %i (Random seed: %u).\n",
+ j+1,ec_tell_frac(&dec),tell[j+1],seed);
+ }
+ }
+ free(tell);
+ free(data);
+ }
+ /*Test compatibility between multiple different encode/decode routines.*/
+ for(i=0;i<409600;i++){
+ unsigned *logp1;
+ unsigned *data;
+ unsigned *tell;
+ unsigned *enc_method;
+ int j;
+ sz=rand()/((RAND_MAX>>(rand()%9U))+1U);
+ logp1=(unsigned *)malloc(sz*sizeof(*logp1));
+ data=(unsigned *)malloc(sz*sizeof(*data));
+ tell=(unsigned *)malloc((sz+1)*sizeof(*tell));
+ enc_method=(unsigned *)malloc(sz*sizeof(*enc_method));
+ ec_enc_init(&enc,ptr,DATA_SIZE2);
+ tell[0]=ec_tell_frac(&enc);
+ for(j=0;j<sz;j++){
+ data[j]=rand()/((RAND_MAX>>1)+1);
+ logp1[j]=(rand()%15)+1;
+ enc_method[j]=rand()/((RAND_MAX>>2)+1);
+ switch(enc_method[j]){
+ case 0:{
+ ec_encode(&enc,data[j]?(1<<logp1[j])-1:0,
+ (1<<logp1[j])-(data[j]?0:1),1<<logp1[j]);
+ }break;
+ case 1:{
+ ec_encode_bin(&enc,data[j]?(1<<logp1[j])-1:0,
+ (1<<logp1[j])-(data[j]?0:1),logp1[j]);
+ }break;
+ case 2:{
+ ec_enc_bit_logp(&enc,data[j],logp1[j]);
+ }break;
+ case 3:{
+ unsigned char icdf[2];
+ icdf[0]=1;
+ icdf[1]=0;
+ ec_enc_icdf(&enc,data[j],icdf,logp1[j]);
+ }break;
+ }
+ tell[j+1]=ec_tell_frac(&enc);
+ }
+ ec_enc_done(&enc);
+ if((ec_tell(&enc)+7U)/8U<ec_range_bytes(&enc)){
+ fprintf(stderr,"tell() lied, there's %i bytes instead of %d (Random seed: %u)\n",
+ ec_range_bytes(&enc),(ec_tell(&enc)+7)/8,seed);
+ ret=-1;
+ }
+ ec_dec_init(&dec,ptr,DATA_SIZE2);
+ if(ec_tell_frac(&dec)!=tell[0]){
+ fprintf(stderr,
+ "Tell mismatch between encoder and decoder at symbol %i: %i instead of %i (Random seed: %u).\n",
+ 0,ec_tell_frac(&dec),tell[0],seed);
+ }
+ for(j=0;j<sz;j++){
+ int fs;
+ int dec_method;
+ dec_method=rand()/((RAND_MAX>>2)+1);
+ switch(dec_method){
+ case 0:{
+ fs=ec_decode(&dec,1<<logp1[j]);
+ sym=fs>=(1<<logp1[j])-1;
+ ec_dec_update(&dec,sym?(1<<logp1[j])-1:0,
+ (1<<logp1[j])-(sym?0:1),1<<logp1[j]);
+ }break;
+ case 1:{
+ fs=ec_decode_bin(&dec,logp1[j]);
+ sym=fs>=(1<<logp1[j])-1;
+ ec_dec_update(&dec,sym?(1<<logp1[j])-1:0,
+ (1<<logp1[j])-(sym?0:1),1<<logp1[j]);
+ }break;
+ case 2:{
+ sym=ec_dec_bit_logp(&dec,logp1[j]);
+ }break;
+ case 3:{
+ unsigned char icdf[2];
+ icdf[0]=1;
+ icdf[1]=0;
+ sym=ec_dec_icdf(&dec,icdf,logp1[j]);
+ }break;
+ }
+ if(sym!=data[j]){
+ fprintf(stderr,
+ "Decoded %i instead of %i with logp1 of %i at position %i of %i (Random seed: %u).\n",
+ sym,data[j],logp1[j],j,sz,seed);
+ fprintf(stderr,"Encoding method: %i, decoding method: %i\n",
+ enc_method[j],dec_method);
+ ret=-1;
+ }
+ if(ec_tell_frac(&dec)!=tell[j+1]){
+ fprintf(stderr,
+ "Tell mismatch between encoder and decoder at symbol %i: %i instead of %i (Random seed: %u).\n",
+ j+1,ec_tell_frac(&dec),tell[j+1],seed);
+ }
+ }
+ free(enc_method);
+ free(tell);
+ free(data);
+ free(logp1);
+ }
+ ec_enc_init(&enc,ptr,DATA_SIZE2);
+ ec_enc_bit_logp(&enc,0,1);
+ ec_enc_bit_logp(&enc,0,1);
+ ec_enc_bit_logp(&enc,0,1);
+ ec_enc_bit_logp(&enc,0,1);
+ ec_enc_bit_logp(&enc,0,2);
+ ec_enc_patch_initial_bits(&enc,3,2);
+ if(enc.error){
+ fprintf(stderr,"patch_initial_bits failed");
+ ret=-1;
+ }
+ ec_enc_patch_initial_bits(&enc,0,5);
+ if(!enc.error){
+ fprintf(stderr,"patch_initial_bits didn't fail when it should have");
+ ret=-1;
+ }
+ ec_enc_done(&enc);
+ if(ec_range_bytes(&enc)!=1||ptr[0]!=192){
+ fprintf(stderr,"Got %d when expecting 192 for patch_initial_bits",ptr[0]);
+ ret=-1;
+ }
+ ec_enc_init(&enc,ptr,DATA_SIZE2);
+ ec_enc_bit_logp(&enc,0,1);
+ ec_enc_bit_logp(&enc,0,1);
+ ec_enc_bit_logp(&enc,1,6);
+ ec_enc_bit_logp(&enc,0,2);
+ ec_enc_patch_initial_bits(&enc,0,2);
+ if(enc.error){
+ fprintf(stderr,"patch_initial_bits failed");
+ ret=-1;
+ }
+ ec_enc_done(&enc);
+ if(ec_range_bytes(&enc)!=2||ptr[0]!=63){
+ fprintf(stderr,"Got %d when expecting 63 for patch_initial_bits",ptr[0]);
+ ret=-1;
+ }
+ ec_enc_init(&enc,ptr,2);
+ ec_enc_bit_logp(&enc,0,2);
+ for(i=0;i<48;i++){
+ ec_enc_bits(&enc,0,1);
+ }
+ ec_enc_done(&enc);
+ if(!enc.error){
+ fprintf(stderr,"Raw bits overfill didn't fail when it should have");
+ ret=-1;
+ }
+ ec_enc_init(&enc,ptr,2);
+ for(i=0;i<17;i++){
+ ec_enc_bits(&enc,0,1);
+ }
+ ec_enc_done(&enc);
+ if(!enc.error){
+ fprintf(stderr,"17 raw bits encoded in two bytes");
+ ret=-1;
+ }
+ free(ptr);
+ return ret;
+}
diff --git a/thirdparty/opus/celt/tests/test_unit_laplace.c b/thirdparty/opus/celt/tests/test_unit_laplace.c
new file mode 100644
index 0000000000..22951e29ee
--- /dev/null
+++ b/thirdparty/opus/celt/tests/test_unit_laplace.c
@@ -0,0 +1,93 @@
+/* Copyright (c) 2008-2011 Xiph.Org Foundation, Mozilla Corporation
+ Written by Jean-Marc Valin and Timothy B. Terriberry */
+/*
+ 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.
+
+ 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 COPYRIGHT OWNER
+ 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.
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "laplace.h"
+#define CELT_C
+#include "stack_alloc.h"
+
+#include "entenc.c"
+#include "entdec.c"
+#include "entcode.c"
+#include "laplace.c"
+
+#define DATA_SIZE 40000
+
+int ec_laplace_get_start_freq(int decay)
+{
+ opus_uint32 ft = 32768 - LAPLACE_MINP*(2*LAPLACE_NMIN+1);
+ int fs = (ft*(16384-decay))/(16384+decay);
+ return fs+LAPLACE_MINP;
+}
+
+int main(void)
+{
+ int i;
+ int ret = 0;
+ ec_enc enc;
+ ec_dec dec;
+ unsigned char *ptr;
+ int val[10000], decay[10000];
+ ALLOC_STACK;
+ ptr = (unsigned char *)malloc(DATA_SIZE);
+ ec_enc_init(&enc,ptr,DATA_SIZE);
+
+ val[0] = 3; decay[0] = 6000;
+ val[1] = 0; decay[1] = 5800;
+ val[2] = -1; decay[2] = 5600;
+ for (i=3;i<10000;i++)
+ {
+ val[i] = rand()%15-7;
+ decay[i] = rand()%11000+5000;
+ }
+ for (i=0;i<10000;i++)
+ ec_laplace_encode(&enc, &val[i],
+ ec_laplace_get_start_freq(decay[i]), decay[i]);
+
+ ec_enc_done(&enc);
+
+ ec_dec_init(&dec,ec_get_buffer(&enc),ec_range_bytes(&enc));
+
+ for (i=0;i<10000;i++)
+ {
+ int d = ec_laplace_decode(&dec,
+ ec_laplace_get_start_freq(decay[i]), decay[i]);
+ if (d != val[i])
+ {
+ fprintf (stderr, "Got %d instead of %d\n", d, val[i]);
+ ret = 1;
+ }
+ }
+
+ free(ptr);
+ return ret;
+}
diff --git a/thirdparty/opus/celt/tests/test_unit_mathops.c b/thirdparty/opus/celt/tests/test_unit_mathops.c
new file mode 100644
index 0000000000..fd3319da91
--- /dev/null
+++ b/thirdparty/opus/celt/tests/test_unit_mathops.c
@@ -0,0 +1,304 @@
+/* Copyright (c) 2008-2011 Xiph.Org Foundation, Mozilla Corporation,
+ Gregory Maxwell
+ Written by Jean-Marc Valin, Gregory Maxwell, and Timothy B. Terriberry */
+/*
+ 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.
+
+ 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 COPYRIGHT OWNER
+ 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.
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifndef CUSTOM_MODES
+#define CUSTOM_MODES
+#endif
+
+#define CELT_C
+
+#include <stdio.h>
+#include <math.h>
+#include "mathops.c"
+#include "entenc.c"
+#include "entdec.c"
+#include "entcode.c"
+#include "bands.c"
+#include "quant_bands.c"
+#include "laplace.c"
+#include "vq.c"
+#include "cwrs.c"
+#include "pitch.c"
+#include "celt_lpc.c"
+#include "celt.c"
+
+#if defined(OPUS_X86_MAY_HAVE_SSE) || defined(OPUS_X86_MAY_HAVE_SSE2) || defined(OPUS_X86_MAY_HAVE_SSE4_1)
+# if defined(OPUS_X86_MAY_HAVE_SSE)
+# include "x86/pitch_sse.c"
+# endif
+# if defined(OPUS_X86_MAY_HAVE_SSE2)
+# include "x86/pitch_sse2.c"
+# endif
+# if defined(OPUS_X86_MAY_HAVE_SSE4_1)
+# include "x86/pitch_sse4_1.c"
+# include "x86/celt_lpc_sse.c"
+# endif
+# include "x86/x86_celt_map.c"
+#elif defined(OPUS_ARM_ASM) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
+# include "arm/armcpu.c"
+# if defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
+# include "arm/celt_neon_intr.c"
+# if defined(HAVE_ARM_NE10)
+# include "kiss_fft.c"
+# include "mdct.c"
+# include "arm/celt_ne10_fft.c"
+# include "arm/celt_ne10_mdct.c"
+# endif
+# endif
+# include "arm/arm_celt_map.c"
+#endif
+
+#ifdef FIXED_POINT
+#define WORD "%d"
+#else
+#define WORD "%f"
+#endif
+
+int ret = 0;
+
+void testdiv(void)
+{
+ opus_int32 i;
+ for (i=1;i<=327670;i++)
+ {
+ double prod;
+ opus_val32 val;
+ val = celt_rcp(i);
+#ifdef FIXED_POINT
+ prod = (1./32768./65526.)*val*i;
+#else
+ prod = val*i;
+#endif
+ if (fabs(prod-1) > .00025)
+ {
+ fprintf (stderr, "div failed: 1/%d="WORD" (product = %f)\n", i, val, prod);
+ ret = 1;
+ }
+ }
+}
+
+void testsqrt(void)
+{
+ opus_int32 i;
+ for (i=1;i<=1000000000;i++)
+ {
+ double ratio;
+ opus_val16 val;
+ val = celt_sqrt(i);
+ ratio = val/sqrt(i);
+ if (fabs(ratio - 1) > .0005 && fabs(val-sqrt(i)) > 2)
+ {
+ fprintf (stderr, "sqrt failed: sqrt(%d)="WORD" (ratio = %f)\n", i, val, ratio);
+ ret = 1;
+ }
+ i+= i>>10;
+ }
+}
+
+void testbitexactcos(void)
+{
+ int i;
+ opus_int32 min_d,max_d,last,chk;
+ chk=max_d=0;
+ last=min_d=32767;
+ for(i=64;i<=16320;i++)
+ {
+ opus_int32 d;
+ opus_int32 q=bitexact_cos(i);
+ chk ^= q*i;
+ d = last - q;
+ if (d>max_d)max_d=d;
+ if (d<min_d)min_d=d;
+ last = q;
+ }
+ if ((chk!=89408644)||(max_d!=5)||(min_d!=0)||(bitexact_cos(64)!=32767)||
+ (bitexact_cos(16320)!=200)||(bitexact_cos(8192)!=23171))
+ {
+ fprintf (stderr, "bitexact_cos failed\n");
+ ret = 1;
+ }
+}
+
+void testbitexactlog2tan(void)
+{
+ int i,fail;
+ opus_int32 min_d,max_d,last,chk;
+ fail=chk=max_d=0;
+ last=min_d=15059;
+ for(i=64;i<8193;i++)
+ {
+ opus_int32 d;
+ opus_int32 mid=bitexact_cos(i);
+ opus_int32 side=bitexact_cos(16384-i);
+ opus_int32 q=bitexact_log2tan(mid,side);
+ chk ^= q*i;
+ d = last - q;
+ if (q!=-1*bitexact_log2tan(side,mid))
+ fail = 1;
+ if (d>max_d)max_d=d;
+ if (d<min_d)min_d=d;
+ last = q;
+ }
+ if ((chk!=15821257)||(max_d!=61)||(min_d!=-2)||fail||
+ (bitexact_log2tan(32767,200)!=15059)||(bitexact_log2tan(30274,12540)!=2611)||
+ (bitexact_log2tan(23171,23171)!=0))
+ {
+ fprintf (stderr, "bitexact_log2tan failed\n");
+ ret = 1;
+ }
+}
+
+#ifndef FIXED_POINT
+void testlog2(void)
+{
+ float x;
+ for (x=0.001;x<1677700.0;x+=(x/8.0))
+ {
+ float error = fabs((1.442695040888963387*log(x))-celt_log2(x));
+ if (error>0.0009)
+ {
+ fprintf (stderr, "celt_log2 failed: fabs((1.442695040888963387*log(x))-celt_log2(x))>0.001 (x = %f, error = %f)\n", x,error);
+ ret = 1;
+ }
+ }
+}
+
+void testexp2(void)
+{
+ float x;
+ for (x=-11.0;x<24.0;x+=0.0007)
+ {
+ float error = fabs(x-(1.442695040888963387*log(celt_exp2(x))));
+ if (error>0.0002)
+ {
+ fprintf (stderr, "celt_exp2 failed: fabs(x-(1.442695040888963387*log(celt_exp2(x))))>0.0005 (x = %f, error = %f)\n", x,error);
+ ret = 1;
+ }
+ }
+}
+
+void testexp2log2(void)
+{
+ float x;
+ for (x=-11.0;x<24.0;x+=0.0007)
+ {
+ float error = fabs(x-(celt_log2(celt_exp2(x))));
+ if (error>0.001)
+ {
+ fprintf (stderr, "celt_log2/celt_exp2 failed: fabs(x-(celt_log2(celt_exp2(x))))>0.001 (x = %f, error = %f)\n", x,error);
+ ret = 1;
+ }
+ }
+}
+#else
+void testlog2(void)
+{
+ opus_val32 x;
+ for (x=8;x<1073741824;x+=(x>>3))
+ {
+ float error = fabs((1.442695040888963387*log(x/16384.0))-celt_log2(x)/1024.0);
+ if (error>0.003)
+ {
+ fprintf (stderr, "celt_log2 failed: x = %ld, error = %f\n", (long)x,error);
+ ret = 1;
+ }
+ }
+}
+
+void testexp2(void)
+{
+ opus_val16 x;
+ for (x=-32768;x<15360;x++)
+ {
+ float error1 = fabs(x/1024.0-(1.442695040888963387*log(celt_exp2(x)/65536.0)));
+ float error2 = fabs(exp(0.6931471805599453094*x/1024.0)-celt_exp2(x)/65536.0);
+ if (error1>0.0002&&error2>0.00004)
+ {
+ fprintf (stderr, "celt_exp2 failed: x = "WORD", error1 = %f, error2 = %f\n", x,error1,error2);
+ ret = 1;
+ }
+ }
+}
+
+void testexp2log2(void)
+{
+ opus_val32 x;
+ for (x=8;x<65536;x+=(x>>3))
+ {
+ float error = fabs(x-0.25*celt_exp2(celt_log2(x)))/16384;
+ if (error>0.004)
+ {
+ fprintf (stderr, "celt_log2/celt_exp2 failed: fabs(x-(celt_exp2(celt_log2(x))))>0.001 (x = %ld, error = %f)\n", (long)x,error);
+ ret = 1;
+ }
+ }
+}
+
+void testilog2(void)
+{
+ opus_val32 x;
+ for (x=1;x<=268435455;x+=127)
+ {
+ opus_val32 lg;
+ opus_val32 y;
+
+ lg = celt_ilog2(x);
+ if (lg<0 || lg>=31)
+ {
+ printf("celt_ilog2 failed: 0<=celt_ilog2(x)<31 (x = %d, celt_ilog2(x) = %d)\n",x,lg);
+ ret = 1;
+ }
+ y = 1<<lg;
+
+ if (x<y || (x>>1)>=y)
+ {
+ printf("celt_ilog2 failed: 2**celt_ilog2(x)<=x<2**(celt_ilog2(x)+1) (x = %d, 2**celt_ilog2(x) = %d)\n",x,y);
+ ret = 1;
+ }
+ }
+}
+#endif
+
+int main(void)
+{
+ testbitexactcos();
+ testbitexactlog2tan();
+ testdiv();
+ testsqrt();
+ testlog2();
+ testexp2();
+ testexp2log2();
+#ifdef FIXED_POINT
+ testilog2();
+#endif
+ return ret;
+}
diff --git a/thirdparty/opus/celt/tests/test_unit_mdct.c b/thirdparty/opus/celt/tests/test_unit_mdct.c
new file mode 100644
index 0000000000..8dbb9caa2e
--- /dev/null
+++ b/thirdparty/opus/celt/tests/test_unit_mdct.c
@@ -0,0 +1,230 @@
+/* Copyright (c) 2008-2011 Xiph.Org Foundation
+ Written by Jean-Marc Valin */
+/*
+ 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.
+
+ 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 COPYRIGHT OWNER
+ 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.
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define SKIP_CONFIG_H
+
+#ifndef CUSTOM_MODES
+#define CUSTOM_MODES
+#endif
+
+#include <stdio.h>
+
+#define CELT_C
+#include "mdct.h"
+#include "stack_alloc.h"
+
+#include "kiss_fft.c"
+#include "mdct.c"
+#include "mathops.c"
+#include "entcode.c"
+
+#if defined(OPUS_X86_MAY_HAVE_SSE2) || defined(OPUS_X86_MAY_HAVE_SSE4_1)
+# include "x86/x86cpu.c"
+#elif defined(OPUS_ARM_ASM) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
+# include "arm/armcpu.c"
+# include "pitch.c"
+# include "celt_lpc.c"
+# if defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
+# include "arm/celt_neon_intr.c"
+# if defined(HAVE_ARM_NE10)
+# include "arm/celt_ne10_fft.c"
+# include "arm/celt_ne10_mdct.c"
+# endif
+# endif
+# include "arm/arm_celt_map.c"
+#endif
+
+#ifndef M_PI
+#define M_PI 3.141592653
+#endif
+
+int ret = 0;
+void check(kiss_fft_scalar * in,kiss_fft_scalar * out,int nfft,int isinverse)
+{
+ int bin,k;
+ double errpow=0,sigpow=0;
+ double snr;
+ for (bin=0;bin<nfft/2;++bin) {
+ double ansr = 0;
+ double difr;
+
+ for (k=0;k<nfft;++k) {
+ double phase = 2*M_PI*(k+.5+.25*nfft)*(bin+.5)/nfft;
+ double re = cos(phase);
+
+ re /= nfft/4;
+
+ ansr += in[k] * re;
+ }
+ /*printf ("%f %f\n", ansr, out[bin]);*/
+ difr = ansr - out[bin];
+ errpow += difr*difr;
+ sigpow += ansr*ansr;
+ }
+ snr = 10*log10(sigpow/errpow);
+ printf("nfft=%d inverse=%d,snr = %f\n",nfft,isinverse,snr );
+ if (snr<60) {
+ printf( "** poor snr: %f **\n", snr);
+ ret = 1;
+ }
+}
+
+void check_inv(kiss_fft_scalar * in,kiss_fft_scalar * out,int nfft,int isinverse)
+{
+ int bin,k;
+ double errpow=0,sigpow=0;
+ double snr;
+ for (bin=0;bin<nfft;++bin) {
+ double ansr = 0;
+ double difr;
+
+ for (k=0;k<nfft/2;++k) {
+ double phase = 2*M_PI*(bin+.5+.25*nfft)*(k+.5)/nfft;
+ double re = cos(phase);
+
+ /*re *= 2;*/
+
+ ansr += in[k] * re;
+ }
+ /*printf ("%f %f\n", ansr, out[bin]);*/
+ difr = ansr - out[bin];
+ errpow += difr*difr;
+ sigpow += ansr*ansr;
+ }
+ snr = 10*log10(sigpow/errpow);
+ printf("nfft=%d inverse=%d,snr = %f\n",nfft,isinverse,snr );
+ if (snr<60) {
+ printf( "** poor snr: %f **\n", snr);
+ ret = 1;
+ }
+}
+
+
+void test1d(int nfft,int isinverse,int arch)
+{
+ mdct_lookup cfg;
+ size_t buflen = sizeof(kiss_fft_scalar)*nfft;
+
+ kiss_fft_scalar * in = (kiss_fft_scalar*)malloc(buflen);
+ kiss_fft_scalar * in_copy = (kiss_fft_scalar*)malloc(buflen);
+ kiss_fft_scalar * out= (kiss_fft_scalar*)malloc(buflen);
+ opus_val16 * window= (opus_val16*)malloc(sizeof(opus_val16)*nfft/2);
+ int k;
+
+ clt_mdct_init(&cfg, nfft, 0, arch);
+ for (k=0;k<nfft;++k) {
+ in[k] = (rand() % 32768) - 16384;
+ }
+
+ for (k=0;k<nfft/2;++k) {
+ window[k] = Q15ONE;
+ }
+ for (k=0;k<nfft;++k) {
+ in[k] *= 32768;
+ }
+
+ if (isinverse)
+ {
+ for (k=0;k<nfft;++k) {
+ in[k] /= nfft;
+ }
+ }
+
+ for (k=0;k<nfft;++k)
+ in_copy[k] = in[k];
+ /*for (k=0;k<nfft;++k) printf("%d %d ", in[k].r, in[k].i);printf("\n");*/
+
+ if (isinverse)
+ {
+ for (k=0;k<nfft;++k)
+ out[k] = 0;
+ clt_mdct_backward(&cfg,in,out, window, nfft/2, 0, 1, arch);
+ /* apply TDAC because clt_mdct_backward() no longer does that */
+ for (k=0;k<nfft/4;++k)
+ out[nfft-k-1] = out[nfft/2+k];
+ check_inv(in,out,nfft,isinverse);
+ } else {
+ clt_mdct_forward(&cfg,in,out,window, nfft/2, 0, 1, arch);
+ check(in_copy,out,nfft,isinverse);
+ }
+ /*for (k=0;k<nfft;++k) printf("%d %d ", out[k].r, out[k].i);printf("\n");*/
+
+
+ free(in);
+ free(in_copy);
+ free(out);
+ free(window);
+ clt_mdct_clear(&cfg, arch);
+}
+
+int main(int argc,char ** argv)
+{
+ ALLOC_STACK;
+ int arch = opus_select_arch();
+
+ if (argc>1) {
+ int k;
+ for (k=1;k<argc;++k) {
+ test1d(atoi(argv[k]),0,arch);
+ test1d(atoi(argv[k]),1,arch);
+ }
+ }else{
+ test1d(32,0,arch);
+ test1d(32,1,arch);
+ test1d(256,0,arch);
+ test1d(256,1,arch);
+ test1d(512,0,arch);
+ test1d(512,1,arch);
+ test1d(1024,0,arch);
+ test1d(1024,1,arch);
+ test1d(2048,0,arch);
+ test1d(2048,1,arch);
+#ifndef RADIX_TWO_ONLY
+ test1d(36,0,arch);
+ test1d(36,1,arch);
+ test1d(40,0,arch);
+ test1d(40,1,arch);
+ test1d(60,0,arch);
+ test1d(60,1,arch);
+ test1d(120,0,arch);
+ test1d(120,1,arch);
+ test1d(240,0,arch);
+ test1d(240,1,arch);
+ test1d(480,0,arch);
+ test1d(480,1,arch);
+ test1d(960,0,arch);
+ test1d(960,1,arch);
+ test1d(1920,0,arch);
+ test1d(1920,1,arch);
+#endif
+ }
+ return ret;
+}
diff --git a/thirdparty/opus/celt/tests/test_unit_rotation.c b/thirdparty/opus/celt/tests/test_unit_rotation.c
new file mode 100644
index 0000000000..1080c2085d
--- /dev/null
+++ b/thirdparty/opus/celt/tests/test_unit_rotation.c
@@ -0,0 +1,120 @@
+/* Copyright (c) 2008-2011 Xiph.Org Foundation
+ Written by Jean-Marc Valin */
+/*
+ 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.
+
+ 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 COPYRIGHT OWNER
+ 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.
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifndef CUSTOM_MODES
+#define CUSTOM_MODES
+#endif
+
+#define CELT_C
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "vq.c"
+#include "cwrs.c"
+#include "entcode.c"
+#include "entenc.c"
+#include "entdec.c"
+#include "mathops.c"
+#include "bands.h"
+#include "pitch.c"
+#include "celt_lpc.c"
+#include "celt.c"
+#include <math.h>
+
+#if defined(OPUS_X86_MAY_HAVE_SSE) || defined(OPUS_X86_MAY_HAVE_SSE2) || defined(OPUS_X86_MAY_HAVE_SSE4_1)
+# if defined(OPUS_X86_MAY_HAVE_SSE)
+# include "x86/pitch_sse.c"
+# endif
+# if defined(OPUS_X86_MAY_HAVE_SSE2)
+# include "x86/pitch_sse2.c"
+# endif
+# if defined(OPUS_X86_MAY_HAVE_SSE4_1)
+# include "x86/pitch_sse4_1.c"
+# include "x86/celt_lpc_sse.c"
+# endif
+# include "x86/x86_celt_map.c"
+#elif defined(OPUS_ARM_ASM) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
+# include "arm/armcpu.c"
+# if defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
+# include "arm/celt_neon_intr.c"
+# if defined(HAVE_ARM_NE10)
+# include "kiss_fft.c"
+# include "mdct.c"
+# include "arm/celt_ne10_fft.c"
+# include "arm/celt_ne10_mdct.c"
+# endif
+# endif
+# include "arm/arm_celt_map.c"
+#endif
+
+#define MAX_SIZE 100
+
+int ret=0;
+void test_rotation(int N, int K)
+{
+ int i;
+ double err = 0, ener = 0, snr, snr0;
+ opus_val16 x0[MAX_SIZE];
+ opus_val16 x1[MAX_SIZE];
+ for (i=0;i<N;i++)
+ x1[i] = x0[i] = rand()%32767-16384;
+ exp_rotation(x1, N, 1, 1, K, SPREAD_NORMAL);
+ for (i=0;i<N;i++)
+ {
+ err += (x0[i]-(double)x1[i])*(x0[i]-(double)x1[i]);
+ ener += x0[i]*(double)x0[i];
+ }
+ snr0 = 20*log10(ener/err);
+ err = ener = 0;
+ exp_rotation(x1, N, -1, 1, K, SPREAD_NORMAL);
+ for (i=0;i<N;i++)
+ {
+ err += (x0[i]-(double)x1[i])*(x0[i]-(double)x1[i]);
+ ener += x0[i]*(double)x0[i];
+ }
+ snr = 20*log10(ener/err);
+ printf ("SNR for size %d (%d pulses) is %f (was %f without inverse)\n", N, K, snr, snr0);
+ if (snr < 60 || snr0 > 20)
+ {
+ fprintf(stderr, "FAIL!\n");
+ ret = 1;
+ }
+}
+
+int main(void)
+{
+ ALLOC_STACK;
+ test_rotation(15, 3);
+ test_rotation(23, 5);
+ test_rotation(50, 3);
+ test_rotation(80, 1);
+ return ret;
+}
diff --git a/thirdparty/opus/celt/tests/test_unit_types.c b/thirdparty/opus/celt/tests/test_unit_types.c
new file mode 100644
index 0000000000..67a0fb8ed3
--- /dev/null
+++ b/thirdparty/opus/celt/tests/test_unit_types.c
@@ -0,0 +1,50 @@
+/* Copyright (c) 2008-2011 Xiph.Org Foundation
+ Written by Jean-Marc Valin */
+/*
+ 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.
+
+ 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 COPYRIGHT OWNER
+ 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.
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "opus_types.h"
+#include <stdio.h>
+
+int main(void)
+{
+ opus_int16 i = 1;
+ i <<= 14;
+ if (i>>14 != 1)
+ {
+ fprintf(stderr, "opus_int16 isn't 16 bits\n");
+ return 1;
+ }
+ if (sizeof(opus_int16)*2 != sizeof(opus_int32))
+ {
+ fprintf(stderr, "16*2 != 32\n");
+ return 1;
+ }
+ return 0;
+}
diff --git a/drivers/opus/celt/vq.c b/thirdparty/opus/celt/vq.c
index 3061e3006f..f358396065 100644
--- a/drivers/opus/celt/vq.c
+++ b/thirdparty/opus/celt/vq.c
@@ -25,16 +25,19 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/celt/mathops.h"
-#include "opus/celt/cwrs.h"
-#include "opus/celt/vq.h"
-#include "opus/celt/arch.h"
-#include "opus/celt/os_support.h"
-#include "opus/celt/bands.h"
-#include "opus/celt/rate.h"
-#include "opus/celt/pitch.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "mathops.h"
+#include "cwrs.h"
+#include "vq.h"
+#include "arch.h"
+#include "os_support.h"
+#include "bands.h"
+#include "rate.h"
+#include "pitch.h"
#ifndef OVERRIDE_vq_exp_rotation1
static void exp_rotation1(celt_norm *X, int len, int stride, opus_val16 c, opus_val16 s)
@@ -115,13 +118,13 @@ static void normalise_residual(int * OPUS_RESTRICT iy, celt_norm * OPUS_RESTRICT
int N, opus_val32 Ryy, opus_val16 gain)
{
int i;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
int k;
#endif
opus_val32 t;
opus_val16 g;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
k = celt_ilog2(Ryy)>>1;
#endif
t = VSHR32(Ryy, 2*(k-7));
@@ -208,7 +211,7 @@ unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B, ec_enc *enc
} while (++j<N);
/* If X is too small, just replace it with a pulse at 0 */
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
if (sum <= K)
#else
/* Prevents infinities and NaNs from causing too many pulses
@@ -224,7 +227,7 @@ unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B, ec_enc *enc
}
rcp = EXTRACT16(MULT16_32_Q16(K-1, celt_rcp(sum)));
j=0; do {
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
/* It's really important to round *towards zero* here */
iy[j] = MULT16_16_Q15(X[j],rcp);
#else
@@ -241,7 +244,7 @@ unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B, ec_enc *enc
/* This should never happen, but just in case it does (e.g. on silence)
we fill the first bin with pulses. */
-#ifdef OPUS_FIXED_POINT_DEBUG
+#ifdef FIXED_POINT_DEBUG
celt_assert2(pulsesLeft<=N+3, "Not enough pulses in the quick pass");
#endif
if (pulsesLeft > N+3)
@@ -259,10 +262,10 @@ unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B, ec_enc *enc
int best_id;
opus_val32 best_num = -VERY_LARGE16;
opus_val16 best_den = 0;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
int rshift;
#endif
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
rshift = 1+celt_ilog2(K-pulsesLeft+i+1);
#endif
best_id = 0;
@@ -346,7 +349,7 @@ unsigned alg_unquant(celt_norm *X, int N, int K, int spread, int B,
void renormalise_vector(celt_norm *X, int N, opus_val16 gain, int arch)
{
int i;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
int k;
#endif
opus_val32 E;
@@ -354,7 +357,7 @@ void renormalise_vector(celt_norm *X, int N, opus_val16 gain, int arch)
opus_val32 t;
celt_norm *xptr;
E = EPSILON + celt_inner_prod(X, X, N, arch);
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
k = celt_ilog2(E)>>1;
#endif
t = VSHR32(E, 2*(k-7));
@@ -394,7 +397,7 @@ int stereo_itheta(const celt_norm *X, const celt_norm *Y, int stereo, int N, int
}
mid = celt_sqrt(Emid);
side = celt_sqrt(Eside);
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
/* 0.63662 = 2/pi */
itheta = MULT16_16_Q15(QCONST16(0.63662f,15),celt_atan2p(side, mid));
#else
diff --git a/drivers/opus/celt/vq.h b/thirdparty/opus/celt/vq.h
index 10b5e55306..5cfcbe50ea 100644
--- a/drivers/opus/celt/vq.h
+++ b/thirdparty/opus/celt/vq.h
@@ -33,12 +33,12 @@
#ifndef VQ_H
#define VQ_H
-#include "opus/celt/entenc.h"
-#include "opus/celt/entdec.h"
-#include "opus/celt/modes.h"
+#include "entenc.h"
+#include "entdec.h"
+#include "modes.h"
#if defined(MIPSr1_ASM)
-#include "opus/celt/mips/vq_mipsr1.h"
+#include "mips/vq_mipsr1.h"
#endif
diff --git a/drivers/opus/celt/x86/celt_lpc_sse.c b/thirdparty/opus/celt/x86/celt_lpc_sse.c
index cfc86dc66c..67e5592acf 100644
--- a/drivers/opus/celt/x86/celt_lpc_sse.c
+++ b/thirdparty/opus/celt/x86/celt_lpc_sse.c
@@ -24,16 +24,19 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <xmmintrin.h>
#include <emmintrin.h>
#include <smmintrin.h>
-#include "opus/celt/celt_lpc.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/celt/mathops.h"
-#include "opus/celt/pitch.h"
-#include "opus/celt/x86/x86cpu.h"
+#include "celt_lpc.h"
+#include "stack_alloc.h"
+#include "mathops.h"
+#include "pitch.h"
+#include "x86cpu.h"
#if defined(FIXED_POINT)
diff --git a/drivers/opus/celt/x86/celt_lpc_sse.h b/thirdparty/opus/celt/x86/celt_lpc_sse.h
index 3787afd3ff..c5ec796ed5 100644
--- a/drivers/opus/celt/x86/celt_lpc_sse.h
+++ b/thirdparty/opus/celt/x86/celt_lpc_sse.h
@@ -27,7 +27,10 @@
#ifndef CELT_LPC_SSE_H
#define CELT_LPC_SSE_H
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#if defined(OPUS_X86_MAY_HAVE_SSE4_1) && defined(FIXED_POINT)
#define OVERRIDE_CELT_FIR
diff --git a/drivers/opus/celt/x86/pitch_sse.c b/thirdparty/opus/celt/x86/pitch_sse.c
index 9f22ffd9ab..20e73126b6 100644
--- a/drivers/opus/celt/x86/pitch_sse.c
+++ b/thirdparty/opus/celt/x86/pitch_sse.c
@@ -24,18 +24,21 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/silk/macros.h"
-#include "opus/celt/celt_lpc.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/celt/mathops.h"
-#include "opus/celt/pitch.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "macros.h"
+#include "celt_lpc.h"
+#include "stack_alloc.h"
+#include "mathops.h"
+#include "pitch.h"
#if defined(OPUS_X86_MAY_HAVE_SSE) && !defined(FIXED_POINT)
#include <xmmintrin.h>
-#include "opus/celt/arch.h"
+#include "arch.h"
void xcorr_kernel_sse(const opus_val16 *x, const opus_val16 *y, opus_val32 sum[4], int len)
{
diff --git a/drivers/opus/celt/x86/pitch_sse.h b/thirdparty/opus/celt/x86/pitch_sse.h
index 2b4b54f61f..d4cbeb8b9c 100644
--- a/drivers/opus/celt/x86/pitch_sse.h
+++ b/thirdparty/opus/celt/x86/pitch_sse.h
@@ -32,7 +32,10 @@
#ifndef PITCH_SSE_H
#define PITCH_SSE_H
-#include "opus/opus_config.h"
+
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
#if defined(OPUS_X86_MAY_HAVE_SSE4_1) && defined(FIXED_POINT)
void xcorr_kernel_sse4_1(
diff --git a/drivers/opus/celt/x86/pitch_sse2.c b/thirdparty/opus/celt/x86/pitch_sse2.c
index b5a78b4acd..a0e7d1beaf 100644
--- a/drivers/opus/celt/x86/pitch_sse2.c
+++ b/thirdparty/opus/celt/x86/pitch_sse2.c
@@ -24,16 +24,19 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <xmmintrin.h>
#include <emmintrin.h>
-#include "opus/silk/macros.h"
-#include "opus/celt/celt_lpc.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/celt/mathops.h"
-#include "opus/celt/pitch.h"
+#include "macros.h"
+#include "celt_lpc.h"
+#include "stack_alloc.h"
+#include "mathops.h"
+#include "pitch.h"
#if defined(OPUS_X86_MAY_HAVE_SSE2) && defined(FIXED_POINT)
opus_val32 celt_inner_prod_sse2(const opus_val16 *x, const opus_val16 *y,
diff --git a/drivers/opus/celt/x86/pitch_sse4_1.c b/thirdparty/opus/celt/x86/pitch_sse4_1.c
index 57fb332210..a092c68b24 100644
--- a/drivers/opus/celt/x86/pitch_sse4_1.c
+++ b/thirdparty/opus/celt/x86/pitch_sse4_1.c
@@ -24,20 +24,23 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <xmmintrin.h>
#include <emmintrin.h>
-#include "opus/silk/macros.h"
-#include "opus/celt/celt_lpc.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/celt/mathops.h"
-#include "opus/celt/pitch.h"
+#include "macros.h"
+#include "celt_lpc.h"
+#include "stack_alloc.h"
+#include "mathops.h"
+#include "pitch.h"
#if defined(OPUS_X86_MAY_HAVE_SSE4_1) && defined(FIXED_POINT)
#include <smmintrin.h>
-#include "opus/celt/x86/x86cpu.h"
+#include "x86cpu.h"
opus_val32 celt_inner_prod_sse4_1(const opus_val16 *x, const opus_val16 *y,
int N)
diff --git a/drivers/opus/celt/x86/x86_celt_map.c b/thirdparty/opus/celt/x86/x86_celt_map.c
index 5146ea2b38..8e5e449275 100644
--- a/drivers/opus/celt/x86/x86_celt_map.c
+++ b/thirdparty/opus/celt/x86/x86_celt_map.c
@@ -24,12 +24,15 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/celt/x86/x86cpu.h"
-#include "opus/celt/celt_lpc.h"
-#include "opus/celt/pitch.h"
-#include "opus/celt/x86/pitch_sse.h"
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
+
+#include "x86/x86cpu.h"
+#include "celt_lpc.h"
+#include "pitch.h"
+#include "pitch_sse.h"
#if defined(OPUS_HAVE_RTCD)
diff --git a/drivers/opus/celt/x86/x86cpu.c b/thirdparty/opus/celt/x86/x86cpu.c
index 91b9b185c2..555a576b8a 100644
--- a/drivers/opus/celt/x86/x86cpu.c
+++ b/thirdparty/opus/celt/x86/x86cpu.c
@@ -24,13 +24,16 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/celt/cpu_support.h"
-#include "opus/silk/macros.h"
-#include "opus/silk/main.h"
-#include "opus/celt/pitch.h"
-#include "opus/celt/x86/x86cpu.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "cpu_support.h"
+#include "macros.h"
+#include "main.h"
+#include "pitch.h"
+#include "x86cpu.h"
#if (defined(OPUS_X86_MAY_HAVE_SSE) && !defined(OPUS_X86_PRESUME_SSE)) || \
(defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(OPUS_X86_PRESUME_SSE2)) || \
diff --git a/drivers/opus/celt/x86/x86cpu.h b/thirdparty/opus/celt/x86/x86cpu.h
index 04fd48aac4..04fd48aac4 100644
--- a/drivers/opus/celt/x86/x86cpu.h
+++ b/thirdparty/opus/celt/x86/x86cpu.h
diff --git a/drivers/opus/opus_config.h b/thirdparty/opus/config.h
index 7b9c92c6a8..7b9c92c6a8 100644
--- a/drivers/opus/opus_config.h
+++ b/thirdparty/opus/config.h
diff --git a/drivers/opus/http.c b/thirdparty/opus/http.c
index 602d514f6e..cfd4e626a4 100644
--- a/drivers/opus/http.c
+++ b/thirdparty/opus/http.c
@@ -9,9 +9,11 @@
* by the Xiph.Org Foundation and contributors http://www.xiph.org/ *
* *
********************************************************************/
-#include "opus/opus_config.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
-#include "opus/internal.h"
+#include "internal.h"
#include <ctype.h>
#include <errno.h>
#include <limits.h>
@@ -212,7 +214,7 @@ static const char *op_parse_file_url(const char *_src){
# include <winsock2.h>
# include <ws2tcpip.h>
# include <openssl/ssl.h>
-# include "opus/winerrno.h"
+# include "winerrno.h"
typedef SOCKET op_sock;
diff --git a/drivers/opus/info.c b/thirdparty/opus/info.c
index b94393351e..55e2906d5f 100644
--- a/drivers/opus/info.c
+++ b/thirdparty/opus/info.c
@@ -9,9 +9,11 @@
* by the Xiph.Org Foundation and contributors http://www.xiph.org/ *
* *
********************************************************************/
-#include "opus/opus_config.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
-#include "opus/internal.h"
+#include "internal.h"
#include <limits.h>
#include <string.h>
diff --git a/drivers/opus/internal.c b/thirdparty/opus/internal.c
index bd7d2ee4bb..96c80def82 100644
--- a/drivers/opus/internal.c
+++ b/thirdparty/opus/internal.c
@@ -9,9 +9,11 @@
* by the Xiph.Org Foundation and contributors http://www.xiph.org/ *
* *
********************************************************************/
-#include "opus/opus_config.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
-#include "opus/internal.h"
+#include "internal.h"
#if defined(OP_ENABLE_ASSERTIONS)
void op_fatal_impl(const char *_str,const char *_file,int _line){
diff --git a/drivers/opus/internal.h b/thirdparty/opus/internal.h
index f7a5bd8c74..ee48ea34c9 100644
--- a/drivers/opus/internal.h
+++ b/thirdparty/opus/internal.h
@@ -29,7 +29,7 @@
# endif
# include <stdlib.h>
-# include "opus/opusfile.h"
+# include <opusfile.h>
typedef struct OggOpusLink OggOpusLink;
diff --git a/drivers/opus/mlp.c b/thirdparty/opus/mlp.c
index 125106e882..ff9e50df47 100644
--- a/drivers/opus/mlp.c
+++ b/thirdparty/opus/mlp.c
@@ -24,15 +24,18 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/opus_types.h"
-#include "opus/opus_defines.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "opus_types.h"
+#include "opus_defines.h"
#include <math.h>
-#include "opus/mlp.h"
-#include "opus/celt/arch.h"
-#include "opus/tansig_table.h"
+#include "mlp.h"
+#include "arch.h"
+#include "tansig_table.h"
#define MAX_NEURONS 100
#if 0
@@ -72,7 +75,7 @@ static OPUS_INLINE float tansig_approx(float x)
return 1;
if (!(x>-8))
return -1;
-#ifndef OPUS_FIXED_POINT
+#ifndef FIXED_POINT
/* Another check in case of -ffast-math */
if (celt_isnan(x))
return 0;
diff --git a/drivers/opus/mlp.h b/thirdparty/opus/mlp.h
index 2b4962625d..618e246e2c 100644
--- a/drivers/opus/mlp.h
+++ b/thirdparty/opus/mlp.h
@@ -28,7 +28,7 @@
#ifndef _MLP_H_
#define _MLP_H_
-#include "opus/celt/arch.h"
+#include "arch.h"
typedef struct {
int layers;
diff --git a/drivers/opus/mlp_data.c b/thirdparty/opus/mlp_data.c
index c542a509cf..c2fda4e2e5 100644
--- a/drivers/opus/mlp_data.c
+++ b/thirdparty/opus/mlp_data.c
@@ -1,8 +1,11 @@
/* The contents of this file was automatically generated by mlp_train.c
It contains multi-layer perceptron (MLP) weights. */
-#include "opus/opus_config.h"
-#include "opus/mlp.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "mlp.h"
/* RMS error was 0.138320, seed was 1361535663 */
diff --git a/drivers/opus/opus.c b/thirdparty/opus/opus.c
index 762a9d7469..e9ce93b308 100644
--- a/drivers/opus/opus.c
+++ b/thirdparty/opus/opus.c
@@ -24,10 +24,13 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/opus.h"
-#include "opus/opus_private.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "opus.h"
+#include "opus_private.h"
#ifndef DISABLE_FLOAT_API
OPUS_EXPORT void opus_pcm_soft_clip(float *_x, int N, int C, float *declip_mem)
diff --git a/drivers/opus/opus.h b/thirdparty/opus/opus.h
index 4cb171378b..b0bdf6f2df 100644
--- a/drivers/opus/opus.h
+++ b/thirdparty/opus/opus.h
@@ -33,8 +33,8 @@
#ifndef OPUS_H
#define OPUS_H
-#include "opus/opus_types.h"
-#include "opus/opus_defines.h"
+#include "opus_types.h"
+#include "opus_defines.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/opus/opus_compare.c b/thirdparty/opus/opus_compare.c
index 06c67d752f..06c67d752f 100644
--- a/drivers/opus/opus_compare.c
+++ b/thirdparty/opus/opus_compare.c
diff --git a/drivers/opus/opus_custom.h b/thirdparty/opus/opus_custom.h
index 32fcb81ac7..41f36bf2fb 100644
--- a/drivers/opus/opus_custom.h
+++ b/thirdparty/opus/opus_custom.h
@@ -35,7 +35,7 @@
#ifndef OPUS_CUSTOM_H
#define OPUS_CUSTOM_H
-#include "opus/opus_defines.h"
+#include "opus_defines.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/opus/opus_decoder.c b/thirdparty/opus/opus_decoder.c
index b954b98f02..080bec5072 100644
--- a/drivers/opus/opus_decoder.c
+++ b/thirdparty/opus/opus_decoder.c
@@ -24,7 +24,10 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#ifndef OPUS_BUILD
# error "OPUS_BUILD _MUST_ be defined to build Opus. This probably means you need other defines as well, as in a config.h. See the included build files for details."
@@ -35,19 +38,19 @@
#endif
#include <stdarg.h>
-#include "opus/celt/celt.h"
-#include "opus/opus.h"
-#include "opus/celt/entdec.h"
-#include "opus/celt/modes.h"
-#include "opus/silk/API.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/celt/float_cast.h"
-#include "opus/opus_private.h"
-#include "opus/celt/os_support.h"
-#include "opus/silk/structs.h"
-#include "opus/silk/define.h"
-#include "opus/celt/mathops.h"
-#include "opus/celt/cpu_support.h"
+#include "celt.h"
+#include "opus.h"
+#include "entdec.h"
+#include "modes.h"
+#include "API.h"
+#include "stack_alloc.h"
+#include "float_cast.h"
+#include "opus_private.h"
+#include "os_support.h"
+#include "structs.h"
+#include "define.h"
+#include "mathops.h"
+#include "cpu_support.h"
struct OpusDecoder {
int celt_dec_offset;
@@ -68,7 +71,7 @@ struct OpusDecoder {
int frame_size;
int prev_redundancy;
int last_packet_duration;
-#ifndef OPUS_FIXED_POINT
+#ifndef FIXED_POINT
opus_val16 softclip_mem[2];
#endif
@@ -291,7 +294,7 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
/* In fixed-point, we can tell CELT to do the accumulation on top of the
SILK PCM buffer. This saves some stack space. */
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
celt_accum = (mode != MODE_CELT_ONLY) && (frame_size >= F10);
#else
celt_accum = 0;
@@ -335,7 +338,7 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
{
int lost_flag, decoded_samples;
opus_int16 *pcm_ptr;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
if (celt_accum)
pcm_ptr = pcm;
else
@@ -504,7 +507,7 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
if (mode != MODE_CELT_ONLY && !celt_accum)
{
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
for (i=0;i<frame_size*st->channels;i++)
pcm[i] = SAT16(ADD32(pcm[i], pcm_silk[i]));
#else
@@ -696,7 +699,7 @@ int opus_decode_native(OpusDecoder *st, const unsigned char *data,
st->last_packet_duration = nb_samples;
if (OPUS_CHECK_ARRAY(pcm, nb_samples*st->channels))
OPUS_PRINT_INT(nb_samples);
-#ifndef OPUS_FIXED_POINT
+#ifndef FIXED_POINT
if (soft_clip)
opus_pcm_soft_clip(pcm, nb_samples, st->channels, st->softclip_mem);
else
@@ -705,7 +708,7 @@ int opus_decode_native(OpusDecoder *st, const unsigned char *data,
return nb_samples;
}
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
int opus_decode(OpusDecoder *st, const unsigned char *data,
opus_int32 len, opus_val16 *pcm, int frame_size, int decode_fec)
diff --git a/drivers/opus/opus_defines.h b/thirdparty/opus/opus_defines.h
index b972ce0eb9..647ed5d6f2 100644
--- a/drivers/opus/opus_defines.h
+++ b/thirdparty/opus/opus_defines.h
@@ -33,7 +33,7 @@
#ifndef OPUS_DEFINES_H
#define OPUS_DEFINES_H
-#include "opus/opus_types.h"
+#include "opus_types.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/opus/opus_encoder.c b/thirdparty/opus/opus_encoder.c
index 5c6af5a199..a7e19127d6 100644
--- a/drivers/opus/opus_encoder.c
+++ b/thirdparty/opus/opus_encoder.c
@@ -24,28 +24,31 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <stdarg.h>
-#include "opus/celt/celt.h"
-#include "opus/celt/entenc.h"
-#include "opus/celt/modes.h"
-#include "opus/silk/API.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/celt/float_cast.h"
-#include "opus/opus.h"
-#include "opus/celt/arch.h"
-#include "opus/celt/pitch.h"
-#include "opus/opus_private.h"
-#include "opus/celt/os_support.h"
-#include "opus/celt/cpu_support.h"
-#include "opus/analysis.h"
-#include "opus/celt/mathops.h"
-#include "opus/silk/tuning_parameters.h"
-#ifdef OPUS_FIXED_POINT
-#include "opus/silk/fixed/structs_FIX.h"
+#include "celt.h"
+#include "entenc.h"
+#include "modes.h"
+#include "API.h"
+#include "stack_alloc.h"
+#include "float_cast.h"
+#include "opus.h"
+#include "arch.h"
+#include "pitch.h"
+#include "opus_private.h"
+#include "os_support.h"
+#include "cpu_support.h"
+#include "analysis.h"
+#include "mathops.h"
+#include "tuning_parameters.h"
+#ifdef FIXED_POINT
+#include "fixed/structs_FIX.h"
#else
-#include "opus/silk/float/structs_FLP.h"
+#include "float/structs_FLP.h"
#endif
#define MAX_ENCODER_BUFFER 480
@@ -280,7 +283,7 @@ static unsigned char gen_toc(int mode, int framerate, int bandwidth, int channel
return toc;
}
-#ifndef OPUS_FIXED_POINT
+#ifndef FIXED_POINT
static void silk_biquad_float(
const opus_val16 *in, /* I: Input signal */
const opus_int32 *B_Q28, /* I: MA coefficients [3] */
@@ -342,7 +345,7 @@ static void hp_cutoff(const opus_val16 *in, opus_int32 cutoff_Hz, opus_val16 *ou
A_Q28[ 0 ] = silk_SMULWW( r_Q22, silk_SMULWW( Fc_Q19, Fc_Q19 ) - SILK_FIX_CONST( 2.0, 22 ) );
A_Q28[ 1 ] = silk_SMULWW( r_Q22, r_Q22 );
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
silk_biquad_alt( in, B_Q28, A_Q28, hp_mem, out, len, channels );
if( channels == 2 ) {
silk_biquad_alt( in+1, B_Q28, A_Q28, hp_mem+2, out+1, len, channels );
@@ -355,7 +358,7 @@ static void hp_cutoff(const opus_val16 *in, opus_int32 cutoff_Hz, opus_val16 *ou
#endif
}
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
static void dc_reject(const opus_val16 *in, opus_int32 cutoff_Hz, opus_val16 *out, opus_val32 *hp_mem, int len, int channels, opus_int32 Fs)
{
int c, i;
@@ -727,7 +730,7 @@ static int optimize_framesize(const void *x, int len, int C, opus_int32 Fs,
#endif
#ifndef DISABLE_FLOAT_API
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
#define PCM2VAL(x) FLOAT2INT16(x)
#else
#define PCM2VAL(x) SCALEIN(x)
@@ -753,7 +756,7 @@ void downmix_float(const void *_x, opus_val32 *sub, int subframe, int offset, in
sub[j] += PCM2VAL(x[(j+offset)*C+c]);
}
}
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
scale = (1<<SIG_SHIFT);
#else
scale = 1.f;
@@ -788,7 +791,7 @@ void downmix_int(const void *_x, opus_val32 *sub, int subframe, int offset, int
sub[j] += x[(j+offset)*C+c];
}
}
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
scale = (1<<SIG_SHIFT);
#else
scale = 1.f/32768;
@@ -998,7 +1001,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
celt_encoder_ctl(celt_enc, CELT_GET_MODE(&celt_mode));
#ifndef DISABLE_FLOAT_API
analysis_info.valid = 0;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
if (st->silk_mode.complexity >= 10 && st->Fs==48000)
#else
if (st->silk_mode.complexity >= 7 && st->Fs==48000)
@@ -1459,7 +1462,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
} else {
dc_reject(pcm, 3, &pcm_buf[total_buffer*st->channels], st->hp_mem, frame_size, st->channels, st->Fs);
}
-#ifndef OPUS_FIXED_POINT
+#ifndef FIXED_POINT
if (float_api)
{
opus_val32 sum;
@@ -1480,7 +1483,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
if (st->mode != MODE_CELT_ONLY)
{
opus_int32 total_bitRate, celt_rate;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
const opus_int16 *pcm_silk;
#else
VARDECL(opus_int16, pcm_silk);
@@ -1628,7 +1631,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
gain_fade(st->delay_buffer+prefill_offset, st->delay_buffer+prefill_offset,
0, Q15ONE, celt_mode->overlap, st->Fs/400, st->channels, celt_mode->window, st->Fs);
OPUS_CLEAR(st->delay_buffer, prefill_offset);
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
pcm_silk = st->delay_buffer;
#else
for (i=0;i<st->encoder_buffer*st->channels;i++)
@@ -1637,7 +1640,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
silk_Encode( silk_enc, &st->silk_mode, pcm_silk, st->encoder_buffer, NULL, &zero, 1 );
}
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
pcm_silk = pcm_buf+total_buffer*st->channels;
#else
for (i=0;i<frame_size*st->channels;i++)
@@ -1781,7 +1784,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
opus_val16 g1, g2;
g1 = st->hybrid_stereo_width_Q14;
g2 = (opus_val16)(st->silk_mode.stereoWidth_Q14);
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
g1 = g1==16384 ? Q15ONE : SHL16(g1,1);
g2 = g2==16384 ? Q15ONE : SHL16(g2,1);
#else
@@ -1961,7 +1964,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
return ret;
}
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
#ifndef DISABLE_FLOAT_API
opus_int32 opus_encode_float(OpusEncoder *st, const float *pcm, int analysis_frame_size,
diff --git a/drivers/opus/opus_multistream.c b/thirdparty/opus/opus_multistream.c
index aa94803779..09c3639b7f 100644
--- a/drivers/opus/opus_multistream.c
+++ b/thirdparty/opus/opus_multistream.c
@@ -24,15 +24,18 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/opus_multistream.h"
-#include "opus/opus.h"
-#include "opus/opus_private.h"
-#include "opus/celt/stack_alloc.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "opus_multistream.h"
+#include "opus.h"
+#include "opus_private.h"
+#include "stack_alloc.h"
#include <stdarg.h>
-#include "opus/celt/float_cast.h"
-#include "opus/celt/os_support.h"
+#include "float_cast.h"
+#include "os_support.h"
int validate_layout(const ChannelLayout *layout)
diff --git a/drivers/opus/opus_multistream.h b/thirdparty/opus/opus_multistream.h
index 5519c46a9f..47e03900bd 100644
--- a/drivers/opus/opus_multistream.h
+++ b/thirdparty/opus/opus_multistream.h
@@ -33,7 +33,7 @@
#ifndef OPUS_MULTISTREAM_H
#define OPUS_MULTISTREAM_H
-#include "opus/opus.h"
+#include "opus.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/opus/opus_multistream_decoder.c b/thirdparty/opus/opus_multistream_decoder.c
index 25100edba2..b95eaa6eac 100644
--- a/drivers/opus/opus_multistream_decoder.c
+++ b/thirdparty/opus/opus_multistream_decoder.c
@@ -24,15 +24,18 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/opus_multistream.h"
-#include "opus/opus.h"
-#include "opus/opus_private.h"
-#include "opus/celt/stack_alloc.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "opus_multistream.h"
+#include "opus.h"
+#include "opus_private.h"
+#include "stack_alloc.h"
#include <stdarg.h>
-#include "opus/celt/float_cast.h"
-#include "opus/celt/os_support.h"
+#include "float_cast.h"
+#include "os_support.h"
struct OpusMSDecoder {
ChannelLayout layout;
@@ -358,7 +361,7 @@ static void opus_copy_channel_out_short(
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
int opus_multistream_decode(
OpusMSDecoder *st,
const unsigned char *data,
diff --git a/drivers/opus/opus_multistream_encoder.c b/thirdparty/opus/opus_multistream_encoder.c
index 426c72e997..9e85773573 100644
--- a/drivers/opus/opus_multistream_encoder.c
+++ b/thirdparty/opus/opus_multistream_encoder.c
@@ -24,21 +24,24 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/opus_multistream.h"
-#include "opus/opus.h"
-#include "opus/opus_private.h"
-#include "opus/celt/stack_alloc.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "opus_multistream.h"
+#include "opus.h"
+#include "opus_private.h"
+#include "stack_alloc.h"
#include <stdarg.h>
-#include "opus/celt/float_cast.h"
-#include "opus/celt/os_support.h"
-#include "opus/celt/mathops.h"
-#include "opus/celt/mdct.h"
-#include "opus/celt/modes.h"
-#include "opus/celt/bands.h"
-#include "opus/celt/quant_bands.h"
-#include "opus/celt/pitch.h"
+#include "float_cast.h"
+#include "os_support.h"
+#include "mathops.h"
+#include "mdct.h"
+#include "modes.h"
+#include "bands.h"
+#include "quant_bands.h"
+#include "pitch.h"
typedef struct {
int nb_streams;
@@ -202,7 +205,7 @@ static opus_val16 logSum(opus_val16 a, opus_val16 b)
}
if (!(diff < QCONST16(8.f, DB_SHIFT))) /* inverted to catch NaNs */
return max;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
low = SHR32(diff, DB_SHIFT-1);
frac = SHL16(diff - SHL16(low, DB_SHIFT-1), 16-DB_SHIFT);
#else
@@ -258,7 +261,7 @@ void surround_analysis(const CELTMode *celt_mode, const void *pcm, opus_val16 *b
OPUS_COPY(in, mem+c*overlap, overlap);
(*copy_channel_in)(x, 1, pcm, channels, c, len);
celt_preemphasis(x, in+overlap, frame_size, 1, upsample, celt_mode->preemph, preemph_mem+c, 0);
-#ifndef OPUS_FIXED_POINT
+#ifndef FIXED_POINT
{
opus_val32 sum;
sum = celt_inner_prod(in, in, frame_size+overlap, 0);
@@ -668,7 +671,7 @@ static opus_int32 surround_rate_allocation(
+ nb_lfe*lfe_ratio;
channel_rate = 256*(st->bitrate_bps-lfe_offset*nb_lfe-stream_offset*(nb_coupled+nb_uncoupled))/total;
}
-#ifndef OPUS_FIXED_POINT
+#ifndef FIXED_POINT
if (st->variable_duration==OPUS_FRAMESIZE_VARIABLE && frame_size != Fs/50)
{
opus_int32 bonus;
@@ -955,7 +958,7 @@ static void opus_copy_channel_in_short(
}
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
int opus_multistream_encode(
OpusMSEncoder *st,
const opus_val16 *pcm,
diff --git a/drivers/opus/opus_private.h b/thirdparty/opus/opus_private.h
index 129977ed11..3b62eed096 100644
--- a/drivers/opus/opus_private.h
+++ b/thirdparty/opus/opus_private.h
@@ -29,9 +29,9 @@
#ifndef OPUS_PRIVATE_H
#define OPUS_PRIVATE_H
-#include "opus/celt/arch.h"
-#include "opus/opus.h"
-#include "opus/celt/celt.h"
+#include "arch.h"
+#include "opus.h"
+#include "celt.h"
#include <stddef.h> /* offsetof */
diff --git a/drivers/opus/opus_types.h b/thirdparty/opus/opus_types.h
index b28e03aea2..b28e03aea2 100644
--- a/drivers/opus/opus_types.h
+++ b/thirdparty/opus/opus_types.h
diff --git a/drivers/opus/opusfile.c b/thirdparty/opus/opusfile.c
index a9d6cc4d63..9c9b684ca4 100644
--- a/drivers/opus/opusfile.c
+++ b/thirdparty/opus/opusfile.c
@@ -14,9 +14,11 @@
last mod: $Id: vorbisfile.c 17573 2010-10-27 14:53:59Z xiphmont $
********************************************************************/
-#include "opus/opus_config.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
-#include "opus/internal.h"
+#include "internal.h"
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
@@ -24,7 +26,7 @@
#include <string.h>
#include <math.h>
-#include "opus/opusfile.h"
+#include "opusfile.h"
/*This implementation is largely based off of libvorbisfile.
All of the Ogg bits work roughly the same, though I have made some
diff --git a/drivers/opus/opusfile.h b/thirdparty/opus/opusfile.h
index da31a29769..3604115c31 100644
--- a/drivers/opus/opusfile.h
+++ b/thirdparty/opus/opusfile.h
@@ -107,7 +107,7 @@ extern "C" {
# include <stdarg.h>
# include <stdio.h>
# include <ogg/ogg.h>
-# include "opus/opus_multistream.h"
+# include <opus_multistream.h>
/**@cond PRIVATE*/
diff --git a/drivers/opus/repacketizer.c b/thirdparty/opus/repacketizer.c
index 3822f9c86f..f27e9ab958 100644
--- a/drivers/opus/repacketizer.c
+++ b/thirdparty/opus/repacketizer.c
@@ -24,11 +24,14 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/opus.h"
-#include "opus/opus_private.h"
-#include "opus/celt/os_support.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "opus.h"
+#include "opus_private.h"
+#include "os_support.h"
int opus_repacketizer_get_size(void)
diff --git a/drivers/opus/repacketizer_demo.c b/thirdparty/opus/repacketizer_demo.c
index 57acf6a53f..dc05c1b359 100644
--- a/drivers/opus/repacketizer_demo.c
+++ b/thirdparty/opus/repacketizer_demo.c
@@ -24,9 +24,12 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/opus.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "opus.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/drivers/opus/silk/A2NLSF.c b/thirdparty/opus/silk/A2NLSF.c
index 38dbefc3bf..b6e9e5ffcc 100644
--- a/drivers/opus/silk/A2NLSF.c
+++ b/thirdparty/opus/silk/A2NLSF.c
@@ -30,10 +30,13 @@ POSSIBILITY OF SUCH DAMAGE.
/* A piecewise linear approximation maps LSF <-> cos(LSF) */
/* Therefore the result is not accurate NLSFs, but the two */
/* functions are accurate inverses of each other */
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/silk/tables.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
+#include "tables.h"
/* Number of binary divisions, when not in low complexity mode */
#define BIN_DIV_STEPS_A2NLSF_FIX 3 /* must be no higher than 16 - log2( LSF_COS_TAB_SZ_FIX ) */
diff --git a/drivers/opus/silk/API.h b/thirdparty/opus/silk/API.h
index ce868c0c99..0131acbb08 100644
--- a/drivers/opus/silk/API.h
+++ b/thirdparty/opus/silk/API.h
@@ -28,11 +28,11 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_API_H
#define SILK_API_H
-#include "opus/silk/control.h"
-#include "opus/silk/typedef.h"
-#include "opus/silk/errors.h"
-#include "opus/celt/entenc.h"
-#include "opus/celt/entdec.h"
+#include "control.h"
+#include "typedef.h"
+#include "errors.h"
+#include "entenc.h"
+#include "entdec.h"
#ifdef __cplusplus
extern "C"
diff --git a/drivers/opus/silk/CNG.c b/thirdparty/opus/silk/CNG.c
index 595a288865..61787c2302 100644
--- a/drivers/opus/silk/CNG.c
+++ b/thirdparty/opus/silk/CNG.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
-#include "opus/celt/stack_alloc.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
+#include "stack_alloc.h"
/* Generates excitation for CNG LPC synthesis */
static OPUS_INLINE void silk_CNG_exc(
diff --git a/drivers/opus/silk/HP_variable_cutoff.c b/thirdparty/opus/silk/HP_variable_cutoff.c
index 6b93fdb5a3..bbe10f04ce 100644
--- a/drivers/opus/silk/HP_variable_cutoff.c
+++ b/thirdparty/opus/silk/HP_variable_cutoff.c
@@ -24,13 +24,16 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#ifdef OPUS_FIXED_POINT
-#include "opus/silk/fixed/main_FIX.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#ifdef FIXED_POINT
+#include "main_FIX.h"
#else
-#include "opus/silk/float/main_FLP.h"
+#include "main_FLP.h"
#endif
-#include "opus/silk/tuning_parameters.h"
+#include "tuning_parameters.h"
/* High-pass filter with cutoff frequency adaptation based on pitch lag statistics */
void silk_HP_variable_cutoff(
diff --git a/drivers/opus/silk/Inlines.h b/thirdparty/opus/silk/Inlines.h
index ec986cdfdd..ec986cdfdd 100644
--- a/drivers/opus/silk/Inlines.h
+++ b/thirdparty/opus/silk/Inlines.h
diff --git a/drivers/opus/silk/LPC_analysis_filter.c b/thirdparty/opus/silk/LPC_analysis_filter.c
index f3c34b5482..20906673ff 100644
--- a/drivers/opus/silk/LPC_analysis_filter.c
+++ b/thirdparty/opus/silk/LPC_analysis_filter.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/celt/celt_lpc.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
+#include "celt_lpc.h"
/*******************************************/
/* LPC analysis filter */
@@ -46,7 +49,7 @@ void silk_LPC_analysis_filter(
)
{
opus_int j;
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
opus_int16 mem[SILK_MAX_ORDER_LPC];
opus_int16 num[SILK_MAX_ORDER_LPC];
#else
@@ -59,7 +62,7 @@ void silk_LPC_analysis_filter(
silk_assert( (d & 1) == 0 );
silk_assert( d <= len );
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
silk_assert( d <= SILK_MAX_ORDER_LPC );
for ( j = 0; j < d; j++ ) {
num[ j ] = -B[ j ];
diff --git a/drivers/opus/silk/LPC_inv_pred_gain.c b/thirdparty/opus/silk/LPC_inv_pred_gain.c
index 8ace51500c..4af89aa5fa 100644
--- a/drivers/opus/silk/LPC_inv_pred_gain.c
+++ b/thirdparty/opus/silk/LPC_inv_pred_gain.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
#define QA 24
#define A_LIMIT SILK_FIX_CONST( 0.99975, QA )
@@ -127,7 +130,7 @@ opus_int32 silk_LPC_inverse_pred_gain( /* O Returns inverse predi
return LPC_inverse_pred_gain_QA( Atmp_QA, order );
}
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
/* For input in Q24 domain */
opus_int32 silk_LPC_inverse_pred_gain_Q24( /* O Returns inverse prediction gain in energy domain, Q30 */
diff --git a/drivers/opus/silk/LP_variable_cutoff.c b/thirdparty/opus/silk/LP_variable_cutoff.c
index b39497c4d9..f639e1f899 100644
--- a/drivers/opus/silk/LP_variable_cutoff.c
+++ b/thirdparty/opus/silk/LP_variable_cutoff.c
@@ -24,7 +24,10 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
/*
Elliptic/Cauer filters designed with 0.1 dB passband ripple,
@@ -32,7 +35,7 @@ POSSIBILITY OF SUCH DAMAGE.
[0.95 : 0.15 : 0.35] normalized cut off frequencies.
*/
-#include "opus/silk/main.h"
+#include "main.h"
/* Helper function, interpolates the filter taps */
static OPUS_INLINE void silk_LP_interpolate_filter_taps(
diff --git a/drivers/opus/silk/MacroCount.h b/thirdparty/opus/silk/MacroCount.h
index 834817d058..834817d058 100644
--- a/drivers/opus/silk/MacroCount.h
+++ b/thirdparty/opus/silk/MacroCount.h
diff --git a/drivers/opus/silk/MacroDebug.h b/thirdparty/opus/silk/MacroDebug.h
index 35aedc5c5f..35aedc5c5f 100644
--- a/drivers/opus/silk/MacroDebug.h
+++ b/thirdparty/opus/silk/MacroDebug.h
diff --git a/drivers/opus/silk/NLSF2A.c b/thirdparty/opus/silk/NLSF2A.c
index 09db1c1c3f..b1c559ea68 100644
--- a/drivers/opus/silk/NLSF2A.c
+++ b/thirdparty/opus/silk/NLSF2A.c
@@ -24,7 +24,10 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
/* conversion between prediction filter coefficients and LSFs */
/* order should be even */
@@ -32,8 +35,8 @@ POSSIBILITY OF SUCH DAMAGE.
/* therefore the result is not accurate LSFs, but the two */
/* functions are accurate inverses of each other */
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/silk/tables.h"
+#include "SigProc_FIX.h"
+#include "tables.h"
#define QA 16
diff --git a/drivers/opus/silk/NLSF_VQ.c b/thirdparty/opus/silk/NLSF_VQ.c
index 99a37d4e0d..69b6e22e18 100644
--- a/drivers/opus/silk/NLSF_VQ.c
+++ b/thirdparty/opus/silk/NLSF_VQ.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
/* Compute quantization errors for an LPC_order element input vector for a VQ codebook */
void silk_NLSF_VQ(
diff --git a/drivers/opus/silk/NLSF_VQ_weights_laroia.c b/thirdparty/opus/silk/NLSF_VQ_weights_laroia.c
index 5743a4dee9..04894c59ab 100644
--- a/drivers/opus/silk/NLSF_VQ_weights_laroia.c
+++ b/thirdparty/opus/silk/NLSF_VQ_weights_laroia.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/define.h"
-#include "opus/silk/SigProc_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "define.h"
+#include "SigProc_FIX.h"
/*
R. Laroia, N. Phamdo and N. Farvardin, "Robust and Efficient Quantization of Speech LSP
diff --git a/drivers/opus/silk/NLSF_decode.c b/thirdparty/opus/silk/NLSF_decode.c
index 6b922f3eee..9f715060b8 100644
--- a/drivers/opus/silk/NLSF_decode.c
+++ b/thirdparty/opus/silk/NLSF_decode.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
/* Predictive dequantizer for NLSF residuals */
static OPUS_INLINE void silk_NLSF_residual_dequant( /* O Returns RD value in Q30 */
diff --git a/drivers/opus/silk/NLSF_del_dec_quant.c b/thirdparty/opus/silk/NLSF_del_dec_quant.c
index 3f81b2028c..c3b9efccfa 100644
--- a/drivers/opus/silk/NLSF_del_dec_quant.c
+++ b/thirdparty/opus/silk/NLSF_del_dec_quant.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
/* Delayed-decision quantizer for NLSF residuals */
opus_int32 silk_NLSF_del_dec_quant( /* O Returns RD value in Q25 */
diff --git a/drivers/opus/silk/NLSF_encode.c b/thirdparty/opus/silk/NLSF_encode.c
index 9efb3e5158..03a036fda2 100644
--- a/drivers/opus/silk/NLSF_encode.c
+++ b/thirdparty/opus/silk/NLSF_encode.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
-#include "opus/celt/stack_alloc.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
+#include "stack_alloc.h"
/***********************/
/* NLSF vector encoder */
diff --git a/drivers/opus/silk/NLSF_stabilize.c b/thirdparty/opus/silk/NLSF_stabilize.c
index 1a45e16925..1fa1ea379b 100644
--- a/drivers/opus/silk/NLSF_stabilize.c
+++ b/thirdparty/opus/silk/NLSF_stabilize.c
@@ -24,7 +24,10 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
/* NLSF stabilizer: */
/* */
@@ -35,7 +38,7 @@ POSSIBILITY OF SUCH DAMAGE.
/* - Output are sorted NLSF coefficients */
/* */
-#include "opus/silk/SigProc_FIX.h"
+#include "SigProc_FIX.h"
/* Constant Definitions */
#define MAX_LOOPS 20
diff --git a/drivers/opus/silk/NLSF_unpack.c b/thirdparty/opus/silk/NLSF_unpack.c
index c958f4a6ef..17bd23f752 100644
--- a/drivers/opus/silk/NLSF_unpack.c
+++ b/thirdparty/opus/silk/NLSF_unpack.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
/* Unpack predictor values and indices for entropy coding tables */
void silk_NLSF_unpack(
diff --git a/drivers/opus/silk/NSQ.c b/thirdparty/opus/silk/NSQ.c
index e41e533bde..a065884070 100644
--- a/drivers/opus/silk/NSQ.c
+++ b/thirdparty/opus/silk/NSQ.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
-#include "opus/celt/stack_alloc.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
+#include "stack_alloc.h"
static OPUS_INLINE void silk_nsq_scale_states(
const silk_encoder_state *psEncC, /* I Encoder State */
diff --git a/thirdparty/opus/silk/NSQ.h b/thirdparty/opus/silk/NSQ.h
new file mode 100644
index 0000000000..971832f660
--- /dev/null
+++ b/thirdparty/opus/silk/NSQ.h
@@ -0,0 +1,101 @@
+/***********************************************************************
+Copyright (c) 2014 Vidyo.
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+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 Internet Society, IETF or IETF Trust, nor the
+names of specific 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 COPYRIGHT OWNER 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.
+***********************************************************************/
+#ifndef SILK_NSQ_H
+#define SILK_NSQ_H
+
+#include "SigProc_FIX.h"
+
+#undef silk_short_prediction_create_arch_coef
+
+static OPUS_INLINE opus_int32 silk_noise_shape_quantizer_short_prediction_c(const opus_int32 *buf32, const opus_int16 *coef16, opus_int order)
+{
+ opus_int32 out;
+ silk_assert( order == 10 || order == 16 );
+
+ /* Avoids introducing a bias because silk_SMLAWB() always rounds to -inf */
+ out = silk_RSHIFT( order, 1 );
+ out = silk_SMLAWB( out, buf32[ 0 ], coef16[ 0 ] );
+ out = silk_SMLAWB( out, buf32[ -1 ], coef16[ 1 ] );
+ out = silk_SMLAWB( out, buf32[ -2 ], coef16[ 2 ] );
+ out = silk_SMLAWB( out, buf32[ -3 ], coef16[ 3 ] );
+ out = silk_SMLAWB( out, buf32[ -4 ], coef16[ 4 ] );
+ out = silk_SMLAWB( out, buf32[ -5 ], coef16[ 5 ] );
+ out = silk_SMLAWB( out, buf32[ -6 ], coef16[ 6 ] );
+ out = silk_SMLAWB( out, buf32[ -7 ], coef16[ 7 ] );
+ out = silk_SMLAWB( out, buf32[ -8 ], coef16[ 8 ] );
+ out = silk_SMLAWB( out, buf32[ -9 ], coef16[ 9 ] );
+
+ if( order == 16 )
+ {
+ out = silk_SMLAWB( out, buf32[ -10 ], coef16[ 10 ] );
+ out = silk_SMLAWB( out, buf32[ -11 ], coef16[ 11 ] );
+ out = silk_SMLAWB( out, buf32[ -12 ], coef16[ 12 ] );
+ out = silk_SMLAWB( out, buf32[ -13 ], coef16[ 13 ] );
+ out = silk_SMLAWB( out, buf32[ -14 ], coef16[ 14 ] );
+ out = silk_SMLAWB( out, buf32[ -15 ], coef16[ 15 ] );
+ }
+ return out;
+}
+
+#define silk_noise_shape_quantizer_short_prediction(in, coef, coefRev, order, arch) ((void)arch,silk_noise_shape_quantizer_short_prediction_c(in, coef, order))
+
+static OPUS_INLINE opus_int32 silk_NSQ_noise_shape_feedback_loop_c(const opus_int32 *data0, opus_int32 *data1, const opus_int16 *coef, opus_int order)
+{
+ opus_int32 out;
+ opus_int32 tmp1, tmp2;
+ opus_int j;
+
+ tmp2 = data0[0];
+ tmp1 = data1[0];
+ data1[0] = tmp2;
+
+ out = silk_RSHIFT(order, 1);
+ out = silk_SMLAWB(out, tmp2, coef[0]);
+
+ for (j = 2; j < order; j += 2) {
+ tmp2 = data1[j - 1];
+ data1[j - 1] = tmp1;
+ out = silk_SMLAWB(out, tmp1, coef[j - 1]);
+ tmp1 = data1[j + 0];
+ data1[j + 0] = tmp2;
+ out = silk_SMLAWB(out, tmp2, coef[j]);
+ }
+ data1[order - 1] = tmp1;
+ out = silk_SMLAWB(out, tmp1, coef[order - 1]);
+ /* Q11 -> Q12 */
+ out = silk_LSHIFT32( out, 1 );
+ return out;
+}
+
+#define silk_NSQ_noise_shape_feedback_loop(data0, data1, coef, order, arch) ((void)arch,silk_NSQ_noise_shape_feedback_loop_c(data0, data1, coef, order))
+
+#if defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
+#include "arm/NSQ_neon.h"
+#endif
+
+#endif /* SILK_NSQ_H */
diff --git a/drivers/opus/silk/NSQ_del_dec.c b/thirdparty/opus/silk/NSQ_del_dec.c
index 28b385e415..aff560c221 100644
--- a/drivers/opus/silk/NSQ_del_dec.c
+++ b/thirdparty/opus/silk/NSQ_del_dec.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
-#include "opus/celt/stack_alloc.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
+#include "stack_alloc.h"
typedef struct {
opus_int32 sLPC_Q14[ MAX_SUB_FRAME_LENGTH + NSQ_LPC_BUF_LENGTH ];
@@ -55,7 +58,7 @@ typedef struct {
typedef NSQ_sample_struct NSQ_sample_pair[ 2 ];
#if defined(MIPSr1_ASM)
-#include "opus/silk/mips/NSQ_del_dec_mipsr1.h"
+#include "mips/NSQ_del_dec_mipsr1.h"
#endif
static OPUS_INLINE void silk_nsq_del_dec_scale_states(
const silk_encoder_state *psEncC, /* I Encoder State */
diff --git a/drivers/opus/silk/PLC.c b/thirdparty/opus/silk/PLC.c
index 4007112c5a..34a94bc313 100644
--- a/drivers/opus/silk/PLC.c
+++ b/thirdparty/opus/silk/PLC.c
@@ -24,11 +24,14 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/silk/PLC.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
+#include "stack_alloc.h"
+#include "PLC.h"
#define NB_ATT 2
static const opus_int16 HARM_ATT_Q15[NB_ATT] = { 32440, 31130 }; /* 0.99, 0.95 */
diff --git a/drivers/opus/silk/PLC.h b/thirdparty/opus/silk/PLC.h
index 209c2de48f..6438f51633 100644
--- a/drivers/opus/silk/PLC.h
+++ b/thirdparty/opus/silk/PLC.h
@@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_PLC_H
#define SILK_PLC_H
-#include "opus/silk/main.h"
+#include "main.h"
#define BWE_COEF 0.99
#define V_PITCH_GAIN_START_MIN_Q14 11469 /* 0.7 in Q14 */
diff --git a/drivers/opus/silk/SigProc_FIX.h b/thirdparty/opus/silk/SigProc_FIX.h
index 743cf7800c..b63299441e 100644
--- a/drivers/opus/silk/SigProc_FIX.h
+++ b/thirdparty/opus/silk/SigProc_FIX.h
@@ -38,13 +38,13 @@ extern "C"
#define SILK_MAX_ORDER_LPC 16 /* max order of the LPC analysis in schur() and k2a() */
#include <string.h> /* for memset(), memcpy(), memmove() */
-#include "opus/silk/typedef.h"
-#include "opus/silk/resampler_structs.h"
-#include "opus/silk/macros.h"
-#include "opus/celt/cpu_support.h"
+#include "typedef.h"
+#include "resampler_structs.h"
+#include "macros.h"
+#include "cpu_support.h"
#if defined(OPUS_X86_MAY_HAVE_SSE4_1)
-#include "opus/silk/x86/SigProc_FIX_sse.h"
+#include "x86/SigProc_FIX_sse.h"
#endif
/********************************************************************/
@@ -591,20 +591,20 @@ static OPUS_INLINE opus_int64 silk_max_64(opus_int64 a, opus_int64 b)
((void)(arch),silk_inner_prod16_aligned_64_c(inVec1, inVec2, len))
#endif
-#include "opus/silk/Inlines.h"
-#include "opus/silk/MacroCount.h"
-#include "opus/silk/MacroDebug.h"
+#include "Inlines.h"
+#include "MacroCount.h"
+#include "MacroDebug.h"
#ifdef OPUS_ARM_INLINE_ASM
-#include "opus/silk/arm/SigProc_FIX_armv4.h"
+#include "arm/SigProc_FIX_armv4.h"
#endif
#ifdef OPUS_ARM_INLINE_EDSP
-#include "opus/silk/arm/SigProc_FIX_armv5e.h"
+#include "arm/SigProc_FIX_armv5e.h"
#endif
#if defined(MIPSr1_ASM)
-#include "opus/silk/mips/sigproc_fix_mipsr1.h"
+#include "mips/sigproc_fix_mipsr1.h"
#endif
diff --git a/drivers/opus/silk/VAD.c b/thirdparty/opus/silk/VAD.c
index bb664cff87..0a782af2f1 100644
--- a/drivers/opus/silk/VAD.c
+++ b/thirdparty/opus/silk/VAD.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
-#include "opus/celt/stack_alloc.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
+#include "stack_alloc.h"
/* Silk VAD noise level estimation */
# if !defined(OPUS_X86_MAY_HAVE_SSE4_1)
diff --git a/drivers/opus/silk/VQ_WMat_EC.c b/thirdparty/opus/silk/VQ_WMat_EC.c
index fec9ee8dde..7983f1db80 100644
--- a/drivers/opus/silk/VQ_WMat_EC.c
+++ b/thirdparty/opus/silk/VQ_WMat_EC.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
/* Entropy constrained matrix-weighted VQ, hard-coded to 5-element vectors, for a single input data vector */
void silk_VQ_WMat_EC_c(
diff --git a/drivers/opus/silk/ana_filt_bank_1.c b/thirdparty/opus/silk/ana_filt_bank_1.c
index b49bdd90be..24cfb03fdb 100644
--- a/drivers/opus/silk/ana_filt_bank_1.c
+++ b/thirdparty/opus/silk/ana_filt_bank_1.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
/* Coefficients for 2-band filter bank based on first-order allpass filters */
static opus_int16 A_fb1_20 = 5394 << 1;
diff --git a/thirdparty/opus/silk/arm/NSQ_neon.c b/thirdparty/opus/silk/arm/NSQ_neon.c
new file mode 100644
index 0000000000..9642529973
--- /dev/null
+++ b/thirdparty/opus/silk/arm/NSQ_neon.c
@@ -0,0 +1,112 @@
+/***********************************************************************
+Copyright (C) 2014 Vidyo
+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 Internet Society, IETF or IETF Trust, nor the
+names of specific 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 COPYRIGHT OWNER 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.
+***********************************************************************/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <arm_neon.h>
+#include "main.h"
+#include "stack_alloc.h"
+#include "NSQ.h"
+#include "celt/cpu_support.h"
+#include "celt/arm/armcpu.h"
+
+opus_int32 silk_noise_shape_quantizer_short_prediction_neon(const opus_int32 *buf32, const opus_int32 *coef32, opus_int order)
+{
+ int32x4_t coef0 = vld1q_s32(coef32);
+ int32x4_t coef1 = vld1q_s32(coef32 + 4);
+ int32x4_t coef2 = vld1q_s32(coef32 + 8);
+ int32x4_t coef3 = vld1q_s32(coef32 + 12);
+
+ int32x4_t a0 = vld1q_s32(buf32 - 15);
+ int32x4_t a1 = vld1q_s32(buf32 - 11);
+ int32x4_t a2 = vld1q_s32(buf32 - 7);
+ int32x4_t a3 = vld1q_s32(buf32 - 3);
+
+ int32x4_t b0 = vqdmulhq_s32(coef0, a0);
+ int32x4_t b1 = vqdmulhq_s32(coef1, a1);
+ int32x4_t b2 = vqdmulhq_s32(coef2, a2);
+ int32x4_t b3 = vqdmulhq_s32(coef3, a3);
+
+ int32x4_t c0 = vaddq_s32(b0, b1);
+ int32x4_t c1 = vaddq_s32(b2, b3);
+
+ int32x4_t d = vaddq_s32(c0, c1);
+
+ int64x2_t e = vpaddlq_s32(d);
+
+ int64x1_t f = vadd_s64(vget_low_s64(e), vget_high_s64(e));
+
+ opus_int32 out = vget_lane_s32(vreinterpret_s32_s64(f), 0);
+
+ out += silk_RSHIFT( order, 1 );
+
+ return out;
+}
+
+
+opus_int32 silk_NSQ_noise_shape_feedback_loop_neon(const opus_int32 *data0, opus_int32 *data1, const opus_int16 *coef, opus_int order)
+{
+ opus_int32 out;
+ if (order == 8)
+ {
+ int32x4_t a00 = vdupq_n_s32(data0[0]);
+ int32x4_t a01 = vld1q_s32(data1); /* data1[0] ... [3] */
+
+ int32x4_t a0 = vextq_s32 (a00, a01, 3); /* data0[0] data1[0] ...[2] */
+ int32x4_t a1 = vld1q_s32(data1 + 3); /* data1[3] ... [6] */
+
+ /*TODO: Convert these once in advance instead of once per sample, like
+ silk_noise_shape_quantizer_short_prediction_neon() does.*/
+ int16x8_t coef16 = vld1q_s16(coef);
+ int32x4_t coef0 = vmovl_s16(vget_low_s16(coef16));
+ int32x4_t coef1 = vmovl_s16(vget_high_s16(coef16));
+
+ /*This is not bit-exact with the C version, since we do not drop the
+ lower 16 bits of each multiply, but wait until the end to truncate
+ precision. This is an encoder-specific calculation (and unlike
+ silk_noise_shape_quantizer_short_prediction_neon(), is not meant to
+ simulate what the decoder will do). We still could use vqdmulhq_s32()
+ like silk_noise_shape_quantizer_short_prediction_neon() and save
+ half the multiplies, but the speed difference is not large, since we
+ then need two extra adds.*/
+ int64x2_t b0 = vmull_s32(vget_low_s32(a0), vget_low_s32(coef0));
+ int64x2_t b1 = vmlal_s32(b0, vget_high_s32(a0), vget_high_s32(coef0));
+ int64x2_t b2 = vmlal_s32(b1, vget_low_s32(a1), vget_low_s32(coef1));
+ int64x2_t b3 = vmlal_s32(b2, vget_high_s32(a1), vget_high_s32(coef1));
+
+ int64x1_t c = vadd_s64(vget_low_s64(b3), vget_high_s64(b3));
+ int64x1_t cS = vrshr_n_s64(c, 15);
+ int32x2_t d = vreinterpret_s32_s64(cS);
+
+ out = vget_lane_s32(d, 0);
+ vst1q_s32(data1, a0);
+ vst1q_s32(data1 + 4, a1);
+ return out;
+ }
+ return silk_NSQ_noise_shape_feedback_loop_c(data0, data1, coef, order);
+}
diff --git a/thirdparty/opus/silk/arm/NSQ_neon.h b/thirdparty/opus/silk/arm/NSQ_neon.h
new file mode 100644
index 0000000000..77c946af85
--- /dev/null
+++ b/thirdparty/opus/silk/arm/NSQ_neon.h
@@ -0,0 +1,113 @@
+/***********************************************************************
+Copyright (C) 2014 Vidyo
+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 Internet Society, IETF or IETF Trust, nor the
+names of specific 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 COPYRIGHT OWNER 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.
+***********************************************************************/
+#ifndef SILK_NSQ_NEON_H
+#define SILK_NSQ_NEON_H
+
+#include "cpu_support.h"
+
+#undef silk_short_prediction_create_arch_coef
+/* For vectorized calc, reverse a_Q12 coefs, convert to 32-bit, and shift for vqdmulhq_s32. */
+static OPUS_INLINE void silk_short_prediction_create_arch_coef_neon(opus_int32 *out, const opus_int16 *in, opus_int order)
+{
+ out[15] = in[0] << 15;
+ out[14] = in[1] << 15;
+ out[13] = in[2] << 15;
+ out[12] = in[3] << 15;
+ out[11] = in[4] << 15;
+ out[10] = in[5] << 15;
+ out[9] = in[6] << 15;
+ out[8] = in[7] << 15;
+ out[7] = in[8] << 15;
+ out[6] = in[9] << 15;
+
+ if (order == 16)
+ {
+ out[5] = in[10] << 15;
+ out[4] = in[11] << 15;
+ out[3] = in[12] << 15;
+ out[2] = in[13] << 15;
+ out[1] = in[14] << 15;
+ out[0] = in[15] << 15;
+ }
+ else
+ {
+ out[5] = 0;
+ out[4] = 0;
+ out[3] = 0;
+ out[2] = 0;
+ out[1] = 0;
+ out[0] = 0;
+ }
+}
+
+#if defined(OPUS_ARM_PRESUME_NEON_INTR)
+
+#define silk_short_prediction_create_arch_coef(out, in, order) \
+ (silk_short_prediction_create_arch_coef_neon(out, in, order))
+
+#elif defined(OPUS_HAVE_RTCD) && defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
+
+#define silk_short_prediction_create_arch_coef(out, in, order) \
+ do { if (arch == OPUS_ARCH_ARM_NEON) { silk_short_prediction_create_arch_coef_neon(out, in, order); } } while (0)
+
+#endif
+
+opus_int32 silk_noise_shape_quantizer_short_prediction_neon(const opus_int32 *buf32, const opus_int32 *coef32, opus_int order);
+
+opus_int32 silk_NSQ_noise_shape_feedback_loop_neon(const opus_int32 *data0, opus_int32 *data1, const opus_int16 *coef, opus_int order);
+
+#if defined(OPUS_ARM_PRESUME_NEON_INTR)
+#undef silk_noise_shape_quantizer_short_prediction
+#define silk_noise_shape_quantizer_short_prediction(in, coef, coefRev, order, arch) \
+ ((void)arch,silk_noise_shape_quantizer_short_prediction_neon(in, coefRev, order))
+
+#undef silk_NSQ_noise_shape_feedback_loop
+#define silk_NSQ_noise_shape_feedback_loop(data0, data1, coef, order, arch) ((void)arch,silk_NSQ_noise_shape_feedback_loop_neon(data0, data1, coef, order))
+
+#elif defined(OPUS_HAVE_RTCD) && defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
+
+/* silk_noise_shape_quantizer_short_prediction implementations take different parameters based on arch
+ (coef vs. coefRev) so can't use the usual IMPL table implementation */
+#undef silk_noise_shape_quantizer_short_prediction
+#define silk_noise_shape_quantizer_short_prediction(in, coef, coefRev, order, arch) \
+ (arch == OPUS_ARCH_ARM_NEON ? \
+ silk_noise_shape_quantizer_short_prediction_neon(in, coefRev, order) : \
+ silk_noise_shape_quantizer_short_prediction_c(in, coef, order))
+
+extern opus_int32
+ (*const SILK_NSQ_NOISE_SHAPE_FEEDBACK_LOOP_IMPL[OPUS_ARCHMASK+1])(
+ const opus_int32 *data0, opus_int32 *data1, const opus_int16 *coef,
+ opus_int order);
+
+#undef silk_NSQ_noise_shape_feedback_loop
+#define silk_NSQ_noise_shape_feedback_loop(data0, data1, coef, order, arch) \
+ (SILK_NSQ_NOISE_SHAPE_FEEDBACK_LOOP_IMPL[(arch)&OPUS_ARCHMASK](data0, data1, \
+ coef, order))
+
+#endif
+
+#endif /* SILK_NSQ_NEON_H */
diff --git a/drivers/opus/silk/arm/SigProc_FIX_armv4.h b/thirdparty/opus/silk/arm/SigProc_FIX_armv4.h
index ff62b1e5d6..ff62b1e5d6 100644
--- a/drivers/opus/silk/arm/SigProc_FIX_armv4.h
+++ b/thirdparty/opus/silk/arm/SigProc_FIX_armv4.h
diff --git a/drivers/opus/silk/arm/SigProc_FIX_armv5e.h b/thirdparty/opus/silk/arm/SigProc_FIX_armv5e.h
index 617a09cab1..617a09cab1 100644
--- a/drivers/opus/silk/arm/SigProc_FIX_armv5e.h
+++ b/thirdparty/opus/silk/arm/SigProc_FIX_armv5e.h
diff --git a/thirdparty/opus/silk/arm/arm_silk_map.c b/thirdparty/opus/silk/arm/arm_silk_map.c
new file mode 100644
index 0000000000..9bd86a7b21
--- /dev/null
+++ b/thirdparty/opus/silk/arm/arm_silk_map.c
@@ -0,0 +1,55 @@
+/***********************************************************************
+Copyright (C) 2014 Vidyo
+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 Internet Society, IETF or IETF Trust, nor the
+names of specific 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 COPYRIGHT OWNER 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.
+***********************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "NSQ.h"
+
+#if defined(OPUS_HAVE_RTCD)
+
+# if (defined(OPUS_ARM_MAY_HAVE_NEON_INTR) && \
+ !defined(OPUS_ARM_PRESUME_NEON_INTR))
+
+/*There is no table for silk_noise_shape_quantizer_short_prediction because the
+ NEON version takes different parameters than the C version.
+ Instead RTCD is done via if statements at the call sites.
+ See NSQ_neon.h for details.*/
+
+opus_int32
+ (*const SILK_NSQ_NOISE_SHAPE_FEEDBACK_LOOP_IMPL[OPUS_ARCHMASK+1])(
+ const opus_int32 *data0, opus_int32 *data1, const opus_int16 *coef,
+ opus_int order) = {
+ silk_NSQ_noise_shape_feedback_loop_c, /* ARMv4 */
+ silk_NSQ_noise_shape_feedback_loop_c, /* EDSP */
+ silk_NSQ_noise_shape_feedback_loop_c, /* Media */
+ silk_NSQ_noise_shape_feedback_loop_neon, /* NEON */
+};
+
+# endif
+
+#endif /* OPUS_HAVE_RTCD */
diff --git a/thirdparty/opus/silk/arm/macros_arm64.h b/thirdparty/opus/silk/arm/macros_arm64.h
new file mode 100644
index 0000000000..ed030413c5
--- /dev/null
+++ b/thirdparty/opus/silk/arm/macros_arm64.h
@@ -0,0 +1,39 @@
+/***********************************************************************
+Copyright (C) 2015 Vidyo
+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 Internet Society, IETF or IETF Trust, nor the
+names of specific 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 COPYRIGHT OWNER 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.
+***********************************************************************/
+
+#ifndef SILK_MACROS_ARM64_H
+#define SILK_MACROS_ARM64_H
+
+#include <arm_neon.h>
+
+#undef silk_ADD_SAT32
+#define silk_ADD_SAT32(a, b) (vqadds_s32((a), (b)))
+
+#undef silk_SUB_SAT32
+#define silk_SUB_SAT32(a, b) (vqsubs_s32((a), (b)))
+
+#endif /* SILK_MACROS_ARM64_H */
diff --git a/drivers/opus/silk/arm/macros_armv4.h b/thirdparty/opus/silk/arm/macros_armv4.h
index 3f30e97288..3f30e97288 100644
--- a/drivers/opus/silk/arm/macros_armv4.h
+++ b/thirdparty/opus/silk/arm/macros_armv4.h
diff --git a/drivers/opus/silk/arm/macros_armv5e.h b/thirdparty/opus/silk/arm/macros_armv5e.h
index aad4117e46..aad4117e46 100644
--- a/drivers/opus/silk/arm/macros_armv5e.h
+++ b/thirdparty/opus/silk/arm/macros_armv5e.h
diff --git a/drivers/opus/silk/biquad_alt.c b/thirdparty/opus/silk/biquad_alt.c
index f797d1e709..d55f5ee92e 100644
--- a/drivers/opus/silk/biquad_alt.c
+++ b/thirdparty/opus/silk/biquad_alt.c
@@ -31,9 +31,12 @@ POSSIBILITY OF SUCH DAMAGE.
* Second order ARMA filter *
* Can handle slowly varying filter coefficients *
* */
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
/* Second order ARMA filter, alternative implementation */
void silk_biquad_alt(
diff --git a/drivers/opus/silk/bwexpander.c b/thirdparty/opus/silk/bwexpander.c
index e7cc448520..2eb4456695 100644
--- a/drivers/opus/silk/bwexpander.c
+++ b/thirdparty/opus/silk/bwexpander.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
/* Chirp (bandwidth expand) LP AR filter */
void silk_bwexpander(
diff --git a/drivers/opus/silk/bwexpander_32.c b/thirdparty/opus/silk/bwexpander_32.c
index dedd213b3e..d0010f73df 100644
--- a/drivers/opus/silk/bwexpander_32.c
+++ b/thirdparty/opus/silk/bwexpander_32.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
/* Chirp (bandwidth expand) LP AR filter */
void silk_bwexpander_32(
diff --git a/drivers/opus/silk/check_control_input.c b/thirdparty/opus/silk/check_control_input.c
index 61a7cc1f33..b5de9ce48d 100644
--- a/drivers/opus/silk/check_control_input.c
+++ b/thirdparty/opus/silk/check_control_input.c
@@ -24,11 +24,14 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
-#include "opus/silk/control.h"
-#include "opus/silk/errors.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
+#include "control.h"
+#include "errors.h"
/* Check encoder control struct */
opus_int check_control_input(
diff --git a/drivers/opus/silk/code_signs.c b/thirdparty/opus/silk/code_signs.c
index 79c1893514..dfd1dca9a1 100644
--- a/drivers/opus/silk/code_signs.c
+++ b/thirdparty/opus/silk/code_signs.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
/*#define silk_enc_map(a) ((a) > 0 ? 1 : 0)*/
/*#define silk_dec_map(a) ((a) > 0 ? 1 : -1)*/
diff --git a/drivers/opus/silk/control.h b/thirdparty/opus/silk/control.h
index 4b20c4a8b8..747e5426a0 100644
--- a/drivers/opus/silk/control.h
+++ b/thirdparty/opus/silk/control.h
@@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_CONTROL_H
#define SILK_CONTROL_H
-#include "opus/silk/typedef.h"
+#include "typedef.h"
#ifdef __cplusplus
extern "C"
diff --git a/drivers/opus/silk/control_SNR.c b/thirdparty/opus/silk/control_SNR.c
index 5aebfcf385..cee87eb0d8 100644
--- a/drivers/opus/silk/control_SNR.c
+++ b/thirdparty/opus/silk/control_SNR.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
-#include "opus/silk/tuning_parameters.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
+#include "tuning_parameters.h"
/* Control SNR of redidual quantizer */
opus_int silk_control_SNR(
diff --git a/drivers/opus/silk/control_audio_bandwidth.c b/thirdparty/opus/silk/control_audio_bandwidth.c
index 04640f53fe..4f9bc5cbda 100644
--- a/drivers/opus/silk/control_audio_bandwidth.c
+++ b/thirdparty/opus/silk/control_audio_bandwidth.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
-#include "opus/silk/tuning_parameters.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
+#include "tuning_parameters.h"
/* Control internal sampling rate */
opus_int silk_control_audio_bandwidth(
diff --git a/drivers/opus/silk/control_codec.c b/thirdparty/opus/silk/control_codec.c
index 03caab36a9..044eea3f2a 100644
--- a/drivers/opus/silk/control_codec.c
+++ b/thirdparty/opus/silk/control_codec.c
@@ -24,17 +24,20 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#ifdef OPUS_FIXED_POINT
-#include "opus/silk/fixed/main_FIX.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#ifdef FIXED_POINT
+#include "main_FIX.h"
#define silk_encoder_state_Fxx silk_encoder_state_FIX
#else
-#include "opus/silk/float/main_FLP.h"
+#include "main_FLP.h"
#define silk_encoder_state_Fxx silk_encoder_state_FLP
#endif
-#include "opus/celt/stack_alloc.h"
-#include "opus/silk/tuning_parameters.h"
-#include "opus/silk/pitch_est_defines.h"
+#include "stack_alloc.h"
+#include "tuning_parameters.h"
+#include "pitch_est_defines.h"
static opus_int silk_setup_resamplers(
silk_encoder_state_Fxx *psEnc, /* I/O */
@@ -145,7 +148,7 @@ static opus_int silk_setup_resamplers(
} else {
VARDECL( opus_int16, x_buf_API_fs_Hz );
VARDECL( silk_resampler_state_struct, temp_resampler_state );
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
opus_int16 *x_bufFIX = psEnc->x_buf;
#else
VARDECL( opus_int16, x_bufFIX );
@@ -158,7 +161,7 @@ static opus_int silk_setup_resamplers(
buf_length_ms = silk_LSHIFT( psEnc->sCmn.nb_subfr * 5, 1 ) + LA_SHAPE_MS;
old_buf_samples = buf_length_ms * psEnc->sCmn.fs_kHz;
-#ifndef OPUS_FIXED_POINT
+#ifndef FIXED_POINT
new_buf_samples = buf_length_ms * fs_kHz;
ALLOC( x_bufFIX, silk_max( old_buf_samples, new_buf_samples ),
opus_int16 );
@@ -182,7 +185,7 @@ static opus_int silk_setup_resamplers(
/* Correct resampler state by resampling buffered data from API_fs_Hz to fs_kHz */
ret += silk_resampler( &psEnc->sCmn.resampler_state, x_bufFIX, x_buf_API_fs_Hz, api_buf_samples );
-#ifndef OPUS_FIXED_POINT
+#ifndef FIXED_POINT
silk_short2float_array( psEnc->x_buf, x_bufFIX, new_buf_samples);
#endif
}
diff --git a/drivers/opus/silk/debug.c b/thirdparty/opus/silk/debug.c
index ffb3f811a1..9253faf71b 100644
--- a/drivers/opus/silk/debug.c
+++ b/thirdparty/opus/silk/debug.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/debug.h"
-#include "opus/silk/SigProc_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "debug.h"
+#include "SigProc_FIX.h"
#if SILK_TIC_TOC
diff --git a/drivers/opus/silk/debug.h b/thirdparty/opus/silk/debug.h
index d2eccfa1e4..efb6d3e99e 100644
--- a/drivers/opus/silk/debug.h
+++ b/thirdparty/opus/silk/debug.h
@@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_DEBUG_H
#define SILK_DEBUG_H
-#include "opus/silk/typedef.h"
+#include "typedef.h"
#include <stdio.h> /* file writing */
#include <string.h> /* strcpy, strcmp */
diff --git a/drivers/opus/silk/dec_API.c b/thirdparty/opus/silk/dec_API.c
index 2fd681c0d2..b7d8ed48d8 100644
--- a/drivers/opus/silk/dec_API.c
+++ b/thirdparty/opus/silk/dec_API.c
@@ -24,11 +24,14 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/API.h"
-#include "opus/silk/main.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/celt/os_support.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "API.h"
+#include "main.h"
+#include "stack_alloc.h"
+#include "os_support.h"
/************************/
/* Decoder Super Struct */
diff --git a/drivers/opus/silk/decode_core.c b/thirdparty/opus/silk/decode_core.c
index 8ca1adffdd..b88991e349 100644
--- a/drivers/opus/silk/decode_core.c
+++ b/thirdparty/opus/silk/decode_core.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
-#include "opus/celt/stack_alloc.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
+#include "stack_alloc.h"
/**********************************************************/
/* Core decoder. Performs inverse NSQ operation LTP + LPC */
diff --git a/drivers/opus/silk/decode_frame.c b/thirdparty/opus/silk/decode_frame.c
index 18e2bc9b1a..a605d95ac6 100644
--- a/drivers/opus/silk/decode_frame.c
+++ b/thirdparty/opus/silk/decode_frame.c
@@ -24,11 +24,14 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/silk/PLC.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
+#include "stack_alloc.h"
+#include "PLC.h"
/****************/
/* Decode frame */
diff --git a/drivers/opus/silk/decode_indices.c b/thirdparty/opus/silk/decode_indices.c
index fa8066e5f7..7afe5c26c1 100644
--- a/drivers/opus/silk/decode_indices.c
+++ b/thirdparty/opus/silk/decode_indices.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
/* Decode side-information parameters from payload */
void silk_decode_indices(
diff --git a/drivers/opus/silk/decode_parameters.c b/thirdparty/opus/silk/decode_parameters.c
index d17cb8a3df..e345b1dcef 100644
--- a/drivers/opus/silk/decode_parameters.c
+++ b/thirdparty/opus/silk/decode_parameters.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
/* Decode parameters from payload */
void silk_decode_parameters(
diff --git a/drivers/opus/silk/decode_pitch.c b/thirdparty/opus/silk/decode_pitch.c
index 1d98ee7f33..fedbc6a525 100644
--- a/drivers/opus/silk/decode_pitch.c
+++ b/thirdparty/opus/silk/decode_pitch.c
@@ -24,13 +24,16 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
/***********************************************************
* Pitch analyser function
********************************************************** */
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/silk/pitch_est_defines.h"
+#include "SigProc_FIX.h"
+#include "pitch_est_defines.h"
void silk_decode_pitch(
opus_int16 lagIndex, /* I */
diff --git a/drivers/opus/silk/decode_pulses.c b/thirdparty/opus/silk/decode_pulses.c
index c687d3bfa8..d6bbec9225 100644
--- a/drivers/opus/silk/decode_pulses.c
+++ b/thirdparty/opus/silk/decode_pulses.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
/*********************************************/
/* Decode quantization indices of excitation */
diff --git a/drivers/opus/silk/decoder_set_fs.c b/thirdparty/opus/silk/decoder_set_fs.c
index 0079a506ee..eef0fd25e1 100644
--- a/drivers/opus/silk/decoder_set_fs.c
+++ b/thirdparty/opus/silk/decoder_set_fs.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
/* Set decoder sampling rate */
opus_int silk_decoder_set_fs(
diff --git a/drivers/opus/silk/define.h b/thirdparty/opus/silk/define.h
index c6165e3cff..19c9b00e25 100644
--- a/drivers/opus/silk/define.h
+++ b/thirdparty/opus/silk/define.h
@@ -28,8 +28,8 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_DEFINE_H
#define SILK_DEFINE_H
-#include "opus/silk/errors.h"
-#include "opus/silk/typedef.h"
+#include "errors.h"
+#include "typedef.h"
#ifdef __cplusplus
extern "C"
diff --git a/drivers/opus/silk/enc_API.c b/thirdparty/opus/silk/enc_API.c
index beb46214d8..f8060286db 100644
--- a/drivers/opus/silk/enc_API.c
+++ b/thirdparty/opus/silk/enc_API.c
@@ -24,18 +24,21 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/define.h"
-#include "opus/silk/API.h"
-#include "opus/silk/control.h"
-#include "opus/silk/typedef.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/silk/structs.h"
-#include "opus/silk/tuning_parameters.h"
-#ifdef OPUS_FIXED_POINT
-#include "opus/silk/fixed/main_FIX.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "define.h"
+#include "API.h"
+#include "control.h"
+#include "typedef.h"
+#include "stack_alloc.h"
+#include "structs.h"
+#include "tuning_parameters.h"
+#ifdef FIXED_POINT
+#include "main_FIX.h"
#else
-#include "opus/silk/float/main_FLP.h"
+#include "main_FLP.h"
#endif
/***************************************/
diff --git a/drivers/opus/silk/encode_indices.c b/thirdparty/opus/silk/encode_indices.c
index 72fc6a80e8..666c8c0b13 100644
--- a/drivers/opus/silk/encode_indices.c
+++ b/thirdparty/opus/silk/encode_indices.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
/* Encode side-information parameters to payload */
void silk_encode_indices(
diff --git a/drivers/opus/silk/encode_pulses.c b/thirdparty/opus/silk/encode_pulses.c
index 238eec1e42..ab00264f99 100644
--- a/drivers/opus/silk/encode_pulses.c
+++ b/thirdparty/opus/silk/encode_pulses.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
-#include "opus/celt/stack_alloc.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
+#include "stack_alloc.h"
/*********************************************/
/* Encode quantization indices of excitation */
diff --git a/drivers/opus/silk/errors.h b/thirdparty/opus/silk/errors.h
index 45070800f2..45070800f2 100644
--- a/drivers/opus/silk/errors.h
+++ b/thirdparty/opus/silk/errors.h
diff --git a/drivers/opus/silk/fixed/LTP_analysis_filter_FIX.c b/thirdparty/opus/silk/fixed/LTP_analysis_filter_FIX.c
index 041e85f0b9..5574e7069f 100644
--- a/drivers/opus/silk/fixed/LTP_analysis_filter_FIX.c
+++ b/thirdparty/opus/silk/fixed/LTP_analysis_filter_FIX.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/fixed/main_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FIX.h"
void silk_LTP_analysis_filter_FIX(
opus_int16 *LTP_res, /* O LTP residual signal of length MAX_NB_SUBFR * ( pre_length + subfr_length ) */
diff --git a/drivers/opus/silk/fixed/LTP_scale_ctrl_FIX.c b/thirdparty/opus/silk/fixed/LTP_scale_ctrl_FIX.c
index dac1fbc08a..3dcedef891 100644
--- a/drivers/opus/silk/fixed/LTP_scale_ctrl_FIX.c
+++ b/thirdparty/opus/silk/fixed/LTP_scale_ctrl_FIX.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/fixed/main_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FIX.h"
/* Calculation of LTP state scaling */
void silk_LTP_scale_ctrl_FIX(
diff --git a/drivers/opus/silk/fixed/apply_sine_window_FIX.c b/thirdparty/opus/silk/fixed/apply_sine_window_FIX.c
index 9d63e7bce2..4502b7130e 100644
--- a/drivers/opus/silk/fixed/apply_sine_window_FIX.c
+++ b/thirdparty/opus/silk/fixed/apply_sine_window_FIX.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
/* Apply sine window to signal vector. */
/* Window types: */
diff --git a/drivers/opus/silk/fixed/autocorr_FIX.c b/thirdparty/opus/silk/fixed/autocorr_FIX.c
index db39a0335b..de95c98693 100644
--- a/drivers/opus/silk/fixed/autocorr_FIX.c
+++ b/thirdparty/opus/silk/fixed/autocorr_FIX.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/celt/celt_lpc.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
+#include "celt_lpc.h"
/* Compute autocorrelation */
void silk_autocorr(
diff --git a/drivers/opus/silk/fixed/burg_modified_FIX.c b/thirdparty/opus/silk/fixed/burg_modified_FIX.c
index 48d64eccc5..4878553b65 100644
--- a/drivers/opus/silk/fixed/burg_modified_FIX.c
+++ b/thirdparty/opus/silk/fixed/burg_modified_FIX.c
@@ -24,12 +24,15 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/silk/define.h"
-#include "opus/silk/tuning_parameters.h"
-#include "opus/celt/pitch.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
+#include "define.h"
+#include "tuning_parameters.h"
+#include "pitch.h"
#define MAX_FRAME_SIZE 384 /* subfr_length * nb_subfr = ( 0.005 * 16000 + 16 ) * 4 = 384 */
diff --git a/drivers/opus/silk/fixed/corrMatrix_FIX.c b/thirdparty/opus/silk/fixed/corrMatrix_FIX.c
index ac5331fe57..c1d437c785 100644
--- a/drivers/opus/silk/fixed/corrMatrix_FIX.c
+++ b/thirdparty/opus/silk/fixed/corrMatrix_FIX.c
@@ -24,13 +24,16 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
/**********************************************************************
* Correlation Matrix Computations for LS estimate.
**********************************************************************/
-#include "opus/silk/fixed/main_FIX.h"
+#include "main_FIX.h"
/* Calculates correlation vector X'*t */
void silk_corrVector_FIX(
diff --git a/drivers/opus/silk/fixed/encode_frame_FIX.c b/thirdparty/opus/silk/fixed/encode_frame_FIX.c
index e4ead0afef..5ef44b03fc 100644
--- a/drivers/opus/silk/fixed/encode_frame_FIX.c
+++ b/thirdparty/opus/silk/fixed/encode_frame_FIX.c
@@ -24,11 +24,14 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/fixed/main_FIX.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/silk/tuning_parameters.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FIX.h"
+#include "stack_alloc.h"
+#include "tuning_parameters.h"
/* Low Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode with lower bitrate */
static OPUS_INLINE void silk_LBRR_encode_FIX(
diff --git a/drivers/opus/silk/fixed/find_LPC_FIX.c b/thirdparty/opus/silk/fixed/find_LPC_FIX.c
index 5b56c41702..e11cdc86e6 100644
--- a/drivers/opus/silk/fixed/find_LPC_FIX.c
+++ b/thirdparty/opus/silk/fixed/find_LPC_FIX.c
@@ -24,11 +24,14 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/fixed/main_FIX.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/silk/tuning_parameters.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FIX.h"
+#include "stack_alloc.h"
+#include "tuning_parameters.h"
/* Finds LPC vector from correlations, and converts to NLSF */
void silk_find_LPC_FIX(
diff --git a/drivers/opus/silk/fixed/find_LTP_FIX.c b/thirdparty/opus/silk/fixed/find_LTP_FIX.c
index a5a253516d..1314a28137 100644
--- a/drivers/opus/silk/fixed/find_LTP_FIX.c
+++ b/thirdparty/opus/silk/fixed/find_LTP_FIX.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/fixed/main_FIX.h"
-#include "opus/silk/tuning_parameters.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FIX.h"
+#include "tuning_parameters.h"
/* Head room for correlations */
#define LTP_CORRS_HEAD_ROOM 2
diff --git a/drivers/opus/silk/fixed/find_pitch_lags_FIX.c b/thirdparty/opus/silk/fixed/find_pitch_lags_FIX.c
index bfd2c1b2d2..b8440a8247 100644
--- a/drivers/opus/silk/fixed/find_pitch_lags_FIX.c
+++ b/thirdparty/opus/silk/fixed/find_pitch_lags_FIX.c
@@ -24,11 +24,14 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/fixed/main_FIX.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/silk/tuning_parameters.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FIX.h"
+#include "stack_alloc.h"
+#include "tuning_parameters.h"
/* Find pitch lags */
void silk_find_pitch_lags_FIX(
diff --git a/drivers/opus/silk/fixed/find_pred_coefs_FIX.c b/thirdparty/opus/silk/fixed/find_pred_coefs_FIX.c
index d0280963bd..d308e9cf5f 100644
--- a/drivers/opus/silk/fixed/find_pred_coefs_FIX.c
+++ b/thirdparty/opus/silk/fixed/find_pred_coefs_FIX.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/fixed/main_FIX.h"
-#include "opus/celt/stack_alloc.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FIX.h"
+#include "stack_alloc.h"
void silk_find_pred_coefs_FIX(
silk_encoder_state_FIX *psEnc, /* I/O encoder state */
diff --git a/drivers/opus/silk/fixed/k2a_FIX.c b/thirdparty/opus/silk/fixed/k2a_FIX.c
index 64771f370c..5fee599bcb 100644
--- a/drivers/opus/silk/fixed/k2a_FIX.c
+++ b/thirdparty/opus/silk/fixed/k2a_FIX.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
/* Step up function, converts reflection coefficients to prediction coefficients */
void silk_k2a(
diff --git a/drivers/opus/silk/fixed/k2a_Q16_FIX.c b/thirdparty/opus/silk/fixed/k2a_Q16_FIX.c
index 49d90a862e..3b03987544 100644
--- a/drivers/opus/silk/fixed/k2a_Q16_FIX.c
+++ b/thirdparty/opus/silk/fixed/k2a_Q16_FIX.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
/* Step up function, converts reflection coefficients to prediction coefficients */
void silk_k2a_Q16(
diff --git a/drivers/opus/silk/fixed/main_FIX.h b/thirdparty/opus/silk/fixed/main_FIX.h
index f824c47653..375b5eb32e 100644
--- a/drivers/opus/silk/fixed/main_FIX.h
+++ b/thirdparty/opus/silk/fixed/main_FIX.h
@@ -28,13 +28,13 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_MAIN_FIX_H
#define SILK_MAIN_FIX_H
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/silk/fixed/structs_FIX.h"
-#include "opus/silk/control.h"
-#include "opus/silk/main.h"
-#include "opus/silk/PLC.h"
-#include "opus/silk/debug.h"
-#include "opus/celt/entenc.h"
+#include "SigProc_FIX.h"
+#include "structs_FIX.h"
+#include "control.h"
+#include "main.h"
+#include "PLC.h"
+#include "debug.h"
+#include "entenc.h"
#ifndef FORCE_CPP_BUILD
#ifdef __cplusplus
diff --git a/drivers/opus/silk/fixed/mips/noise_shape_analysis_FIX_mipsr1.h b/thirdparty/opus/silk/fixed/mips/noise_shape_analysis_FIX_mipsr1.h
index c30481e437..c30481e437 100644
--- a/drivers/opus/silk/fixed/mips/noise_shape_analysis_FIX_mipsr1.h
+++ b/thirdparty/opus/silk/fixed/mips/noise_shape_analysis_FIX_mipsr1.h
diff --git a/drivers/opus/silk/fixed/mips/prefilter_FIX_mipsr1.h b/thirdparty/opus/silk/fixed/mips/prefilter_FIX_mipsr1.h
index c7f04279a0..21b256885f 100644
--- a/drivers/opus/silk/fixed/mips/prefilter_FIX_mipsr1.h
+++ b/thirdparty/opus/silk/fixed/mips/prefilter_FIX_mipsr1.h
@@ -26,11 +26,14 @@ POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
#ifndef __PREFILTER_FIX_MIPSR1_H__
#define __PREFILTER_FIX_MIPSR1_H__
-#include "opus/opus_config.h"
-#include "opus/silk/fixed/main_FIX.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/silk/tuning_parameters.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FIX.h"
+#include "stack_alloc.h"
+#include "tuning_parameters.h"
#define OVERRIDE_silk_warped_LPC_analysis_filter_FIX
void silk_warped_LPC_analysis_filter_FIX(
diff --git a/drivers/opus/silk/fixed/mips/warped_autocorrelation_FIX_mipsr1.h b/thirdparty/opus/silk/fixed/mips/warped_autocorrelation_FIX_mipsr1.h
index eba7711db7..e803ef0fce 100644
--- a/drivers/opus/silk/fixed/mips/warped_autocorrelation_FIX_mipsr1.h
+++ b/thirdparty/opus/silk/fixed/mips/warped_autocorrelation_FIX_mipsr1.h
@@ -27,9 +27,12 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef __WARPED_AUTOCORRELATION_FIX_MIPSR1_H__
#define __WARPED_AUTOCORRELATION_FIX_MIPSR1_H__
-#include "opus/opus_config.h"
-#include "opus/silk/fixed/main_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FIX.h"
#undef QC
#define QC 10
diff --git a/drivers/opus/silk/fixed/noise_shape_analysis_FIX.c b/thirdparty/opus/silk/fixed/noise_shape_analysis_FIX.c
index 6f1dc3ddd5..22a89f75ae 100644
--- a/drivers/opus/silk/fixed/noise_shape_analysis_FIX.c
+++ b/thirdparty/opus/silk/fixed/noise_shape_analysis_FIX.c
@@ -24,11 +24,14 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/fixed/main_FIX.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/silk/tuning_parameters.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FIX.h"
+#include "stack_alloc.h"
+#include "tuning_parameters.h"
/* Compute gain to make warped filter coefficients have a zero mean log frequency response on a */
/* non-warped frequency scale. (So that it can be implemented with a minimum-phase monic filter.) */
@@ -136,7 +139,7 @@ static OPUS_INLINE void limit_warped_coefs(
}
#if defined(MIPSr1_ASM)
-#include "opus/silk/fixed/mips/noise_shape_analysis_FIX_mipsr1.h"
+#include "mips/noise_shape_analysis_FIX_mipsr1.h"
#endif
/**************************************************************/
diff --git a/drivers/opus/silk/fixed/pitch_analysis_core_FIX.c b/thirdparty/opus/silk/fixed/pitch_analysis_core_FIX.c
index cf421c9612..01bb9fc0a8 100644
--- a/drivers/opus/silk/fixed/pitch_analysis_core_FIX.c
+++ b/thirdparty/opus/silk/fixed/pitch_analysis_core_FIX.c
@@ -24,16 +24,19 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
/***********************************************************
* Pitch analyser function
********************************************************** */
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/silk/pitch_est_defines.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/silk/debug.h"
-#include "opus/celt/pitch.h"
+#include "SigProc_FIX.h"
+#include "pitch_est_defines.h"
+#include "stack_alloc.h"
+#include "debug.h"
+#include "pitch.h"
#define SCRATCH_SIZE 22
#define SF_LENGTH_4KHZ ( PE_SUBFR_LENGTH_MS * 4 )
diff --git a/drivers/opus/silk/fixed/prefilter_FIX.c b/thirdparty/opus/silk/fixed/prefilter_FIX.c
index 344be2badd..6a8e35152e 100644
--- a/drivers/opus/silk/fixed/prefilter_FIX.c
+++ b/thirdparty/opus/silk/fixed/prefilter_FIX.c
@@ -24,14 +24,17 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/fixed/main_FIX.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/silk/tuning_parameters.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FIX.h"
+#include "stack_alloc.h"
+#include "tuning_parameters.h"
#if defined(MIPSr1_ASM)
-#include "opus/silk/fixed/mips/prefilter_FIX_mipsr1.h"
+#include "mips/prefilter_FIX_mipsr1.h"
#endif
diff --git a/drivers/opus/silk/fixed/process_gains_FIX.c b/thirdparty/opus/silk/fixed/process_gains_FIX.c
index c0d591210b..05aba31788 100644
--- a/drivers/opus/silk/fixed/process_gains_FIX.c
+++ b/thirdparty/opus/silk/fixed/process_gains_FIX.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/fixed/main_FIX.h"
-#include "opus/silk/tuning_parameters.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FIX.h"
+#include "tuning_parameters.h"
/* Processing of gains */
void silk_process_gains_FIX(
diff --git a/drivers/opus/silk/fixed/regularize_correlations_FIX.c b/thirdparty/opus/silk/fixed/regularize_correlations_FIX.c
index c38a5589b6..a2836b05f4 100644
--- a/drivers/opus/silk/fixed/regularize_correlations_FIX.c
+++ b/thirdparty/opus/silk/fixed/regularize_correlations_FIX.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/fixed/main_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FIX.h"
/* Add noise to matrix diagonal */
void silk_regularize_correlations_FIX(
diff --git a/drivers/opus/silk/fixed/residual_energy16_FIX.c b/thirdparty/opus/silk/fixed/residual_energy16_FIX.c
index 39bc96fd90..ebffb2a66f 100644
--- a/drivers/opus/silk/fixed/residual_energy16_FIX.c
+++ b/thirdparty/opus/silk/fixed/residual_energy16_FIX.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/fixed/main_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FIX.h"
/* Residual energy: nrg = wxx - 2 * wXx * c + c' * wXX * c */
opus_int32 silk_residual_energy16_covar_FIX(
diff --git a/drivers/opus/silk/fixed/residual_energy_FIX.c b/thirdparty/opus/silk/fixed/residual_energy_FIX.c
index 0e51f4baa1..41f74778e8 100644
--- a/drivers/opus/silk/fixed/residual_energy_FIX.c
+++ b/thirdparty/opus/silk/fixed/residual_energy_FIX.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/fixed/main_FIX.h"
-#include "opus/celt/stack_alloc.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FIX.h"
+#include "stack_alloc.h"
/* Calculates residual energies of input subframes where all subframes have LPC_order */
/* of preceding samples */
diff --git a/drivers/opus/silk/fixed/schur64_FIX.c b/thirdparty/opus/silk/fixed/schur64_FIX.c
index 69ef76e028..764a10ef3e 100644
--- a/drivers/opus/silk/fixed/schur64_FIX.c
+++ b/thirdparty/opus/silk/fixed/schur64_FIX.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
/* Slower than schur(), but more accurate. */
/* Uses SMULL(), available on armv4 */
diff --git a/drivers/opus/silk/fixed/schur_FIX.c b/thirdparty/opus/silk/fixed/schur_FIX.c
index 9effa59daf..c4c0ef23b4 100644
--- a/drivers/opus/silk/fixed/schur_FIX.c
+++ b/thirdparty/opus/silk/fixed/schur_FIX.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
/* Faster than schur64(), but much less accurate. */
/* uses SMLAWB(), requiring armv5E and higher. */
diff --git a/drivers/opus/silk/fixed/solve_LS_FIX.c b/thirdparty/opus/silk/fixed/solve_LS_FIX.c
index 4ff97497be..51d7d49d02 100644
--- a/drivers/opus/silk/fixed/solve_LS_FIX.c
+++ b/thirdparty/opus/silk/fixed/solve_LS_FIX.c
@@ -24,11 +24,14 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/fixed/main_FIX.h"
-#include "opus/celt/stack_alloc.h"
-#include "opus/silk/tuning_parameters.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FIX.h"
+#include "stack_alloc.h"
+#include "tuning_parameters.h"
/*****************************/
/* Internal function headers */
diff --git a/drivers/opus/silk/fixed/structs_FIX.h b/thirdparty/opus/silk/fixed/structs_FIX.h
index 36ddff0a9e..3294b25128 100644
--- a/drivers/opus/silk/fixed/structs_FIX.h
+++ b/thirdparty/opus/silk/fixed/structs_FIX.h
@@ -28,9 +28,9 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_STRUCTS_FIX_H
#define SILK_STRUCTS_FIX_H
-#include "opus/silk/typedef.h"
-#include "opus/silk/main.h"
-#include "opus/silk/structs.h"
+#include "typedef.h"
+#include "main.h"
+#include "structs.h"
#ifdef __cplusplus
extern "C"
diff --git a/drivers/opus/silk/fixed/vector_ops_FIX.c b/thirdparty/opus/silk/fixed/vector_ops_FIX.c
index 1e8fdec0cb..d94980014f 100644
--- a/drivers/opus/silk/fixed/vector_ops_FIX.c
+++ b/thirdparty/opus/silk/fixed/vector_ops_FIX.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/celt/pitch.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
+#include "pitch.h"
/* Copy and multiply a vector by a constant */
void silk_scale_copy_vector16(
@@ -72,7 +75,7 @@ opus_int32 silk_inner_prod_aligned(
int arch /* I Run-time architecture */
)
{
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
return celt_inner_prod(inVec1, inVec2, len, arch);
#else
opus_int i;
diff --git a/drivers/opus/silk/fixed/warped_autocorrelation_FIX.c b/thirdparty/opus/silk/fixed/warped_autocorrelation_FIX.c
index 3b8d52d5c6..6ca6c1184d 100644
--- a/drivers/opus/silk/fixed/warped_autocorrelation_FIX.c
+++ b/thirdparty/opus/silk/fixed/warped_autocorrelation_FIX.c
@@ -24,15 +24,18 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/fixed/main_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FIX.h"
#define QC 10
#define QS 14
#if defined(MIPSr1_ASM)
-#include "opus/silk/fixed/mips/warped_autocorrelation_FIX_mipsr1.h"
+#include "mips/warped_autocorrelation_FIX_mipsr1.h"
#endif
diff --git a/drivers/opus/silk/fixed/x86/burg_modified_FIX_sse.c b/thirdparty/opus/silk/fixed/x86/burg_modified_FIX_sse.c
index f7d46487df..3756095fbe 100644
--- a/drivers/opus/silk/fixed/x86/burg_modified_FIX_sse.c
+++ b/thirdparty/opus/silk/fixed/x86/burg_modified_FIX_sse.c
@@ -24,17 +24,20 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <xmmintrin.h>
#include <emmintrin.h>
#include <smmintrin.h>
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/silk/define.h"
-#include "opus/silk/tuning_parameters.h"
-#include "opus/celt/pitch.h"
-#include "opus/celt/x86/x86cpu.h"
+#include "SigProc_FIX.h"
+#include "define.h"
+#include "tuning_parameters.h"
+#include "pitch.h"
+#include "celt/x86/x86cpu.h"
#define MAX_FRAME_SIZE 384 /* subfr_length * nb_subfr = ( 0.005 * 16000 + 16 ) * 4 = 384 */
diff --git a/drivers/opus/silk/fixed/x86/prefilter_FIX_sse.c b/thirdparty/opus/silk/fixed/x86/prefilter_FIX_sse.c
index febb105645..488a603f5d 100644
--- a/drivers/opus/silk/fixed/x86/prefilter_FIX_sse.c
+++ b/thirdparty/opus/silk/fixed/x86/prefilter_FIX_sse.c
@@ -24,13 +24,16 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <xmmintrin.h>
#include <emmintrin.h>
#include <smmintrin.h>
-#include "opus/silk/main.h"
-#include "opus/celt/x86/x86cpu.h"
+#include "main.h"
+#include "celt/x86/x86cpu.h"
void silk_warped_LPC_analysis_filter_FIX_sse4_1(
opus_int32 state[], /* I/O State [order + 1] */
diff --git a/drivers/opus/silk/fixed/x86/vector_ops_FIX_sse.c b/thirdparty/opus/silk/fixed/x86/vector_ops_FIX_sse.c
index 920d58cebc..c1e90564d0 100644
--- a/drivers/opus/silk/fixed/x86/vector_ops_FIX_sse.c
+++ b/thirdparty/opus/silk/fixed/x86/vector_ops_FIX_sse.c
@@ -24,15 +24,18 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <xmmintrin.h>
#include <emmintrin.h>
#include <smmintrin.h>
-#include "opus/silk/main.h"
+#include "main.h"
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/celt/pitch.h"
+#include "SigProc_FIX.h"
+#include "pitch.h"
opus_int64 silk_inner_prod16_aligned_64_sse4_1(
const opus_int16 *inVec1, /* I input vector 1 */
diff --git a/drivers/opus/silk/float/LPC_analysis_filter_FLP.c b/thirdparty/opus/silk/float/LPC_analysis_filter_FLP.c
index 344e52ade2..cae89a0a18 100644
--- a/drivers/opus/silk/float/LPC_analysis_filter_FLP.c
+++ b/thirdparty/opus/silk/float/LPC_analysis_filter_FLP.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <stdlib.h>
-#include "opus/silk/float/main_FLP.h"
+#include "main_FLP.h"
/************************************************/
/* LPC analysis filter */
diff --git a/drivers/opus/silk/float/LPC_inv_pred_gain_FLP.c b/thirdparty/opus/silk/float/LPC_inv_pred_gain_FLP.c
index f99a427623..25178bacdd 100644
--- a/drivers/opus/silk/float/LPC_inv_pred_gain_FLP.c
+++ b/thirdparty/opus/silk/float/LPC_inv_pred_gain_FLP.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/silk/float/SigProc_FLP.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
+#include "SigProc_FLP.h"
#define RC_THRESHOLD 0.9999f
diff --git a/drivers/opus/silk/float/LTP_analysis_filter_FLP.c b/thirdparty/opus/silk/float/LTP_analysis_filter_FLP.c
index 853040d160..849b7c1c52 100644
--- a/drivers/opus/silk/float/LTP_analysis_filter_FLP.c
+++ b/thirdparty/opus/silk/float/LTP_analysis_filter_FLP.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/main_FLP.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FLP.h"
void silk_LTP_analysis_filter_FLP(
silk_float *LTP_res, /* O LTP res MAX_NB_SUBFR*(pre_lgth+subfr_lngth) */
diff --git a/drivers/opus/silk/float/LTP_scale_ctrl_FLP.c b/thirdparty/opus/silk/float/LTP_scale_ctrl_FLP.c
index 4219c14c5b..8dbe29d0fa 100644
--- a/drivers/opus/silk/float/LTP_scale_ctrl_FLP.c
+++ b/thirdparty/opus/silk/float/LTP_scale_ctrl_FLP.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/main_FLP.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FLP.h"
void silk_LTP_scale_ctrl_FLP(
silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
diff --git a/drivers/opus/silk/float/SigProc_FLP.h b/thirdparty/opus/silk/float/SigProc_FLP.h
index 9b14f24f21..f0cb3733be 100644
--- a/drivers/opus/silk/float/SigProc_FLP.h
+++ b/thirdparty/opus/silk/float/SigProc_FLP.h
@@ -28,8 +28,8 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_SIGPROC_FLP_H
#define SILK_SIGPROC_FLP_H
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/celt/float_cast.h"
+#include "SigProc_FIX.h"
+#include "float_cast.h"
#include <math.h>
#ifdef __cplusplus
diff --git a/drivers/opus/silk/float/apply_sine_window_FLP.c b/thirdparty/opus/silk/float/apply_sine_window_FLP.c
index 0d9c894cd8..6aae57c0ab 100644
--- a/drivers/opus/silk/float/apply_sine_window_FLP.c
+++ b/thirdparty/opus/silk/float/apply_sine_window_FLP.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/main_FLP.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FLP.h"
/* Apply sine window to signal vector */
/* Window types: */
diff --git a/drivers/opus/silk/float/autocorrelation_FLP.c b/thirdparty/opus/silk/float/autocorrelation_FLP.c
index 0b78b0230d..8b8a9e659a 100644
--- a/drivers/opus/silk/float/autocorrelation_FLP.c
+++ b/thirdparty/opus/silk/float/autocorrelation_FLP.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/typedef.h"
-#include "opus/silk/float/SigProc_FLP.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "typedef.h"
+#include "SigProc_FLP.h"
/* compute autocorrelation */
void silk_autocorrelation_FLP(
diff --git a/drivers/opus/silk/float/burg_modified_FLP.c b/thirdparty/opus/silk/float/burg_modified_FLP.c
index 567990b850..ea5dc25a93 100644
--- a/drivers/opus/silk/float/burg_modified_FLP.c
+++ b/thirdparty/opus/silk/float/burg_modified_FLP.c
@@ -24,11 +24,14 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/SigProc_FLP.h"
-#include "opus/silk/tuning_parameters.h"
-#include "opus/silk/define.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FLP.h"
+#include "tuning_parameters.h"
+#include "define.h"
#define MAX_FRAME_SIZE 384 /* subfr_length * nb_subfr = ( 0.005 * 16000 + 16 ) * 4 = 384*/
diff --git a/drivers/opus/silk/float/bwexpander_FLP.c b/thirdparty/opus/silk/float/bwexpander_FLP.c
index c47bfa9433..d55a4d79ab 100644
--- a/drivers/opus/silk/float/bwexpander_FLP.c
+++ b/thirdparty/opus/silk/float/bwexpander_FLP.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/SigProc_FLP.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FLP.h"
/* Chirp (bw expand) LP AR filter */
void silk_bwexpander_FLP(
diff --git a/drivers/opus/silk/float/corrMatrix_FLP.c b/thirdparty/opus/silk/float/corrMatrix_FLP.c
index e34b42b541..eae6a1cfca 100644
--- a/drivers/opus/silk/float/corrMatrix_FLP.c
+++ b/thirdparty/opus/silk/float/corrMatrix_FLP.c
@@ -24,13 +24,16 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
/**********************************************************************
* Correlation matrix computations for LS estimate.
**********************************************************************/
-#include "opus/silk/float/main_FLP.h"
+#include "main_FLP.h"
/* Calculates correlation vector X'*t */
void silk_corrVector_FLP(
diff --git a/drivers/opus/silk/float/encode_frame_FLP.c b/thirdparty/opus/silk/float/encode_frame_FLP.c
index 4e46a52ee8..2092a4d9e2 100644
--- a/drivers/opus/silk/float/encode_frame_FLP.c
+++ b/thirdparty/opus/silk/float/encode_frame_FLP.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/main_FLP.h"
-#include "opus/silk/tuning_parameters.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FLP.h"
+#include "tuning_parameters.h"
/* Low Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode with lower bitrate */
static OPUS_INLINE void silk_LBRR_encode_FLP(
diff --git a/drivers/opus/silk/float/energy_FLP.c b/thirdparty/opus/silk/float/energy_FLP.c
index 443f52bb16..24b8179f9e 100644
--- a/drivers/opus/silk/float/energy_FLP.c
+++ b/thirdparty/opus/silk/float/energy_FLP.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/SigProc_FLP.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FLP.h"
/* sum of squares of a silk_float array, with result as double */
double silk_energy_FLP(
diff --git a/drivers/opus/silk/float/find_LPC_FLP.c b/thirdparty/opus/silk/float/find_LPC_FLP.c
index 162a490d1d..fcfe1c3681 100644
--- a/drivers/opus/silk/float/find_LPC_FLP.c
+++ b/thirdparty/opus/silk/float/find_LPC_FLP.c
@@ -24,11 +24,14 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/define.h"
-#include "opus/silk/float/main_FLP.h"
-#include "opus/silk/tuning_parameters.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "define.h"
+#include "main_FLP.h"
+#include "tuning_parameters.h"
/* LPC analysis */
void silk_find_LPC_FLP(
diff --git a/drivers/opus/silk/float/find_LTP_FLP.c b/thirdparty/opus/silk/float/find_LTP_FLP.c
index 9c03eeb6a7..7229996014 100644
--- a/drivers/opus/silk/float/find_LTP_FLP.c
+++ b/thirdparty/opus/silk/float/find_LTP_FLP.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/main_FLP.h"
-#include "opus/silk/tuning_parameters.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FLP.h"
+#include "tuning_parameters.h"
void silk_find_LTP_FLP(
silk_float b[ MAX_NB_SUBFR * LTP_ORDER ], /* O LTP coefs */
diff --git a/drivers/opus/silk/float/find_pitch_lags_FLP.c b/thirdparty/opus/silk/float/find_pitch_lags_FLP.c
index bb7ef8ec2e..f3b22d25ce 100644
--- a/drivers/opus/silk/float/find_pitch_lags_FLP.c
+++ b/thirdparty/opus/silk/float/find_pitch_lags_FLP.c
@@ -24,11 +24,14 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <stdlib.h>
-#include "opus/silk/float/main_FLP.h"
-#include "opus/silk/tuning_parameters.h"
+#include "main_FLP.h"
+#include "tuning_parameters.h"
void silk_find_pitch_lags_FLP(
silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
diff --git a/drivers/opus/silk/float/find_pred_coefs_FLP.c b/thirdparty/opus/silk/float/find_pred_coefs_FLP.c
index c0496ff1b5..1af4fe5f1b 100644
--- a/drivers/opus/silk/float/find_pred_coefs_FLP.c
+++ b/thirdparty/opus/silk/float/find_pred_coefs_FLP.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/main_FLP.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FLP.h"
/* Find LPC and LTP coefficients */
void silk_find_pred_coefs_FLP(
diff --git a/drivers/opus/silk/float/inner_product_FLP.c b/thirdparty/opus/silk/float/inner_product_FLP.c
index 0586c4d7fb..029c012911 100644
--- a/drivers/opus/silk/float/inner_product_FLP.c
+++ b/thirdparty/opus/silk/float/inner_product_FLP.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/SigProc_FLP.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FLP.h"
/* inner product of two silk_float arrays, with result as double */
double silk_inner_product_FLP(
diff --git a/drivers/opus/silk/float/k2a_FLP.c b/thirdparty/opus/silk/float/k2a_FLP.c
index 26ba94e610..12af4e7669 100644
--- a/drivers/opus/silk/float/k2a_FLP.c
+++ b/thirdparty/opus/silk/float/k2a_FLP.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/SigProc_FLP.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FLP.h"
/* step up function, converts reflection coefficients to prediction coefficients */
void silk_k2a_FLP(
diff --git a/drivers/opus/silk/float/levinsondurbin_FLP.c b/thirdparty/opus/silk/float/levinsondurbin_FLP.c
index 7e3c9d6531..f0ba606981 100644
--- a/drivers/opus/silk/float/levinsondurbin_FLP.c
+++ b/thirdparty/opus/silk/float/levinsondurbin_FLP.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/SigProc_FLP.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FLP.h"
/* Solve the normal equations using the Levinson-Durbin recursion */
silk_float silk_levinsondurbin_FLP( /* O prediction error energy */
diff --git a/drivers/opus/silk/float/main_FLP.h b/thirdparty/opus/silk/float/main_FLP.h
index 8f35177549..e5a75972e5 100644
--- a/drivers/opus/silk/float/main_FLP.h
+++ b/thirdparty/opus/silk/float/main_FLP.h
@@ -28,13 +28,13 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_MAIN_FLP_H
#define SILK_MAIN_FLP_H
-#include "opus/silk/float/SigProc_FLP.h"
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/silk/float/structs_FLP.h"
-#include "opus/silk/main.h"
-#include "opus/silk/define.h"
-#include "opus/silk/debug.h"
-#include "opus/celt/entenc.h"
+#include "SigProc_FLP.h"
+#include "SigProc_FIX.h"
+#include "structs_FLP.h"
+#include "main.h"
+#include "define.h"
+#include "debug.h"
+#include "entenc.h"
#ifdef __cplusplus
extern "C"
diff --git a/drivers/opus/silk/float/noise_shape_analysis_FLP.c b/thirdparty/opus/silk/float/noise_shape_analysis_FLP.c
index cbb8ba4470..65f6ea5870 100644
--- a/drivers/opus/silk/float/noise_shape_analysis_FLP.c
+++ b/thirdparty/opus/silk/float/noise_shape_analysis_FLP.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/main_FLP.h"
-#include "opus/silk/tuning_parameters.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FLP.h"
+#include "tuning_parameters.h"
/* Compute gain to make warped filter coefficients have a zero mean log frequency response on a */
/* non-warped frequency scale. (So that it can be implemented with a minimum-phase monic filter.) */
diff --git a/drivers/opus/silk/float/pitch_analysis_core_FLP.c b/thirdparty/opus/silk/float/pitch_analysis_core_FLP.c
index 6a48ae498c..d0e637a29d 100644
--- a/drivers/opus/silk/float/pitch_analysis_core_FLP.c
+++ b/thirdparty/opus/silk/float/pitch_analysis_core_FLP.c
@@ -24,15 +24,18 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
/*****************************************************************************
* Pitch analyser function
******************************************************************************/
-#include "opus/silk/float/SigProc_FLP.h"
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/silk/pitch_est_defines.h"
-#include "opus/celt/pitch.h"
+#include "SigProc_FLP.h"
+#include "SigProc_FIX.h"
+#include "pitch_est_defines.h"
+#include "pitch.h"
#define SCRATCH_SIZE 22
diff --git a/drivers/opus/silk/float/prefilter_FLP.c b/thirdparty/opus/silk/float/prefilter_FLP.c
index 0857888b91..8bc32fb410 100644
--- a/drivers/opus/silk/float/prefilter_FLP.c
+++ b/thirdparty/opus/silk/float/prefilter_FLP.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/main_FLP.h"
-#include "opus/silk/tuning_parameters.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FLP.h"
+#include "tuning_parameters.h"
/*
* Prefilter for finding Quantizer input signal
diff --git a/drivers/opus/silk/float/process_gains_FLP.c b/thirdparty/opus/silk/float/process_gains_FLP.c
index 3a1e46f096..c0da0dae44 100644
--- a/drivers/opus/silk/float/process_gains_FLP.c
+++ b/thirdparty/opus/silk/float/process_gains_FLP.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/main_FLP.h"
-#include "opus/silk/tuning_parameters.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FLP.h"
+#include "tuning_parameters.h"
/* Processing of gains */
void silk_process_gains_FLP(
diff --git a/drivers/opus/silk/float/regularize_correlations_FLP.c b/thirdparty/opus/silk/float/regularize_correlations_FLP.c
index 20e9074a0b..df4612604c 100644
--- a/drivers/opus/silk/float/regularize_correlations_FLP.c
+++ b/thirdparty/opus/silk/float/regularize_correlations_FLP.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/main_FLP.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FLP.h"
/* Add noise to matrix diagonal */
void silk_regularize_correlations_FLP(
diff --git a/drivers/opus/silk/float/residual_energy_FLP.c b/thirdparty/opus/silk/float/residual_energy_FLP.c
index cc462a9e54..b2e03a86a4 100644
--- a/drivers/opus/silk/float/residual_energy_FLP.c
+++ b/thirdparty/opus/silk/float/residual_energy_FLP.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/main_FLP.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FLP.h"
#define MAX_ITERATIONS_RESIDUAL_NRG 10
#define REGULARIZATION_FACTOR 1e-8f
diff --git a/drivers/opus/silk/float/scale_copy_vector_FLP.c b/thirdparty/opus/silk/float/scale_copy_vector_FLP.c
index 2656963e88..20db32b3b1 100644
--- a/drivers/opus/silk/float/scale_copy_vector_FLP.c
+++ b/thirdparty/opus/silk/float/scale_copy_vector_FLP.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/SigProc_FLP.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FLP.h"
/* copy and multiply a vector by a constant */
void silk_scale_copy_vector_FLP(
diff --git a/drivers/opus/silk/float/scale_vector_FLP.c b/thirdparty/opus/silk/float/scale_vector_FLP.c
index ea2aa0e330..108fdcbed5 100644
--- a/drivers/opus/silk/float/scale_vector_FLP.c
+++ b/thirdparty/opus/silk/float/scale_vector_FLP.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/SigProc_FLP.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FLP.h"
/* multiply a vector by a constant */
void silk_scale_vector_FLP(
diff --git a/drivers/opus/silk/float/schur_FLP.c b/thirdparty/opus/silk/float/schur_FLP.c
index f2071db214..ee436f8351 100644
--- a/drivers/opus/silk/float/schur_FLP.c
+++ b/thirdparty/opus/silk/float/schur_FLP.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/SigProc_FLP.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FLP.h"
silk_float silk_schur_FLP( /* O returns residual energy */
silk_float refl_coef[], /* O reflection coefficients (length order) */
diff --git a/drivers/opus/silk/float/solve_LS_FLP.c b/thirdparty/opus/silk/float/solve_LS_FLP.c
index 9d625c695d..7c90d665a0 100644
--- a/drivers/opus/silk/float/solve_LS_FLP.c
+++ b/thirdparty/opus/silk/float/solve_LS_FLP.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/main_FLP.h"
-#include "opus/silk/tuning_parameters.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FLP.h"
+#include "tuning_parameters.h"
/**********************************************************************
* LDL Factorisation. Finds the upper triangular matrix L and the diagonal
diff --git a/drivers/opus/silk/float/sort_FLP.c b/thirdparty/opus/silk/float/sort_FLP.c
index ed212c63c9..f08d7592c5 100644
--- a/drivers/opus/silk/float/sort_FLP.c
+++ b/thirdparty/opus/silk/float/sort_FLP.c
@@ -24,14 +24,17 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
/* Insertion sort (fast for already almost sorted arrays): */
/* Best case: O(n) for an already sorted array */
/* Worst case: O(n^2) for an inversely sorted array */
-#include "opus/silk/typedef.h"
-#include "opus/silk/float/SigProc_FLP.h"
+#include "typedef.h"
+#include "SigProc_FLP.h"
void silk_insertion_sort_decreasing_FLP(
silk_float *a, /* I/O Unsorted / Sorted vector */
diff --git a/drivers/opus/silk/float/structs_FLP.h b/thirdparty/opus/silk/float/structs_FLP.h
index 9eb5eb05eb..14d647ced2 100644
--- a/drivers/opus/silk/float/structs_FLP.h
+++ b/thirdparty/opus/silk/float/structs_FLP.h
@@ -28,9 +28,9 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_STRUCTS_FLP_H
#define SILK_STRUCTS_FLP_H
-#include "opus/silk/typedef.h"
-#include "opus/silk/main.h"
-#include "opus/silk/structs.h"
+#include "typedef.h"
+#include "main.h"
+#include "structs.h"
#ifdef __cplusplus
extern "C"
diff --git a/drivers/opus/silk/float/warped_autocorrelation_FLP.c b/thirdparty/opus/silk/float/warped_autocorrelation_FLP.c
index b814661b92..542414f48e 100644
--- a/drivers/opus/silk/float/warped_autocorrelation_FLP.c
+++ b/thirdparty/opus/silk/float/warped_autocorrelation_FLP.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/main_FLP.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FLP.h"
/* Autocorrelations for a warped frequency axis */
void silk_warped_autocorrelation_FLP(
diff --git a/drivers/opus/silk/float/wrappers_FLP.c b/thirdparty/opus/silk/float/wrappers_FLP.c
index c80c618a92..6666b8efaa 100644
--- a/drivers/opus/silk/float/wrappers_FLP.c
+++ b/thirdparty/opus/silk/float/wrappers_FLP.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/float/main_FLP.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main_FLP.h"
/* Wrappers. Calls flp / fix code */
diff --git a/drivers/opus/silk/gain_quant.c b/thirdparty/opus/silk/gain_quant.c
index 7b7a65d674..64ccd0611b 100644
--- a/drivers/opus/silk/gain_quant.c
+++ b/thirdparty/opus/silk/gain_quant.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
#define OFFSET ( ( MIN_QGAIN_DB * 128 ) / 6 + 16 * 128 )
#define SCALE_Q16 ( ( 65536 * ( N_LEVELS_QGAIN - 1 ) ) / ( ( ( MAX_QGAIN_DB - MIN_QGAIN_DB ) * 128 ) / 6 ) )
diff --git a/drivers/opus/silk/init_decoder.c b/thirdparty/opus/silk/init_decoder.c
index c8f694c9d7..f887c67886 100644
--- a/drivers/opus/silk/init_decoder.c
+++ b/thirdparty/opus/silk/init_decoder.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
/************************/
/* Init Decoder State */
diff --git a/drivers/opus/silk/init_encoder.c b/thirdparty/opus/silk/init_encoder.c
index 1c63edb4b8..65995c33fa 100644
--- a/drivers/opus/silk/init_encoder.c
+++ b/thirdparty/opus/silk/init_encoder.c
@@ -24,14 +24,17 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#ifdef OPUS_FIXED_POINT
-#include "opus/silk/fixed/main_FIX.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#ifdef FIXED_POINT
+#include "main_FIX.h"
#else
-#include "opus/silk/float/main_FLP.h"
+#include "main_FLP.h"
#endif
-#include "opus/silk/tuning_parameters.h"
-#include "opus/celt/cpu_support.h"
+#include "tuning_parameters.h"
+#include "cpu_support.h"
/*********************************/
/* Initialize Silk Encoder state */
diff --git a/drivers/opus/silk/inner_prod_aligned.c b/thirdparty/opus/silk/inner_prod_aligned.c
index 7bd7297c7d..257ae9e04e 100644
--- a/drivers/opus/silk/inner_prod_aligned.c
+++ b/thirdparty/opus/silk/inner_prod_aligned.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
opus_int32 silk_inner_prod_aligned_scale(
const opus_int16 *const inVec1, /* I input vector 1 */
diff --git a/drivers/opus/silk/interpolate.c b/thirdparty/opus/silk/interpolate.c
index 25091b4fa6..1bd8ca4d53 100644
--- a/drivers/opus/silk/interpolate.c
+++ b/thirdparty/opus/silk/interpolate.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
/* Interpolate two vectors */
void silk_interpolate(
diff --git a/drivers/opus/silk/lin2log.c b/thirdparty/opus/silk/lin2log.c
index 694eb1e876..d4fe515321 100644
--- a/drivers/opus/silk/lin2log.c
+++ b/thirdparty/opus/silk/lin2log.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
/* Approximation of 128 * log2() (very close inverse of silk_log2lin()) */
/* Convert input to a log scale */
opus_int32 silk_lin2log(
diff --git a/drivers/opus/silk/log2lin.c b/thirdparty/opus/silk/log2lin.c
index 8d14150a41..b7c48e4740 100644
--- a/drivers/opus/silk/log2lin.c
+++ b/thirdparty/opus/silk/log2lin.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
/* Approximation of 2^() (very close inverse of silk_lin2log()) */
/* Convert input to a linear scale */
diff --git a/drivers/opus/silk/macros.h b/thirdparty/opus/silk/macros.h
index 29efd11ace..bc30303466 100644
--- a/drivers/opus/silk/macros.h
+++ b/thirdparty/opus/silk/macros.h
@@ -27,10 +27,13 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_MACROS_H
#define SILK_MACROS_H
-#include "opus/opus_config.h"
-#include "opus/opus_types.h"
-#include "opus/opus_defines.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "opus_types.h"
+#include "opus_defines.h"
#if OPUS_GNUC_PREREQ(3, 0)
#define opus_likely(x) (__builtin_expect(!!(x), 1))
@@ -108,10 +111,10 @@ POSSIBILITY OF SUCH DAMAGE.
((((a)^0x80000000) & (b) & 0x80000000) ? silk_int32_MAX : (a)-(b)) )
#if defined(MIPSr1_ASM)
-#include "opus/silk/mips/macros_mipsr1.h"
+#include "mips/macros_mipsr1.h"
#endif
-#include "opus/celt/ecintrin.h"
+#include "ecintrin.h"
#ifndef OVERRIDE_silk_CLZ16
static OPUS_INLINE opus_int32 silk_CLZ16(opus_int16 in16)
{
@@ -139,11 +142,11 @@ static OPUS_INLINE opus_int32 silk_CLZ32(opus_int32 in32)
#endif
#ifdef OPUS_ARM_INLINE_ASM
-#include "opus/silk/arm/macros_armv4.h"
+#include "arm/macros_armv4.h"
#endif
#ifdef OPUS_ARM_INLINE_EDSP
-#include "opus/silk/arm/macros_armv5e.h"
+#include "arm/macros_armv5e.h"
#endif
#endif /* SILK_MACROS_H */
diff --git a/drivers/opus/silk/main.h b/thirdparty/opus/silk/main.h
index a6ec2d7e4c..2f90d68f7d 100644
--- a/drivers/opus/silk/main.h
+++ b/thirdparty/opus/silk/main.h
@@ -28,18 +28,18 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_MAIN_H
#define SILK_MAIN_H
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/silk/define.h"
-#include "opus/silk/structs.h"
-#include "opus/silk/tables.h"
-#include "opus/silk/PLC.h"
-#include "opus/silk/control.h"
-#include "opus/silk/debug.h"
-#include "opus/celt/entenc.h"
-#include "opus/celt/entdec.h"
+#include "SigProc_FIX.h"
+#include "define.h"
+#include "structs.h"
+#include "tables.h"
+#include "PLC.h"
+#include "control.h"
+#include "debug.h"
+#include "entenc.h"
+#include "entdec.h"
#if defined(OPUS_X86_MAY_HAVE_SSE4_1)
-#include "opus/silk/x86/main_sse.h"
+#include "x86/main_sse.h"
#endif
/* Convert Left/Right stereo signal to adaptive Mid/Side representation */
diff --git a/drivers/opus/silk/mips/NSQ_del_dec_mipsr1.h b/thirdparty/opus/silk/mips/NSQ_del_dec_mipsr1.h
index 5cecca28b7..f6afd923e8 100644
--- a/drivers/opus/silk/mips/NSQ_del_dec_mipsr1.h
+++ b/thirdparty/opus/silk/mips/NSQ_del_dec_mipsr1.h
@@ -27,10 +27,13 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef __NSQ_DEL_DEC_MIPSR1_H__
#define __NSQ_DEL_DEC_MIPSR1_H__
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
-#include "opus/celt/stack_alloc.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
+#include "stack_alloc.h"
#define OVERRIDE_silk_noise_shape_quantizer_del_dec
static inline void silk_noise_shape_quantizer_del_dec(
diff --git a/drivers/opus/silk/mips/macros_mipsr1.h b/thirdparty/opus/silk/mips/macros_mipsr1.h
index 12ed981a6e..12ed981a6e 100644
--- a/drivers/opus/silk/mips/macros_mipsr1.h
+++ b/thirdparty/opus/silk/mips/macros_mipsr1.h
diff --git a/drivers/opus/silk/mips/sigproc_fix_mipsr1.h b/thirdparty/opus/silk/mips/sigproc_fix_mipsr1.h
index 3b0a695365..3b0a695365 100644
--- a/drivers/opus/silk/mips/sigproc_fix_mipsr1.h
+++ b/thirdparty/opus/silk/mips/sigproc_fix_mipsr1.h
diff --git a/drivers/opus/silk/pitch_est_defines.h b/thirdparty/opus/silk/pitch_est_defines.h
index e2d9e517c4..e1e4b5d768 100644
--- a/drivers/opus/silk/pitch_est_defines.h
+++ b/thirdparty/opus/silk/pitch_est_defines.h
@@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_PE_DEFINES_H
#define SILK_PE_DEFINES_H
-#include "opus/silk/SigProc_FIX.h"
+#include "SigProc_FIX.h"
/********************************************************/
/* Definitions for pitch estimator */
diff --git a/drivers/opus/silk/pitch_est_tables.c b/thirdparty/opus/silk/pitch_est_tables.c
index eb17bf0b26..81a8bacaca 100644
--- a/drivers/opus/silk/pitch_est_tables.c
+++ b/thirdparty/opus/silk/pitch_est_tables.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/typedef.h"
-#include "opus/silk/pitch_est_defines.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "typedef.h"
+#include "pitch_est_defines.h"
const opus_int8 silk_CB_lags_stage2_10_ms[ PE_MAX_NB_SUBFR >> 1][ PE_NB_CBKS_STAGE2_10MS ] =
{
diff --git a/drivers/opus/silk/process_NLSFs.c b/thirdparty/opus/silk/process_NLSFs.c
index 9d8f96d7b7..c27cf03046 100644
--- a/drivers/opus/silk/process_NLSFs.c
+++ b/thirdparty/opus/silk/process_NLSFs.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
/* Limit, stabilize, convert and quantize NLSFs */
void silk_process_NLSFs(
diff --git a/drivers/opus/silk/quant_LTP_gains.c b/thirdparty/opus/silk/quant_LTP_gains.c
index ffc3cb24ab..513a8c4468 100644
--- a/drivers/opus/silk/quant_LTP_gains.c
+++ b/thirdparty/opus/silk/quant_LTP_gains.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
-#include "opus/silk/tuning_parameters.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
+#include "tuning_parameters.h"
void silk_quant_LTP_gains(
opus_int16 B_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /* I/O (un)quantized LTP gains */
diff --git a/drivers/opus/silk/resampler.c b/thirdparty/opus/silk/resampler.c
index 12b2f92060..374fbb3722 100644
--- a/drivers/opus/silk/resampler.c
+++ b/thirdparty/opus/silk/resampler.c
@@ -24,7 +24,10 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
/*
* Matrix of resampling methods used:
@@ -44,7 +47,7 @@ POSSIBILITY OF SUCH DAMAGE.
* AF -> AR2 filter followed by FIR interpolation
*/
-#include "opus/silk/resampler_private.h"
+#include "resampler_private.h"
/* Tables with delay compensation values to equalize total delay for different modes */
static const opus_int8 delay_matrix_enc[ 5 ][ 3 ] = {
diff --git a/drivers/opus/silk/resampler_down2.c b/thirdparty/opus/silk/resampler_down2.c
index 20a42c98a6..cec3634640 100644
--- a/drivers/opus/silk/resampler_down2.c
+++ b/thirdparty/opus/silk/resampler_down2.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/silk/resampler_rom.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
+#include "resampler_rom.h"
/* Downsample by a factor 2 */
void silk_resampler_down2(
diff --git a/drivers/opus/silk/resampler_down2_3.c b/thirdparty/opus/silk/resampler_down2_3.c
index e01dd2bc72..4342614dcc 100644
--- a/drivers/opus/silk/resampler_down2_3.c
+++ b/thirdparty/opus/silk/resampler_down2_3.c
@@ -24,11 +24,14 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/silk/resampler_private.h"
-#include "opus/celt/stack_alloc.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
+#include "resampler_private.h"
+#include "stack_alloc.h"
#define ORDER_FIR 4
diff --git a/drivers/opus/silk/resampler_private.h b/thirdparty/opus/silk/resampler_private.h
index 5c0ee110fc..422a7d9d95 100644
--- a/drivers/opus/silk/resampler_private.h
+++ b/thirdparty/opus/silk/resampler_private.h
@@ -32,9 +32,9 @@ POSSIBILITY OF SUCH DAMAGE.
extern "C" {
#endif
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/silk/resampler_structs.h"
-#include "opus/silk/resampler_rom.h"
+#include "SigProc_FIX.h"
+#include "resampler_structs.h"
+#include "resampler_rom.h"
/* Number of input samples to process in the inner loop */
#define RESAMPLER_MAX_BATCH_SIZE_MS 10
diff --git a/drivers/opus/silk/resampler_private_AR2.c b/thirdparty/opus/silk/resampler_private_AR2.c
index cc753ea704..5fff23714f 100644
--- a/drivers/opus/silk/resampler_private_AR2.c
+++ b/thirdparty/opus/silk/resampler_private_AR2.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/silk/resampler_private.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
+#include "resampler_private.h"
/* Second order AR filter with single delay elements */
void silk_resampler_private_AR2(
diff --git a/drivers/opus/silk/resampler_private_IIR_FIR.c b/thirdparty/opus/silk/resampler_private_IIR_FIR.c
index 9a8733fbbb..6b2b3a2e18 100644
--- a/drivers/opus/silk/resampler_private_IIR_FIR.c
+++ b/thirdparty/opus/silk/resampler_private_IIR_FIR.c
@@ -24,11 +24,14 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/silk/resampler_private.h"
-#include "opus/celt/stack_alloc.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
+#include "resampler_private.h"
+#include "stack_alloc.h"
static OPUS_INLINE opus_int16 *silk_resampler_private_IIR_FIR_INTERPOL(
opus_int16 *out,
diff --git a/drivers/opus/silk/resampler_private_down_FIR.c b/thirdparty/opus/silk/resampler_private_down_FIR.c
index fb9acc60a7..783e42b356 100644
--- a/drivers/opus/silk/resampler_private_down_FIR.c
+++ b/thirdparty/opus/silk/resampler_private_down_FIR.c
@@ -24,11 +24,14 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/silk/resampler_private.h"
-#include "opus/celt/stack_alloc.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
+#include "resampler_private.h"
+#include "stack_alloc.h"
static OPUS_INLINE opus_int16 *silk_resampler_private_down_FIR_INTERPOL(
opus_int16 *out,
diff --git a/drivers/opus/silk/resampler_private_up2_HQ.c b/thirdparty/opus/silk/resampler_private_up2_HQ.c
index 0b23c16dab..c7ec8de365 100644
--- a/drivers/opus/silk/resampler_private_up2_HQ.c
+++ b/thirdparty/opus/silk/resampler_private_up2_HQ.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/silk/resampler_private.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
+#include "resampler_private.h"
/* Upsample by a factor 2, high quality */
/* Uses 2nd order allpass filters for the 2x upsampling, followed by a */
diff --git a/drivers/opus/silk/resampler_rom.c b/thirdparty/opus/silk/resampler_rom.c
index 7079efe1dc..5e6b04476a 100644
--- a/drivers/opus/silk/resampler_rom.c
+++ b/thirdparty/opus/silk/resampler_rom.c
@@ -24,12 +24,15 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
/* Filter coefficients for IIR/FIR polyphase resampling *
* Total size: 179 Words (358 Bytes) */
-#include "opus/silk/resampler_private.h"
+#include "resampler_private.h"
/* Matlab code for the notch filter coefficients: */
/* B = [1, 0.147, 1]; A = [1, 0.107, 0.89]; G = 0.93; freqz(G * B, A, 2^14, 16e3); axis([0, 8000, -10, 1]) */
diff --git a/drivers/opus/silk/resampler_rom.h b/thirdparty/opus/silk/resampler_rom.h
index 2fa586ebf2..490b3388dc 100644
--- a/drivers/opus/silk/resampler_rom.h
+++ b/thirdparty/opus/silk/resampler_rom.h
@@ -33,8 +33,8 @@ extern "C"
{
#endif
-#include "opus/silk/typedef.h"
-#include "opus/silk/resampler_structs.h"
+#include "typedef.h"
+#include "resampler_structs.h"
#define RESAMPLER_DOWN_ORDER_FIR0 18
#define RESAMPLER_DOWN_ORDER_FIR1 24
diff --git a/drivers/opus/silk/resampler_structs.h b/thirdparty/opus/silk/resampler_structs.h
index 9e9457d11c..9e9457d11c 100644
--- a/drivers/opus/silk/resampler_structs.h
+++ b/thirdparty/opus/silk/resampler_structs.h
diff --git a/drivers/opus/silk/shell_coder.c b/thirdparty/opus/silk/shell_coder.c
index 67a5446927..4af341474b 100644
--- a/drivers/opus/silk/shell_coder.c
+++ b/thirdparty/opus/silk/shell_coder.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
/* shell coder; pulse-subframe length is hardcoded */
diff --git a/drivers/opus/silk/sigm_Q15.c b/thirdparty/opus/silk/sigm_Q15.c
index 3171d15f4a..3c507d255b 100644
--- a/drivers/opus/silk/sigm_Q15.c
+++ b/thirdparty/opus/silk/sigm_Q15.c
@@ -24,11 +24,14 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
/* Approximate sigmoid function */
-#include "opus/silk/SigProc_FIX.h"
+#include "SigProc_FIX.h"
/* fprintf(1, '%d, ', round(1024 * ([1 ./ (1 + exp(-(1:5))), 1] - 1 ./ (1 + exp(-(0:5)))))); */
static const opus_int32 sigm_LUT_slope_Q10[ 6 ] = {
diff --git a/drivers/opus/silk/sort.c b/thirdparty/opus/silk/sort.c
index dd2988e5b8..8670dbdd02 100644
--- a/drivers/opus/silk/sort.c
+++ b/thirdparty/opus/silk/sort.c
@@ -24,7 +24,10 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
/* Insertion sort (fast for already almost sorted arrays): */
/* Best case: O(n) for an already sorted array */
@@ -32,7 +35,7 @@ POSSIBILITY OF SUCH DAMAGE.
/* */
/* Shell short: http://en.wikipedia.org/wiki/Shell_sort */
-#include "opus/silk/SigProc_FIX.h"
+#include "SigProc_FIX.h"
void silk_insertion_sort_increasing(
opus_int32 *a, /* I/O Unsorted / Sorted vector */
@@ -80,7 +83,7 @@ void silk_insertion_sort_increasing(
}
}
-#ifdef OPUS_FIXED_POINT
+#ifdef FIXED_POINT
/* This function is only used by the fixed-point build */
void silk_insertion_sort_decreasing_int16(
opus_int16 *a, /* I/O Unsorted / Sorted vector */
diff --git a/drivers/opus/silk/stereo_LR_to_MS.c b/thirdparty/opus/silk/stereo_LR_to_MS.c
index cf8affa90b..42906e6f67 100644
--- a/drivers/opus/silk/stereo_LR_to_MS.c
+++ b/thirdparty/opus/silk/stereo_LR_to_MS.c
@@ -24,10 +24,13 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
-#include "opus/celt/stack_alloc.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
+#include "stack_alloc.h"
/* Convert Left/Right stereo signal to adaptive Mid/Side representation */
void silk_stereo_LR_to_MS(
diff --git a/drivers/opus/silk/stereo_MS_to_LR.c b/thirdparty/opus/silk/stereo_MS_to_LR.c
index 4f553eb694..62521a4f35 100644
--- a/drivers/opus/silk/stereo_MS_to_LR.c
+++ b/thirdparty/opus/silk/stereo_MS_to_LR.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
/* Convert adaptive Mid/Side representation to Left/Right stereo signal */
void silk_stereo_MS_to_LR(
diff --git a/drivers/opus/silk/stereo_decode_pred.c b/thirdparty/opus/silk/stereo_decode_pred.c
index 9e8abf39d0..56ba3925e8 100644
--- a/drivers/opus/silk/stereo_decode_pred.c
+++ b/thirdparty/opus/silk/stereo_decode_pred.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
/* Decode mid/side predictors */
void silk_stereo_decode_pred(
diff --git a/drivers/opus/silk/stereo_encode_pred.c b/thirdparty/opus/silk/stereo_encode_pred.c
index a864d404f6..e6dd195066 100644
--- a/drivers/opus/silk/stereo_encode_pred.c
+++ b/thirdparty/opus/silk/stereo_encode_pred.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
/* Entropy code the mid/side quantization indices */
void silk_stereo_encode_pred(
diff --git a/drivers/opus/silk/stereo_find_predictor.c b/thirdparty/opus/silk/stereo_find_predictor.c
index c7fa3ac555..e30e90bddc 100644
--- a/drivers/opus/silk/stereo_find_predictor.c
+++ b/thirdparty/opus/silk/stereo_find_predictor.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
/* Find least-squares prediction gain for one signal based on another and quantize it */
opus_int32 silk_stereo_find_predictor( /* O Returns predictor in Q13 */
diff --git a/drivers/opus/silk/stereo_quant_pred.c b/thirdparty/opus/silk/stereo_quant_pred.c
index ff2971e7c1..d4ced6c3e8 100644
--- a/drivers/opus/silk/stereo_quant_pred.c
+++ b/thirdparty/opus/silk/stereo_quant_pred.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/main.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "main.h"
/* Quantize mid/side predictors */
void silk_stereo_quant_pred(
diff --git a/drivers/opus/silk/structs.h b/thirdparty/opus/silk/structs.h
index a2876b62a2..827829dc6f 100644
--- a/drivers/opus/silk/structs.h
+++ b/thirdparty/opus/silk/structs.h
@@ -28,11 +28,11 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_STRUCTS_H
#define SILK_STRUCTS_H
-#include "opus/silk/typedef.h"
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/silk/define.h"
-#include "opus/celt/entenc.h"
-#include "opus/celt/entdec.h"
+#include "typedef.h"
+#include "SigProc_FIX.h"
+#include "define.h"
+#include "entenc.h"
+#include "entdec.h"
#ifdef __cplusplus
extern "C"
diff --git a/drivers/opus/silk/sum_sqr_shift.c b/thirdparty/opus/silk/sum_sqr_shift.c
index 1d1da449f4..129df191d8 100644
--- a/drivers/opus/silk/sum_sqr_shift.c
+++ b/thirdparty/opus/silk/sum_sqr_shift.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/SigProc_FIX.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "SigProc_FIX.h"
/* Compute number of bits to right shift the sum of squares of a vector */
/* of int16s to make it fit in an int32 */
diff --git a/drivers/opus/silk/table_LSF_cos.c b/thirdparty/opus/silk/table_LSF_cos.c
index d350df9add..ec9dc63927 100644
--- a/drivers/opus/silk/table_LSF_cos.c
+++ b/thirdparty/opus/silk/table_LSF_cos.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/tables.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "tables.h"
/* Cosine approximation table for LSF conversion */
/* Q12 values (even) */
diff --git a/drivers/opus/silk/tables.h b/thirdparty/opus/silk/tables.h
index 2ad69eec80..7fea6fda39 100644
--- a/drivers/opus/silk/tables.h
+++ b/thirdparty/opus/silk/tables.h
@@ -28,8 +28,8 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_TABLES_H
#define SILK_TABLES_H
-#include "opus/silk/define.h"
-#include "opus/silk/structs.h"
+#include "define.h"
+#include "structs.h"
#ifdef __cplusplus
extern "C"
diff --git a/drivers/opus/silk/tables_LTP.c b/thirdparty/opus/silk/tables_LTP.c
index 9f500b25f2..0e6a0254d5 100644
--- a/drivers/opus/silk/tables_LTP.c
+++ b/thirdparty/opus/silk/tables_LTP.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/tables.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "tables.h"
const opus_uint8 silk_LTP_per_index_iCDF[3] = {
179, 99, 0
diff --git a/drivers/opus/silk/tables_NLSF_CB_NB_MB.c b/thirdparty/opus/silk/tables_NLSF_CB_NB_MB.c
index d1cf99356d..8c59d207aa 100644
--- a/drivers/opus/silk/tables_NLSF_CB_NB_MB.c
+++ b/thirdparty/opus/silk/tables_NLSF_CB_NB_MB.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/tables.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "tables.h"
static const opus_uint8 silk_NLSF_CB1_NB_MB_Q8[ 320 ] = {
12, 35, 60, 83, 108, 132, 157, 180,
diff --git a/drivers/opus/silk/tables_NLSF_CB_WB.c b/thirdparty/opus/silk/tables_NLSF_CB_WB.c
index 5ee6e880c4..50af87eb2e 100644
--- a/drivers/opus/silk/tables_NLSF_CB_WB.c
+++ b/thirdparty/opus/silk/tables_NLSF_CB_WB.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/tables.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "tables.h"
static const opus_uint8 silk_NLSF_CB1_WB_Q8[ 512 ] = {
7, 23, 38, 54, 69, 85, 100, 116,
diff --git a/drivers/opus/silk/tables_gain.c b/thirdparty/opus/silk/tables_gain.c
index e1e4319d7d..37e41d890c 100644
--- a/drivers/opus/silk/tables_gain.c
+++ b/thirdparty/opus/silk/tables_gain.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/tables.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "tables.h"
#ifdef __cplusplus
extern "C"
diff --git a/drivers/opus/silk/tables_other.c b/thirdparty/opus/silk/tables_other.c
index 3713ff8227..398686bf26 100644
--- a/drivers/opus/silk/tables_other.c
+++ b/thirdparty/opus/silk/tables_other.c
@@ -24,11 +24,14 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/structs.h"
-#include "opus/silk/define.h"
-#include "opus/silk/tables.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "structs.h"
+#include "define.h"
+#include "tables.h"
#ifdef __cplusplus
extern "C"
diff --git a/drivers/opus/silk/tables_pitch_lag.c b/thirdparty/opus/silk/tables_pitch_lag.c
index f435b7e016..e80cc59a27 100644
--- a/drivers/opus/silk/tables_pitch_lag.c
+++ b/thirdparty/opus/silk/tables_pitch_lag.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/tables.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "tables.h"
const opus_uint8 silk_pitch_lag_iCDF[ 2 * ( PITCH_EST_MAX_LAG_MS - PITCH_EST_MIN_LAG_MS ) ] = {
253, 250, 244, 233, 212, 182, 150, 131,
diff --git a/drivers/opus/silk/tables_pulses_per_block.c b/thirdparty/opus/silk/tables_pulses_per_block.c
index 21f430791a..c7c01c8893 100644
--- a/drivers/opus/silk/tables_pulses_per_block.c
+++ b/thirdparty/opus/silk/tables_pulses_per_block.c
@@ -24,9 +24,12 @@ 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.
***********************************************************************/
-#include "opus/opus_config.h"
-#include "opus/silk/tables.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "tables.h"
const opus_uint8 silk_max_pulses_table[ 4 ] = {
8, 10, 12, 16
diff --git a/drivers/opus/silk/tuning_parameters.h b/thirdparty/opus/silk/tuning_parameters.h
index 5b8f404235..5b8f404235 100644
--- a/drivers/opus/silk/tuning_parameters.h
+++ b/thirdparty/opus/silk/tuning_parameters.h
diff --git a/drivers/opus/silk/typedef.h b/thirdparty/opus/silk/typedef.h
index 3e193b4a45..97b7e709be 100644
--- a/drivers/opus/silk/typedef.h
+++ b/thirdparty/opus/silk/typedef.h
@@ -28,10 +28,10 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_TYPEDEF_H
#define SILK_TYPEDEF_H
-#include "opus/opus_types.h"
-#include "opus/opus_defines.h"
+#include "opus_types.h"
+#include "opus_defines.h"
-#ifndef OPUS_FIXED_POINT
+#ifndef FIXED_POINT
# include <float.h>
# define silk_float float
# define silk_float_MAX FLT_MAX
diff --git a/drivers/opus/silk/x86/NSQ_del_dec_sse.c b/thirdparty/opus/silk/x86/NSQ_del_dec_sse.c
index e9afbba01b..21d4a8bc1e 100644
--- a/drivers/opus/silk/x86/NSQ_del_dec_sse.c
+++ b/thirdparty/opus/silk/x86/NSQ_del_dec_sse.c
@@ -24,15 +24,18 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <xmmintrin.h>
#include <emmintrin.h>
#include <smmintrin.h>
-#include "opus/silk/main.h"
-#include "opus/celt/x86/x86cpu.h"
+#include "main.h"
+#include "celt/x86/x86cpu.h"
-#include "opus/celt/stack_alloc.h"
+#include "stack_alloc.h"
typedef struct {
opus_int32 sLPC_Q14[ MAX_SUB_FRAME_LENGTH + NSQ_LPC_BUF_LENGTH ];
diff --git a/drivers/opus/silk/x86/NSQ_sse.c b/thirdparty/opus/silk/x86/NSQ_sse.c
index ac0fa1ab04..72f34fd6fc 100644
--- a/drivers/opus/silk/x86/NSQ_sse.c
+++ b/thirdparty/opus/silk/x86/NSQ_sse.c
@@ -24,14 +24,17 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <xmmintrin.h>
#include <emmintrin.h>
#include <smmintrin.h>
-#include "opus/silk/main.h"
-#include "opus/celt/x86/x86cpu.h"
-#include "opus/celt/stack_alloc.h"
+#include "main.h"
+#include "celt/x86/x86cpu.h"
+#include "stack_alloc.h"
static OPUS_INLINE void silk_nsq_scale_states_sse4_1(
const silk_encoder_state *psEncC, /* I Encoder State */
diff --git a/drivers/opus/silk/x86/SigProc_FIX_sse.h b/thirdparty/opus/silk/x86/SigProc_FIX_sse.h
index 67ab30fd78..61efa8da41 100644
--- a/drivers/opus/silk/x86/SigProc_FIX_sse.h
+++ b/thirdparty/opus/silk/x86/SigProc_FIX_sse.h
@@ -27,7 +27,10 @@
#ifndef SIGPROC_FIX_SSE_H
#define SIGPROC_FIX_SSE_H
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#if defined(OPUS_X86_MAY_HAVE_SSE4_1)
void silk_burg_modified_sse4_1(
diff --git a/drivers/opus/silk/x86/VAD_sse.c b/thirdparty/opus/silk/x86/VAD_sse.c
index 5db2c86aa9..4e90f4410d 100644
--- a/drivers/opus/silk/x86/VAD_sse.c
+++ b/thirdparty/opus/silk/x86/VAD_sse.c
@@ -24,14 +24,17 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <xmmintrin.h>
#include <emmintrin.h>
#include <smmintrin.h>
-#include "opus/silk/main.h"
-#include "opus/celt/stack_alloc.h"
+#include "main.h"
+#include "stack_alloc.h"
/* Weighting factors for tilt measure */
static const opus_int32 tiltWeights[ VAD_N_BANDS ] = { 30000, 6000, -12000, -12000 };
diff --git a/drivers/opus/silk/x86/VQ_WMat_EC_sse.c b/thirdparty/opus/silk/x86/VQ_WMat_EC_sse.c
index 3afa42a6e5..74d6c6d0ec 100644
--- a/drivers/opus/silk/x86/VQ_WMat_EC_sse.c
+++ b/thirdparty/opus/silk/x86/VQ_WMat_EC_sse.c
@@ -24,13 +24,16 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <xmmintrin.h>
#include <emmintrin.h>
#include <smmintrin.h>
-#include "opus/silk/main.h"
-#include "opus/celt/x86/x86cpu.h"
+#include "main.h"
+#include "celt/x86/x86cpu.h"
/* Entropy constrained matrix-weighted VQ, hard-coded to 5-element vectors, for a single input data vector */
void silk_VQ_WMat_EC_sse4_1(
diff --git a/drivers/opus/silk/x86/main_sse.h b/thirdparty/opus/silk/x86/main_sse.h
index 6fef1b358b..afd5ec26e1 100644
--- a/drivers/opus/silk/x86/main_sse.h
+++ b/thirdparty/opus/silk/x86/main_sse.h
@@ -27,7 +27,10 @@
#ifndef MAIN_SSE_H
#define MAIN_SSE_H
-#include "opus/opus_config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
# if defined(OPUS_X86_MAY_HAVE_SSE4_1)
diff --git a/drivers/opus/silk/x86/x86_silk_map.c b/thirdparty/opus/silk/x86/x86_silk_map.c
index c3502114d1..818841f2c1 100644
--- a/drivers/opus/silk/x86/x86_silk_map.c
+++ b/thirdparty/opus/silk/x86/x86_silk_map.c
@@ -24,19 +24,22 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus/opus_config.h"
-#include "opus/celt/x86/x86cpu.h"
-#include "opus/silk/structs.h"
-#include "opus/silk/SigProc_FIX.h"
-#include "opus/celt/pitch.h"
-#include "opus/silk/main.h"
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
+
+#include "celt/x86/x86cpu.h"
+#include "structs.h"
+#include "SigProc_FIX.h"
+#include "pitch.h"
+#include "main.h"
#if !defined(OPUS_X86_PRESUME_SSE4_1)
#if defined(FIXED_POINT)
-#include "opus/silk/fixed/main_FIX.h"
+#include "fixed/main_FIX.h"
opus_int64 (*const SILK_INNER_PROD16_ALIGNED_64_IMPL[ OPUS_ARCHMASK + 1 ] )(
const opus_int16 *inVec1,
diff --git a/drivers/opus/stream.c b/thirdparty/opus/stream.c
index 2ac12642dd..0238a6b31b 100644
--- a/drivers/opus/stream.c
+++ b/thirdparty/opus/stream.c
@@ -14,9 +14,11 @@
last mod: $Id: vorbisfile.c 17573 2010-10-27 14:53:59Z xiphmont $
********************************************************************/
-#include "opus/opus_config.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
-#include "opus/internal.h"
+#include "internal.h"
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/drivers/opus/tansig_table.h b/thirdparty/opus/tansig_table.h
index c76f844a72..c76f844a72 100644
--- a/drivers/opus/tansig_table.h
+++ b/thirdparty/opus/tansig_table.h
diff --git a/drivers/opus/wincerts.c b/thirdparty/opus/wincerts.c
index 1a5b634063..b0e35aa352 100644
--- a/drivers/opus/wincerts.c
+++ b/thirdparty/opus/wincerts.c
@@ -15,9 +15,12 @@
action, so I'm giving up and re-implementing it locally.
[1] <http://rt.openssl.org/Ticket/Display.html?id=2158>*/
-#include "opus/opus_config.h"
-#include "opus/internal.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "internal.h"
#if defined(OP_ENABLE_HTTP)&&defined(_WIN32)
/*You must include windows.h before wincrypt.h and x509.h.*/
# define WIN32_LEAN_AND_MEAN
diff --git a/drivers/opus/winerrno.h b/thirdparty/opus/winerrno.h
index 32a90b4ee1..32a90b4ee1 100644
--- a/drivers/opus/winerrno.h
+++ b/thirdparty/opus/winerrno.h