ogg/vorbis/opus: Make them modules and unbundle thirdparty libs

Took the opportunity to undo the Godot changed made to the
opus source. The opus module should eventually be built in its
own environment to avoid polluting others with too many include
dirs and defines.

TODO: Fix the platform/ stuff for opus.
This commit is contained in:
Rémi Verschelde 2016-10-12 20:37:38 +02:00
parent ee3cf211c6
commit d9a291f641
408 changed files with 4225 additions and 1402 deletions

View File

@ -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'

7
drivers/SCsub vendored
View File

@ -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");

View File

@ -1,9 +0,0 @@
Import('env')
ogg_sources = [
"ogg/bitwise.c",
"ogg/framing.c",
]
env.drivers_sources+=ogg_sources

View File

@ -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')

View File

@ -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

View File

@ -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

20
modules/ogg/SCsub Normal file
View File

@ -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')

6
modules/ogg/config.py Normal file
View File

@ -0,0 +1,6 @@
def can_build(platform):
return True
def configure(env):
pass

View File

@ -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() {}

View File

@ -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();

211
modules/opus/SCsub Normal file
View File

@ -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')

View File

@ -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 {

6
modules/opus/config.py Normal file
View File

@ -0,0 +1,6 @@
def can_build(platform):
return True
def configure(env):
pass

View File

@ -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 );
}

View File

@ -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();

44
modules/vorbis/SCsub Normal file
View File

@ -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')

View File

@ -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 {

6
modules/vorbis/config.py Normal file
View File

@ -0,0 +1,6 @@
def can_build(platform):
return True
def configure(env):
pass

View File

@ -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 );
}

View File

@ -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();

View File

@ -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"

View File

@ -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

View File

@ -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'])

View File

@ -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'])

40
thirdparty/README.md vendored
View File

@ -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

Some files were not shown because too many files have changed in this diff Show More