Bug 875013 - Remove VPATH in media/libopus; r=gps, r=tterribe

This commit is contained in:
Mike Shal 2014-01-09 15:44:24 -05:00
parent e32b7e7c65
commit d499fc211f
8 changed files with 292 additions and 220 deletions

View File

@ -1,41 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
LOCAL_INCLUDES += \
-I$(srcdir)/include \
-I$(srcdir)/celt \
-I$(srcdir)/silk \
-I$(srcdir)/src \
$(NULL)
VPATH += \
$(srcdir)/celt \
$(srcdir)/silk \
$(srcdir)/src \
$(NULL)
include $(srcdir)/celt_sources.mk
include $(srcdir)/silk_sources.mk
include $(srcdir)/opus_sources.mk
CSRCS = \
$(notdir $(CELT_SOURCES)) \
$(notdir $(SILK_SOURCES)) \
$(notdir $(OPUS_SOURCES)) \
$(NULL)
ifndef MOZ_SAMPLE_TYPE_FLOAT32
MOZ_OPUS_FIXED = 1
endif
ifdef MOZ_OPUS_FIXED
LOCAL_INCLUDES += -I$(srcdir)/silk/fixed
VPATH += $(srcdir)/silk/fixed
CSRCS += $(notdir $(SILK_SOURCES_FIXED))
else
LOCAL_INCLUDES += -I$(srcdir)/silk/float
VPATH += $(srcdir)/silk/float
CSRCS += $(notdir $(SILK_SOURCES_FLOAT)) \
$(notdir $(OPUS_SOURCES_FLOAT))
endif

View File

@ -1,28 +0,0 @@
CELT_SOURCES = celt/bands.c \
celt/celt.c \
celt/celt_encoder.c \
celt/celt_decoder.c \
celt/cwrs.c \
celt/entcode.c \
celt/entdec.c \
celt/entenc.c \
celt/kiss_fft.c \
celt/laplace.c \
celt/mathops.c \
celt/mdct.c \
celt/modes.c \
celt/pitch.c \
celt/celt_lpc.c \
celt/quant_bands.c \
celt/rate.c \
celt/vq.c
CELT_SOURCES_ARM = \
celt/arm/armcpu.c \
celt/arm/arm_celt_map.c
CELT_SOURCES_ARM_ASM = \
celt/arm/celt_pitch_xcorr_arm.s
CELT_AM_SOURCES_ARM_ASM = \
celt/arm/armopts.s.in

View File

@ -0,0 +1,70 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# This file takes the .mk files from an upstream opus repo and generates the
# sources.mozbuild file. It is invoked as part of update.sh
import sys
import re
def add_value(values, text):
text = text.replace('\\', '')
text = text.strip()
if text:
values.append(text)
def write_values(output, values):
for value in sorted(values, key=lambda x: x.lower()):
output.write(" '%s',\n" % value)
output.write(']\n\n')
def generate_sources_mozbuild(path):
makefiles = [
'celt_sources.mk',
'opus_sources.mk',
'silk_sources.mk',
]
var_definition = re.compile('([A-Z_]*) = (.*)')
with open('sources.mozbuild', 'w') as output:
output.write('# THIS FILE WAS AUTOMATICALLY GENERATED BY %s. DO NOT EDIT.\n' % sys.argv[0])
for makefile in makefiles:
values = []
definition_started = False
with open('%s/%s' % (path, makefile), 'r') as mk:
for line in mk:
line = line.rstrip()
result = var_definition.match(line)
if result:
if definition_started:
write_values(output, values)
values = []
definition_started = True
# Some variable definitions have the first entry on the
# first line. Eg:
#
# CELT_SOURCES = celt/bands.c
#
# So we treat the first group as the variable name and
# the second group as a potential value.
#
# Note that we write the variable name in lower case (so
# "CELT_SOURCES" in the .mk file becomes "celt_sources"
# in the .mozbuild file) because moz.build reserves
# upper-case variable names for build system outputs.
output.write('%s = [\n' % result.group(1).lower())
add_value(values, result.group(2))
else:
add_value(values, line)
write_values(output, values)
if __name__ == '__main__':
if len(sys.argv) != 2:
print "Usage: %s /path/to/opus" % (sys.argv[0])
sys.exit(1)
generate_sources_mozbuild(sys.argv[1])

