SCsub 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. #!/usr/bin/env python
  2. Import('env')
  3. Import('env_modules')
  4. stub = True
  5. env_opus = env_modules.Clone()
  6. # Thirdparty source files
  7. if env['builtin_opus']:
  8. thirdparty_dir = "#thirdparty/opus/"
  9. thirdparty_sources = [
  10. "silk/tables_other.c",
  11. "silk/sum_sqr_shift.c",
  12. "silk/PLC.c",
  13. "silk/dec_API.c",
  14. "silk/decode_pulses.c",
  15. "silk/inner_prod_aligned.c",
  16. "silk/init_encoder.c",
  17. "silk/interpolate.c",
  18. "silk/stereo_encode_pred.c",
  19. "silk/decode_frame.c",
  20. "silk/NLSF_del_dec_quant.c",
  21. "silk/VAD.c",
  22. "silk/resampler_private_AR2.c",
  23. "silk/NLSF_unpack.c",
  24. "silk/resampler_down2.c",
  25. "silk/sort.c",
  26. "silk/resampler_private_IIR_FIR.c",
  27. "silk/resampler_down2_3.c",
  28. "silk/resampler_private_up2_HQ.c",
  29. "silk/tables_gain.c",
  30. "silk/stereo_find_predictor.c",
  31. "silk/stereo_quant_pred.c",
  32. "silk/NLSF_stabilize.c",
  33. "silk/ana_filt_bank_1.c",
  34. "silk/check_control_input.c",
  35. "silk/bwexpander.c",
  36. "silk/A2NLSF.c",
  37. "silk/LPC_inv_pred_gain.c",
  38. "silk/log2lin.c",
  39. "silk/process_NLSFs.c",
  40. "silk/sigm_Q15.c",
  41. "silk/VQ_WMat_EC.c",
  42. "silk/quant_LTP_gains.c",
  43. "silk/resampler_private_down_FIR.c",
  44. "silk/NLSF_decode.c",
  45. "silk/control_codec.c",
  46. "silk/NLSF_VQ_weights_laroia.c",
  47. "silk/decode_pitch.c",
  48. "silk/stereo_decode_pred.c",
  49. "silk/tables_pulses_per_block.c",
  50. "silk/init_decoder.c",
  51. "silk/table_LSF_cos.c",
  52. "silk/decode_core.c",
  53. "silk/code_signs.c",
  54. "silk/enc_API.c",
  55. "silk/tables_LTP.c",
  56. "silk/pitch_est_tables.c",
  57. "silk/biquad_alt.c",
  58. "silk/encode_indices.c",
  59. "silk/tables_NLSF_CB_WB.c",
  60. "silk/debug.c",
  61. "silk/decode_parameters.c",
  62. "silk/tables_pitch_lag.c",
  63. "silk/NLSF2A.c",
  64. "silk/resampler.c",
  65. "silk/decode_indices.c",
  66. "silk/NLSF_VQ.c",
  67. "silk/bwexpander_32.c",
  68. "silk/tables_NLSF_CB_NB_MB.c",
  69. "silk/encode_pulses.c",
  70. "silk/NSQ_del_dec.c",
  71. "silk/control_SNR.c",
  72. "silk/shell_coder.c",
  73. "silk/NLSF_encode.c",
  74. "silk/stereo_MS_to_LR.c",
  75. "silk/stereo_LR_to_MS.c",
  76. "silk/HP_variable_cutoff.c",
  77. "silk/LPC_analysis_filter.c",
  78. "silk/CNG.c",
  79. "silk/decoder_set_fs.c",
  80. "silk/resampler_rom.c",
  81. "silk/control_audio_bandwidth.c",
  82. "silk/lin2log.c",
  83. "silk/LP_variable_cutoff.c",
  84. "silk/NSQ.c",
  85. "silk/gain_quant.c",
  86. "celt/laplace.c",
  87. "celt/vq.c",
  88. "celt/quant_bands.c",
  89. "celt/kiss_fft.c",
  90. "celt/entcode.c",
  91. "celt/entenc.c",
  92. "celt/celt_lpc.c",
  93. "celt/pitch.c",
  94. "celt/rate.c",
  95. "celt/mathops.c",
  96. #"celt/arm/armcpu.c",
  97. #"celt/arm/celt_neon_intr.c",
  98. #"celt/arm/celt_ne10_mdct.c",
  99. #"celt/arm/celt_ne10_fft.c",
  100. #"celt/arm/arm_celt_map.c",
  101. "celt/celt_encoder.c",
  102. "celt/celt.c",
  103. "celt/bands.c",
  104. "celt/cwrs.c",
  105. "celt/entdec.c",
  106. "celt/celt_decoder.c",
  107. "celt/mdct.c",
  108. "celt/modes.c",
  109. "repacketizer.c",
  110. "mlp_data.c",
  111. "opus_multistream.c",
  112. "opusfile.c",
  113. "opus_encoder.c",
  114. "analysis.c",
  115. "mlp.c",
  116. "info.c",
  117. "stream.c",
  118. "opus_decoder.c",
  119. "internal.c",
  120. "wincerts.c",
  121. "opus.c",
  122. "opus_multistream_encoder.c",
  123. "http.c",
  124. "opus_multistream_decoder.c"
  125. ]
  126. opus_sources_silk = []
  127. if("opus_fixed_point" in env and env.opus_fixed_point == "yes"):
  128. env_opus.Append(CFLAGS=["-DFIXED_POINT"])
  129. opus_sources_silk = [
  130. "silk/fixed/schur64_FIX.c",
  131. "silk/fixed/residual_energy16_FIX.c",
  132. "silk/fixed/encode_frame_FIX.c",
  133. "silk/fixed/regularize_correlations_FIX.c",
  134. "silk/fixed/apply_sine_window_FIX.c",
  135. "silk/fixed/solve_LS_FIX.c",
  136. "silk/fixed/schur_FIX.c",
  137. "silk/fixed/pitch_analysis_core_FIX.c",
  138. "silk/fixed/noise_shape_analysis_FIX.c",
  139. "silk/fixed/find_LTP_FIX.c",
  140. "silk/fixed/vector_ops_FIX.c",
  141. "silk/fixed/autocorr_FIX.c",
  142. "silk/fixed/warped_autocorrelation_FIX.c",
  143. "silk/fixed/find_pitch_lags_FIX.c",
  144. "silk/fixed/k2a_Q16_FIX.c",
  145. "silk/fixed/LTP_scale_ctrl_FIX.c",
  146. "silk/fixed/corrMatrix_FIX.c",
  147. "silk/fixed/prefilter_FIX.c",
  148. "silk/fixed/find_LPC_FIX.c",
  149. "silk/fixed/residual_energy_FIX.c",
  150. "silk/fixed/process_gains_FIX.c",
  151. "silk/fixed/LTP_analysis_filter_FIX.c",
  152. "silk/fixed/k2a_FIX.c",
  153. "silk/fixed/burg_modified_FIX.c",
  154. "silk/fixed/find_pred_coefs_FIX.c"
  155. ]
  156. else:
  157. opus_sources_silk = [
  158. "silk/float/LTP_scale_ctrl_FLP.c",
  159. "silk/float/regularize_correlations_FLP.c",
  160. "silk/float/corrMatrix_FLP.c",
  161. "silk/float/LPC_analysis_filter_FLP.c",
  162. "silk/float/levinsondurbin_FLP.c",
  163. "silk/float/schur_FLP.c",
  164. "silk/float/scale_vector_FLP.c",
  165. "silk/float/apply_sine_window_FLP.c",
  166. "silk/float/pitch_analysis_core_FLP.c",
  167. "silk/float/wrappers_FLP.c",
  168. "silk/float/bwexpander_FLP.c",
  169. "silk/float/warped_autocorrelation_FLP.c",
  170. "silk/float/solve_LS_FLP.c",
  171. "silk/float/find_LPC_FLP.c",
  172. "silk/float/autocorrelation_FLP.c",
  173. "silk/float/find_pred_coefs_FLP.c",
  174. "silk/float/find_pitch_lags_FLP.c",
  175. "silk/float/burg_modified_FLP.c",
  176. "silk/float/find_LTP_FLP.c",
  177. "silk/float/energy_FLP.c",
  178. "silk/float/sort_FLP.c",
  179. "silk/float/LPC_inv_pred_gain_FLP.c",
  180. "silk/float/k2a_FLP.c",
  181. "silk/float/noise_shape_analysis_FLP.c",
  182. "silk/float/inner_product_FLP.c",
  183. "silk/float/process_gains_FLP.c",
  184. "silk/float/encode_frame_FLP.c",
  185. "silk/float/scale_copy_vector_FLP.c",
  186. "silk/float/residual_energy_FLP.c",
  187. "silk/float/LTP_analysis_filter_FLP.c",
  188. "silk/float/prefilter_FLP.c"
  189. ]
  190. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources + opus_sources_silk]
  191. # also requires libogg
  192. if env['builtin_libogg']:
  193. env_opus.Append(CPPPATH=["#thirdparty/libogg"])
  194. env_opus.Append(CFLAGS=["-DHAVE_CONFIG_H"])
  195. thirdparty_include_paths = [
  196. "",
  197. "celt",
  198. "opus",
  199. "silk",
  200. "silk/fixed",
  201. "silk/float",
  202. ]
  203. env_opus.Append(CPPPATH=[thirdparty_dir + "/" + dir for dir in thirdparty_include_paths])
  204. env_thirdparty = env_opus.Clone()
  205. env_thirdparty.disable_warnings()
  206. env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
  207. if not stub:
  208. # Module files
  209. env_opus.add_source_files(env.modules_sources, "*.cpp")
  210. else:
  211. # Module files
  212. env_opus.add_source_files(env.modules_sources, "stub/register_types.cpp")