View File

@ -37,3 +37,30 @@ if CONFIG['OS_ARCH'] == 'SunOS':
if not CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']:
DEFINES['FIXED_POINT'] = 1
DEFINES['DISABLE_FLOAT_API'] = True
LOCAL_INCLUDES += [
'celt',
'include',
'silk',
'src',
]
# sources.mozbuild is generated from gen-sources.py when a new libopus is
# imported.
include('sources.mozbuild')
SOURCES += celt_sources
SOURCES += silk_sources
SOURCES += opus_sources
if CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']:
LOCAL_INCLUDES += [
'silk/float',
]
SOURCES += silk_sources_float
SOURCES += opus_sources_float
else:
LOCAL_INCLUDES += [
'silk/fixed',
]
SOURCES += silk_sources_fixed

View File

@ -1,12 +0,0 @@
OPUS_SOURCES = src/opus.c \
src/opus_decoder.c \
src/opus_encoder.c \
src/opus_multistream.c \
src/opus_multistream_encoder.c \
src/opus_multistream_decoder.c \
src/repacketizer.c
OPUS_SOURCES_FLOAT = \
src/analysis.c \
src/mlp.c \
src/mlp_data.c

View File

@ -1,138 +0,0 @@
SILK_SOURCES = \
silk/CNG.c \
silk/code_signs.c \
silk/init_decoder.c \
silk/decode_core.c \
silk/decode_frame.c \
silk/decode_parameters.c \
silk/decode_indices.c \
silk/decode_pulses.c \
silk/decoder_set_fs.c \
silk/dec_API.c \
silk/enc_API.c \
silk/encode_indices.c \
silk/encode_pulses.c \
silk/gain_quant.c \
silk/interpolate.c \
silk/LP_variable_cutoff.c \
silk/NLSF_decode.c \
silk/NSQ.c \
silk/NSQ_del_dec.c \
silk/PLC.c \
silk/shell_coder.c \
silk/tables_gain.c \
silk/tables_LTP.c \
silk/tables_NLSF_CB_NB_MB.c \
silk/tables_NLSF_CB_WB.c \
silk/tables_other.c \
silk/tables_pitch_lag.c \
silk/tables_pulses_per_block.c \
silk/VAD.c \
silk/control_audio_bandwidth.c \
silk/quant_LTP_gains.c \
silk/VQ_WMat_EC.c \
silk/HP_variable_cutoff.c \
silk/NLSF_encode.c \
silk/NLSF_VQ.c \
silk/NLSF_unpack.c \
silk/NLSF_del_dec_quant.c \
silk/process_NLSFs.c \
silk/stereo_LR_to_MS.c \
silk/stereo_MS_to_LR.c \
silk/check_control_input.c \
silk/control_SNR.c \
silk/init_encoder.c \
silk/control_codec.c \
silk/A2NLSF.c \
silk/ana_filt_bank_1.c \
silk/biquad_alt.c \
silk/bwexpander_32.c \
silk/bwexpander.c \
silk/debug.c \
silk/decode_pitch.c \
silk/inner_prod_aligned.c \
silk/lin2log.c \
silk/log2lin.c \
silk/LPC_analysis_filter.c \
silk/LPC_inv_pred_gain.c \
silk/table_LSF_cos.c \
silk/NLSF2A.c \
silk/NLSF_stabilize.c \
silk/NLSF_VQ_weights_laroia.c \
silk/pitch_est_tables.c \
silk/resampler.c \
silk/resampler_down2_3.c \
silk/resampler_down2.c \
silk/resampler_private_AR2.c \
silk/resampler_private_down_FIR.c \
silk/resampler_private_IIR_FIR.c \
silk/resampler_private_up2_HQ.c \
silk/resampler_rom.c \
silk/sigm_Q15.c \
silk/sort.c \
silk/sum_sqr_shift.c \
silk/stereo_decode_pred.c \
silk/stereo_encode_pred.c \
silk/stereo_find_predictor.c \
silk/stereo_quant_pred.c
SILK_SOURCES_FIXED = \
silk/fixed/LTP_analysis_filter_FIX.c \
silk/fixed/LTP_scale_ctrl_FIX.c \
silk/fixed/corrMatrix_FIX.c \
silk/fixed/encode_frame_FIX.c \
silk/fixed/find_LPC_FIX.c \
silk/fixed/find_LTP_FIX.c \
silk/fixed/find_pitch_lags_FIX.c \
silk/fixed/find_pred_coefs_FIX.c \
silk/fixed/noise_shape_analysis_FIX.c \
silk/fixed/prefilter_FIX.c \
silk/fixed/process_gains_FIX.c \
silk/fixed/regularize_correlations_FIX.c \
silk/fixed/residual_energy16_FIX.c \
silk/fixed/residual_energy_FIX.c \
silk/fixed/solve_LS_FIX.c \
silk/fixed/warped_autocorrelation_FIX.c \
silk/fixed/apply_sine_window_FIX.c \
silk/fixed/autocorr_FIX.c \
silk/fixed/burg_modified_FIX.c \
silk/fixed/k2a_FIX.c \
silk/fixed/k2a_Q16_FIX.c \
silk/fixed/pitch_analysis_core_FIX.c \
silk/fixed/vector_ops_FIX.c \
silk/fixed/schur64_FIX.c \
silk/fixed/schur_FIX.c
SILK_SOURCES_FLOAT = \
silk/float/apply_sine_window_FLP.c \
silk/float/corrMatrix_FLP.c \
silk/float/encode_frame_FLP.c \
silk/float/find_LPC_FLP.c \
silk/float/find_LTP_FLP.c \
silk/float/find_pitch_lags_FLP.c \
silk/float/find_pred_coefs_FLP.c \
silk/float/LPC_analysis_filter_FLP.c \
silk/float/LTP_analysis_filter_FLP.c \
silk/float/LTP_scale_ctrl_FLP.c \
silk/float/noise_shape_analysis_FLP.c \
silk/float/prefilter_FLP.c \
silk/float/process_gains_FLP.c \
silk/float/regularize_correlations_FLP.c \
silk/float/residual_energy_FLP.c \
silk/float/solve_LS_FLP.c \
silk/float/warped_autocorrelation_FLP.c \
silk/float/wrappers_FLP.c \
silk/float/autocorrelation_FLP.c \
silk/float/burg_modified_FLP.c \
silk/float/bwexpander_FLP.c \
silk/float/energy_FLP.c \
silk/float/inner_product_FLP.c \
silk/float/k2a_FLP.c \
silk/float/levinsondurbin_FLP.c \
silk/float/LPC_inv_pred_gain_FLP.c \
silk/float/pitch_analysis_core_FLP.c \
silk/float/scale_copy_vector_FLP.c \
silk/float/scale_vector_FLP.c \
silk/float/schur_FLP.c \
silk/float/sort_FLP.c

View File

@ -0,0 +1,192 @@
# THIS FILE WAS AUTOMATICALLY GENERATED BY gen-sources.py. DO NOT EDIT.
celt_sources = [
'celt/bands.c',
'celt/celt.c',
'celt/celt_decoder.c',
'celt/celt_encoder.c',
'celt/celt_lpc.c',
'celt/cwrs.c',
'celt/entcode.c',
'celt/entdec.c',
'celt/entenc.c',
'celt/kiss_fft.c',
'celt/laplace.c',
'celt/mathops.c',
'celt/mdct.c',
'celt/modes.c',
'celt/pitch.c',
'celt/quant_bands.c',
'celt/rate.c',
'celt/vq.c',
]
celt_sources_arm = [
'celt/arm/arm_celt_map.c',
'celt/arm/armcpu.c',
]
celt_sources_arm_asm = [
'celt/arm/celt_pitch_xcorr_arm.s',
]
celt_am_sources_arm_asm = [
'celt/arm/armopts.s.in',
]
opus_sources = [
'src/opus.c',
'src/opus_decoder.c',
'src/opus_encoder.c',
'src/opus_multistream.c',
'src/opus_multistream_decoder.c',
'src/opus_multistream_encoder.c',
'src/repacketizer.c',
]
opus_sources_float = [
'src/analysis.c',
'src/mlp.c',
'src/mlp_data.c',
]
silk_sources = [
'silk/A2NLSF.c',
'silk/ana_filt_bank_1.c',
'silk/biquad_alt.c',
'silk/bwexpander.c',
'silk/bwexpander_32.c',
'silk/check_control_input.c',
'silk/CNG.c',
'silk/code_signs.c',
'silk/control_audio_bandwidth.c',
'silk/control_codec.c',
'silk/control_SNR.c',
'silk/debug.c',
'silk/dec_API.c',
'silk/decode_core.c',
'silk/decode_frame.c',
'silk/decode_indices.c',
'silk/decode_parameters.c',
'silk/decode_pitch.c',
'silk/decode_pulses.c',
'silk/decoder_set_fs.c',
'silk/enc_API.c',
'silk/encode_indices.c',
'silk/encode_pulses.c',
'silk/gain_quant.c',
'silk/HP_variable_cutoff.c',
'silk/init_decoder.c',
'silk/init_encoder.c',
'silk/inner_prod_aligned.c',
'silk/interpolate.c',
'silk/lin2log.c',
'silk/log2lin.c',
'silk/LP_variable_cutoff.c',
'silk/LPC_analysis_filter.c',
'silk/LPC_inv_pred_gain.c',
'silk/NLSF2A.c',
'silk/NLSF_decode.c',
'silk/NLSF_del_dec_quant.c',
'silk/NLSF_encode.c',
'silk/NLSF_stabilize.c',
'silk/NLSF_unpack.c',
'silk/NLSF_VQ.c',
'silk/NLSF_VQ_weights_laroia.c',
'silk/NSQ.c',
'silk/NSQ_del_dec.c',
'silk/pitch_est_tables.c',
'silk/PLC.c',
'silk/process_NLSFs.c',
'silk/quant_LTP_gains.c',
'silk/resampler.c',
'silk/resampler_down2.c',
'silk/resampler_down2_3.c',
'silk/resampler_private_AR2.c',
'silk/resampler_private_down_FIR.c',
'silk/resampler_private_IIR_FIR.c',
'silk/resampler_private_up2_HQ.c',
'silk/resampler_rom.c',
'silk/shell_coder.c',
'silk/sigm_Q15.c',
'silk/sort.c',
'silk/stereo_decode_pred.c',
'silk/stereo_encode_pred.c',
'silk/stereo_find_predictor.c',
'silk/stereo_LR_to_MS.c',
'silk/stereo_MS_to_LR.c',
'silk/stereo_quant_pred.c',
'silk/sum_sqr_shift.c',
'silk/table_LSF_cos.c',
'silk/tables_gain.c',
'silk/tables_LTP.c',
'silk/tables_NLSF_CB_NB_MB.c',
'silk/tables_NLSF_CB_WB.c',
'silk/tables_other.c',
'silk/tables_pitch_lag.c',
'silk/tables_pulses_per_block.c',
'silk/VAD.c',
'silk/VQ_WMat_EC.c',
]
silk_sources_fixed = [
'silk/fixed/apply_sine_window_FIX.c',
'silk/fixed/autocorr_FIX.c',
'silk/fixed/burg_modified_FIX.c',
'silk/fixed/corrMatrix_FIX.c',
'silk/fixed/encode_frame_FIX.c',
'silk/fixed/find_LPC_FIX.c',
'silk/fixed/find_LTP_FIX.c',
'silk/fixed/find_pitch_lags_FIX.c',
'silk/fixed/find_pred_coefs_FIX.c',
'silk/fixed/k2a_FIX.c',
'silk/fixed/k2a_Q16_FIX.c',
'silk/fixed/LTP_analysis_filter_FIX.c',
'silk/fixed/LTP_scale_ctrl_FIX.c',
'silk/fixed/noise_shape_analysis_FIX.c',
'silk/fixed/pitch_analysis_core_FIX.c',
'silk/fixed/prefilter_FIX.c',
'silk/fixed/process_gains_FIX.c',
'silk/fixed/regularize_correlations_FIX.c',
'silk/fixed/residual_energy16_FIX.c',
'silk/fixed/residual_energy_FIX.c',
'silk/fixed/schur64_FIX.c',
'silk/fixed/schur_FIX.c',
'silk/fixed/solve_LS_FIX.c',
'silk/fixed/vector_ops_FIX.c',
'silk/fixed/warped_autocorrelation_FIX.c',
]
silk_sources_float = [
'silk/float/apply_sine_window_FLP.c',
'silk/float/autocorrelation_FLP.c',
'silk/float/burg_modified_FLP.c',
'silk/float/bwexpander_FLP.c',
'silk/float/corrMatrix_FLP.c',
'silk/float/encode_frame_FLP.c',
'silk/float/energy_FLP.c',
'silk/float/find_LPC_FLP.c',
'silk/float/find_LTP_FLP.c',
'silk/float/find_pitch_lags_FLP.c',
'silk/float/find_pred_coefs_FLP.c',
'silk/float/inner_product_FLP.c',
'silk/float/k2a_FLP.c',
'silk/float/levinsondurbin_FLP.c',
'silk/float/LPC_analysis_filter_FLP.c',
'silk/float/LPC_inv_pred_gain_FLP.c',
'silk/float/LTP_analysis_filter_FLP.c',
'silk/float/LTP_scale_ctrl_FLP.c',
'silk/float/noise_shape_analysis_FLP.c',
'silk/float/pitch_analysis_core_FLP.c',
'silk/float/prefilter_FLP.c',
'silk/float/process_gains_FLP.c',
'silk/float/regularize_correlations_FLP.c',
'silk/float/residual_energy_FLP.c',
'silk/float/scale_copy_vector_FLP.c',
'silk/float/scale_vector_FLP.c',
'silk/float/schur_FLP.c',
'silk/float/solve_LS_FLP.c',
'silk/float/sort_FLP.c',
'silk/float/warped_autocorrelation_FLP.c',
'silk/float/wrappers_FLP.c',
]

View File

@ -43,7 +43,7 @@ for file in ${SRC_FILES}; do
done
# copy files into the target directory
for file in ${STATIC_FILES} ${MK_FILES} ${SRC_FILES} ${HDR_FILES}; do
for file in ${STATIC_FILES} ${SRC_FILES} ${HDR_FILES}; do
cmd="cp $1/${file} ${TARGET}/${file}"
echo ${cmd}
${cmd}
@ -65,5 +65,7 @@ sed -e "s/DEFINES\['OPUS_VERSION'\][ \t]*=[ \t]*'\".*\"'/DEFINES['OPUS_VERSION']
${TARGET}/moz.build > ${TARGET}/moz.build+ && \
mv ${TARGET}/moz.build+ ${TARGET}/moz.build
python gen-sources.py $1
# apply outstanding local patches
# ... no patches to apply ...