Squashed commit of the following:
authorJean-Marc Valin <jean-marc.valin@octasic.com>
Thu, 19 May 2011 21:17:44 +0000 (17:17 -0400)
committerJean-Marc Valin <jean-marc.valin@octasic.com>
Thu, 19 May 2011 21:17:44 +0000 (17:17 -0400)
commit 5b64cf7c4d67af9050bc959996ef976ce6326888
Author: Jean-Marc Valin <jean-marc.valin@octasic.com>
Date:   Thu May 19 16:40:35 2011 -0400

    Fixes a few bugs introduced in the latest update

commit b91eb86025d2de3c4cf04f4fb1aa48a28ad676a3
Author: Timothy B. Terriberry <tterribe@xiph.org>
Date:   Thu May 19 16:12:02 2011 -0400

    build_draft.sh fixes

commit 0b10c30db7ad60ff7d4bfc1139bdb86e0543c035
Author: Jean-Marc Valin <jean-marc.valin@octasic.com>
Date:   Thu May 19 15:30:21 2011 -0400

    Fixes the draft build

commit 164424cded5978e657105104e171ac202dde5e5b
Author: Jean-Marc Valin <jean-marc.valin@octasic.com>
Date:   Thu May 19 15:00:23 2011 -0400

    Updated build system

commit 188d9fcba8c3a1b1ad67c67c430e1b37e3658a40
Author: Koen Vos <koen.vos@skype.net>
Date:   Thu May 19 17:14:57 2011 -0400

    SILK/Opus update

192 files changed:
doc/build_draft.sh
libcelt/celt_header.h [deleted file]
libcelt/libcelt.vcxproj
libcelt/libcelt.vcxproj.filters
opus.sln
silk/SKP_Silk_stereo_LR_to_MS.c [deleted file]
silk/SKP_Silk_tables.h [deleted file]
silk/fixed/silk_LTP_analysis_filter_FIX.c [moved from silk/fixed/SKP_Silk_LTP_analysis_filter_FIX.c with 96% similarity]
silk/fixed/silk_LTP_scale_ctrl_FIX.c [moved from silk/fixed/SKP_Silk_LTP_scale_ctrl_FIX.c with 82% similarity]
silk/fixed/silk_corrMatrix_FIX.c [moved from silk/fixed/SKP_Silk_corrMatrix_FIX.c with 93% similarity]
silk/fixed/silk_encode_frame_FIX.c [moved from silk/fixed/SKP_Silk_encode_frame_FIX.c with 80% similarity]
silk/fixed/silk_find_LPC_FIX.c [moved from silk/fixed/SKP_Silk_find_LPC_FIX.c with 81% similarity]
silk/fixed/silk_find_LTP_FIX.c [moved from silk/fixed/SKP_Silk_find_LTP_FIX.c with 81% similarity]
silk/fixed/silk_find_pitch_lags_FIX.c [moved from silk/fixed/SKP_Silk_find_pitch_lags_FIX.c with 74% similarity]
silk/fixed/silk_find_pred_coefs_FIX.c [moved from silk/fixed/SKP_Silk_find_pred_coefs_FIX.c with 82% similarity]
silk/fixed/silk_fixed.vcxproj
silk/fixed/silk_fixed.vcxproj.filters
silk/fixed/silk_main_FIX.h [moved from silk/fixed/SKP_Silk_main_FIX.h with 83% similarity]
silk/fixed/silk_noise_shape_analysis_FIX.c [moved from silk/fixed/SKP_Silk_noise_shape_analysis_FIX.c with 65% similarity]
silk/fixed/silk_prefilter_FIX.c [moved from silk/fixed/SKP_Silk_prefilter_FIX.c with 88% similarity]
silk/fixed/silk_process_gains_FIX.c [moved from silk/fixed/SKP_Silk_process_gains_FIX.c with 67% similarity]
silk/fixed/silk_regularize_correlations_FIX.c [moved from silk/fixed/SKP_Silk_regularize_correlations_FIX.c with 95% similarity]
silk/fixed/silk_residual_energy16_FIX.c [moved from silk/fixed/SKP_Silk_residual_energy16_FIX.c with 92% similarity]
silk/fixed/silk_residual_energy_FIX.c [moved from silk/fixed/SKP_Silk_residual_energy_FIX.c with 88% similarity]
silk/fixed/silk_solve_LS_FIX.c [moved from silk/fixed/SKP_Silk_solve_LS_FIX.c with 89% similarity]
silk/fixed/silk_structs_FIX.h [moved from silk/fixed/SKP_Silk_structs_FIX.h with 78% similarity]
silk/fixed/silk_warped_autocorrelation_FIX.c [moved from silk/fixed/SKP_Silk_warped_autocorrelation_FIX.c with 95% similarity]
silk/float/silk_LPC_analysis_filter_FLP.c [moved from silk/float/SKP_Silk_LPC_analysis_filter_FLP.c with 91% similarity]
silk/float/silk_LPC_inv_pred_gain_FLP.c [moved from silk/float/SKP_Silk_LPC_inv_pred_gain_FLP.c with 76% similarity]
silk/float/silk_LTP_analysis_filter_FLP.c [moved from silk/float/SKP_Silk_LTP_analysis_filter_FLP.c with 96% similarity]
silk/float/silk_LTP_scale_ctrl_FLP.c [moved from silk/float/SKP_Silk_LTP_scale_ctrl_FLP.c with 83% similarity]
silk/float/silk_SigProc_FLP.h [moved from silk/float/SKP_Silk_SigProc_FLP.h with 84% similarity]
silk/float/silk_apply_sine_window_FLP.c [moved from silk/float/SKP_Silk_apply_sine_window_FLP.c with 96% similarity]
silk/float/silk_autocorrelation_FLP.c [moved from silk/float/SKP_Silk_autocorrelation_FLP.c with 90% similarity]
silk/float/silk_burg_modified_FLP.c [moved from silk/float/SKP_Silk_burg_modified_FLP.c with 80% similarity]
silk/float/silk_bwexpander_FLP.c [moved from silk/float/SKP_Silk_bwexpander_FLP.c with 95% similarity]
silk/float/silk_corrMatrix_FLP.c [moved from silk/float/SKP_Silk_corrMatrix_FLP.c with 92% similarity]
silk/float/silk_encode_frame_FLP.c [moved from silk/float/SKP_Silk_encode_frame_FLP.c with 78% similarity]
silk/float/silk_energy_FLP.c [moved from silk/float/SKP_Silk_energy_FLP.c with 95% similarity]
silk/float/silk_find_LPC_FLP.c [moved from silk/float/SKP_Silk_find_LPC_FLP.c with 80% similarity]
silk/float/silk_find_LTP_FLP.c [moved from silk/float/SKP_Silk_find_LTP_FLP.c with 85% similarity]
silk/float/silk_find_pitch_lags_FLP.c [moved from silk/float/SKP_Silk_find_pitch_lags_FLP.c with 82% similarity]
silk/float/silk_find_pred_coefs_FLP.c [moved from silk/float/SKP_Silk_find_pred_coefs_FLP.c with 82% similarity]
silk/float/silk_float.vcxproj
silk/float/silk_float.vcxproj.filters
silk/float/silk_inner_product_FLP.c [moved from silk/float/SKP_Silk_inner_product_FLP.c with 94% similarity]
silk/float/silk_k2a_FLP.c [moved from silk/float/SKP_Silk_k2a_FLP.c with 74% similarity]
silk/float/silk_levinsondurbin_FLP.c [moved from silk/float/SKP_Silk_levinsondurbin_FLP.c with 93% similarity]
silk/float/silk_main_FLP.h [moved from silk/float/SKP_Silk_main_FLP.h with 83% similarity]
silk/float/silk_noise_shape_analysis_FLP.c [moved from silk/float/SKP_Silk_noise_shape_analysis_FLP.c with 89% similarity]
silk/float/silk_pitch_analysis_core_FLP.c [moved from silk/float/SKP_Silk_pitch_analysis_core_FLP.c with 87% similarity]
silk/float/silk_prefilter_FLP.c [moved from silk/float/SKP_Silk_prefilter_FLP.c with 87% similarity]
silk/float/silk_process_gains_FLP.c [moved from silk/float/SKP_Silk_process_gains_FLP.c with 84% similarity]
silk/float/silk_regularize_correlations_FLP.c [moved from silk/float/SKP_Silk_regularize_correlations_FLP.c with 95% similarity]
silk/float/silk_residual_energy_FLP.c [moved from silk/float/SKP_Silk_residual_energy_FLP.c with 83% similarity]
silk/float/silk_scale_copy_vector_FLP.c [moved from silk/float/SKP_Silk_scale_copy_vector_FLP.c with 95% similarity]
silk/float/silk_scale_vector_FLP.c [moved from silk/float/SKP_Silk_scale_vector_FLP.c with 95% similarity]
silk/float/silk_schur_FLP.c [moved from silk/float/SKP_Silk_schur_FLP.c with 78% similarity]
silk/float/silk_solve_LS_FLP.c [moved from silk/float/SKP_Silk_solve_LS_FLP.c with 91% similarity]
silk/float/silk_sort_FLP.c [moved from silk/float/SKP_Silk_sort_FLP.c with 80% similarity]
silk/float/silk_structs_FLP.h [moved from silk/float/SKP_Silk_structs_FLP.h with 78% similarity]
silk/float/silk_warped_autocorrelation_FLP.c [moved from silk/float/SKP_Silk_warped_autocorrelation_FLP.c with 95% similarity]
silk/float/silk_wrappers_FLP.c [moved from silk/float/SKP_Silk_wrappers_FLP.c with 87% similarity]
silk/silk_A2NLSF.c [moved from silk/SKP_Silk_A2NLSF.c with 83% similarity]
silk/silk_API.h [moved from silk/SKP_Silk_SDK_API.h with 77% similarity]
silk/silk_CNG.c [moved from silk/SKP_Silk_CNG.c with 86% similarity]
silk/silk_HP_variable_cutoff.c [moved from silk/SKP_Silk_HP_variable_cutoff.c with 50% similarity]
silk/silk_Inlines.h [moved from silk/SKP_Silk_Inlines.h with 76% similarity]
silk/silk_LPC_analysis_filter.c [moved from silk/SKP_Silk_LPC_analysis_filter.c with 96% similarity]
silk/silk_LPC_inv_pred_gain.c [moved from silk/SKP_Silk_LPC_inv_pred_gain.c with 80% similarity]
silk/silk_LPC_stabilize.c [moved from silk/SKP_Silk_LPC_stabilize.c with 90% similarity]
silk/silk_LPC_synthesis_filter.c [moved from silk/SKP_Silk_LPC_synthesis_filter.c with 94% similarity]
silk/silk_LPC_synthesis_order16.c [moved from silk/SKP_Silk_LPC_synthesis_order16.c with 94% similarity]
silk/silk_LP_variable_cutoff.c [moved from silk/SKP_Silk_LP_variable_cutoff.c with 72% similarity]
silk/silk_MacroCount.h [moved from silk/SKP_Silk_MacroCount.h with 100% similarity]
silk/silk_MacroDebug.h [moved from silk/SKP_Silk_MacroDebug.h with 100% similarity]
silk/silk_NLSF2A.c [moved from silk/SKP_Silk_NLSF2A.c with 87% similarity]
silk/silk_NLSF2A_stable.c [moved from silk/SKP_Silk_NLSF2A_stable.c with 87% similarity]
silk/silk_NLSF_VQ.c [moved from silk/SKP_Silk_NLSF_VQ.c with 96% similarity]
silk/silk_NLSF_VQ_weights_laroia.c [moved from silk/SKP_Silk_NLSF_VQ_weights_laroia.c with 96% similarity]
silk/silk_NLSF_decode.c [moved from silk/SKP_Silk_NLSF_decode.c with 80% similarity]
silk/silk_NLSF_del_dec_quant.c [moved from silk/SKP_Silk_NLSF_del_dec_quant.c with 92% similarity]
silk/silk_NLSF_encode.c [moved from silk/SKP_Silk_NLSF_encode.c with 83% similarity]
silk/silk_NLSF_stabilize.c [moved from silk/SKP_Silk_NLSF_stabilize.c with 95% similarity]
silk/silk_NLSF_unpack.c [moved from silk/SKP_Silk_NLSF_unpack.c with 92% similarity]
silk/silk_NSQ.c [moved from silk/SKP_Silk_NSQ.c with 92% similarity]
silk/silk_NSQ_del_dec.c [moved from silk/SKP_Silk_NSQ_del_dec.c with 94% similarity]
silk/silk_PLC.c [moved from silk/SKP_Silk_PLC.c with 87% similarity]
silk/silk_PLC.h [moved from silk/SKP_Silk_PLC.h with 75% similarity]
silk/silk_SigProc_FIX.h [moved from silk/SKP_Silk_SigProc_FIX.h with 87% similarity]
silk/silk_VAD.c [moved from silk/SKP_Silk_VAD.c with 84% similarity]
silk/silk_VQ_WMat_EC.c [moved from silk/SKP_Silk_VQ_WMat_EC.c with 97% similarity]
silk/silk_ana_filt_bank_1.c [moved from silk/SKP_Silk_ana_filt_bank_1.c with 82% similarity]
silk/silk_apply_sine_window.c [moved from silk/SKP_Silk_apply_sine_window.c with 96% similarity]
silk/silk_array_maxabs.c [moved from silk/SKP_Silk_array_maxabs.c with 75% similarity]
silk/silk_autocorr.c [moved from silk/SKP_Silk_autocorr.c with 87% similarity]
silk/silk_biquad_alt.c [moved from silk/SKP_Silk_biquad_alt.c with 95% similarity]
silk/silk_burg_modified.c [moved from silk/SKP_Silk_burg_modified.c with 87% similarity]
silk/silk_bwexpander.c [moved from silk/SKP_Silk_bwexpander.c with 96% similarity]
silk/silk_bwexpander_32.c [moved from silk/SKP_Silk_bwexpander_32.c with 95% similarity]
silk/silk_check_control_input.c [moved from silk/SKP_Silk_check_control_input.c with 77% similarity]
silk/silk_code_signs.c [moved from silk/SKP_Silk_code_signs.c with 95% similarity]
silk/silk_common.vcxproj
silk/silk_common.vcxproj.filters
silk/silk_control.h [moved from silk/SKP_Silk_control.h with 89% similarity]
silk/silk_control_SNR.c [moved from silk/SKP_Silk_control_SNR.c with 78% similarity]
silk/silk_control_audio_bandwidth.c [moved from silk/SKP_Silk_control_audio_bandwidth.c with 93% similarity]
silk/silk_control_codec.c [moved from silk/SKP_Silk_control_codec.c with 68% similarity]
silk/silk_create_init_destroy.c [moved from silk/SKP_Silk_create_init_destroy.c with 86% similarity]
silk/silk_debug.c [moved from silk/SKP_Silk_debug.c with 52% similarity]
silk/silk_debug.h [moved from silk/SKP_debug.h with 66% similarity]
silk/silk_dec_API.c [moved from silk/SKP_Silk_dec_API.c with 52% similarity]
silk/silk_decode_core.c [moved from silk/SKP_Silk_decode_core.c with 91% similarity]
silk/silk_decode_frame.c [moved from silk/SKP_Silk_decode_frame.c with 85% similarity]
silk/silk_decode_indices.c [moved from silk/SKP_Silk_decode_indices.c with 82% similarity]
silk/silk_decode_parameters.c [moved from silk/SKP_Silk_decode_parameters.c with 77% similarity]
silk/silk_decode_pitch.c [moved from silk/SKP_Silk_decode_pitch.c with 88% similarity]
silk/silk_decode_pulses.c [moved from silk/SKP_Silk_decode_pulses.c with 86% similarity]
silk/silk_decoder_set_fs.c [moved from silk/SKP_Silk_decoder_set_fs.c with 80% similarity]
silk/silk_define.h [moved from silk/SKP_Silk_define.h with 92% similarity]
silk/silk_enc_API.c [moved from silk/SKP_Silk_enc_API.c with 56% similarity]
silk/silk_encode_indices.c [moved from silk/SKP_Silk_encode_indices.c with 86% similarity]
silk/silk_encode_pulses.c [moved from silk/SKP_Silk_encode_pulses.c with 84% similarity]
silk/silk_errors.h [moved from silk/SKP_Silk_errors.h with 71% similarity]
silk/silk_gain_quant.c [moved from silk/SKP_Silk_gain_quant.c with 90% similarity]
silk/silk_init_encoder.c [moved from silk/SKP_Silk_init_encoder.c with 75% similarity]
silk/silk_inner_prod_aligned.c [moved from silk/SKP_Silk_inner_prod_aligned.c with 93% similarity]
silk/silk_interpolate.c [moved from silk/SKP_Silk_interpolate.c with 96% similarity]
silk/silk_k2a.c [moved from silk/SKP_Silk_k2a.c with 94% similarity]
silk/silk_k2a_Q16.c [moved from silk/SKP_Silk_k2a_Q16.c with 94% similarity]
silk/silk_lin2log.c [moved from silk/SKP_Silk_lin2log.c with 90% similarity]
silk/silk_log2lin.c [moved from silk/SKP_Silk_log2lin.c with 90% similarity]
silk/silk_macros.h [moved from silk/SKP_Silk_macros.h with 93% similarity]
silk/silk_main.h [moved from silk/SKP_Silk_main.h with 79% similarity]
silk/silk_pitch_analysis_core.c [moved from silk/SKP_Silk_pitch_analysis_core.c with 84% similarity]
silk/silk_pitch_est_defines.h [moved from silk/SKP_Silk_pitch_est_defines.h with 81% similarity]
silk/silk_pitch_est_tables.c [moved from silk/SKP_Silk_pitch_est_tables.c with 79% similarity]
silk/silk_process_NLSFs.c [moved from silk/SKP_Silk_process_NLSFs.c with 80% similarity]
silk/silk_quant_LTP_gains.c [moved from silk/SKP_Silk_quant_LTP_gains.c with 90% similarity]
silk/silk_resampler.c [moved from silk/SKP_Silk_resampler.c with 76% similarity]
silk/silk_resampler_down2.c [moved from silk/SKP_Silk_resampler_down2.c with 77% similarity]
silk/silk_resampler_down2_3.c [moved from silk/SKP_Silk_resampler_down2_3.c with 69% similarity]
silk/silk_resampler_down3.c [moved from silk/SKP_Silk_resampler_down3.c with 77% similarity]
silk/silk_resampler_private.h [moved from silk/SKP_Silk_resampler_private.h with 82% similarity]
silk/silk_resampler_private_AR2.c [moved from silk/SKP_Silk_resampler_private_AR2.c with 81% similarity]
silk/silk_resampler_private_ARMA4.c [moved from silk/SKP_Silk_resampler_private_ARMA4.c with 85% similarity]
silk/silk_resampler_private_IIR_FIR.c [moved from silk/SKP_Silk_resampler_private_IIR_FIR.c with 69% similarity]
silk/silk_resampler_private_copy.c [moved from silk/SKP_Silk_resampler_private_copy.c with 77% similarity]
silk/silk_resampler_private_down4.c [moved from silk/SKP_Silk_resampler_private_down4.c with 78% similarity]
silk/silk_resampler_private_down_FIR.c [moved from silk/SKP_Silk_resampler_private_down_FIR.c with 82% similarity]
silk/silk_resampler_private_up2_HQ.c [moved from silk/SKP_Silk_resampler_private_up2_HQ.c with 72% similarity]
silk/silk_resampler_private_up4.c [moved from silk/SKP_Silk_resampler_private_up4.c with 88% similarity]
silk/silk_resampler_rom.c [moved from silk/SKP_Silk_resampler_rom.c with 71% similarity]
silk/silk_resampler_rom.h [moved from silk/SKP_Silk_resampler_rom.h with 59% similarity]
silk/silk_resampler_structs.h [moved from silk/SKP_Silk_resampler_structs.h with 72% similarity]
silk/silk_resampler_up2.c [moved from silk/SKP_Silk_resampler_up2.c with 77% similarity]
silk/silk_scale_copy_vector16.c [moved from silk/SKP_Silk_scale_copy_vector16.c with 95% similarity]
silk/silk_scale_vector.c [moved from silk/SKP_Silk_scale_vector.c with 94% similarity]
silk/silk_schur.c [moved from silk/SKP_Silk_schur.c with 80% similarity]
silk/silk_schur64.c [moved from silk/SKP_Silk_schur64.c with 90% similarity]
silk/silk_shell_coder.c [moved from silk/SKP_Silk_shell_coder.c with 69% similarity]
silk/silk_sigm_Q15.c [moved from silk/SKP_Silk_sigm_Q15.c with 78% similarity]
silk/silk_sort.c [moved from silk/SKP_Silk_sort.c with 77% similarity]
silk/silk_stereo_LR_to_MS.c [new file with mode: 0644]
silk/silk_stereo_MS_to_LR.c [moved from silk/SKP_Silk_stereo_MS_to_LR.c with 67% similarity]
silk/silk_stereo_decode_pred.c [moved from silk/SKP_Silk_stereo_decode_pred.c with 69% similarity]
silk/silk_stereo_encode_pred.c [new file with mode: 0644]
silk/silk_stereo_find_predictor.c [moved from silk/SKP_Silk_stereo_find_predictor.c with 55% similarity]
silk/silk_stereo_quant_pred.c [moved from silk/SKP_Silk_stereo_encode_pred.c with 68% similarity]
silk/silk_structs.h [moved from silk/SKP_Silk_structs.h with 86% similarity]
silk/silk_sum_sqr_shift.c [moved from silk/SKP_Silk_sum_sqr_shift.c with 96% similarity]
silk/silk_table_LSF_cos.c [moved from silk/SKP_Silk_LSF_cos_table.c with 94% similarity]
silk/silk_tables.h [new file with mode: 0644]
silk/silk_tables_LTP.c [moved from silk/SKP_Silk_tables_LTP.c with 78% similarity]
silk/silk_tables_NLSF_CB_NB_MB.c [moved from silk/SKP_Silk_tables_NLSF_CB_NB_MB.c with 89% similarity]
silk/silk_tables_NLSF_CB_WB.c [moved from silk/SKP_Silk_tables_NLSF_CB_WB.c with 91% similarity]
silk/silk_tables_gain.c [moved from silk/SKP_Silk_tables_gain.c with 90% similarity]
silk/silk_tables_other.c [moved from silk/SKP_Silk_tables_other.c with 62% similarity]
silk/silk_tables_pitch_lag.c [moved from silk/SKP_Silk_tables_pitch_lag.c with 85% similarity]
silk/silk_tables_pulses_per_block.c [moved from silk/SKP_Silk_tables_pulses_per_block.c with 90% similarity]
silk/silk_tuning_parameters.h [moved from silk/SKP_Silk_tuning_parameters.h with 86% similarity]
silk/silk_typedef.h [moved from silk/SKP_Silk_typedef.h with 96% similarity]
silk_headers.txt
silk_sources.mk
src/opus.h
src/opus.vcxproj
src/opus.vcxproj.filters
src/opus_decoder.c
src/opus_decoder.h
src/opus_encoder.c
src/opus_encoder.h
src/test_opus.c

index 35ceeb4..3035adc 100755 (executable)
@@ -11,16 +11,23 @@ destdir="opus_source"
 echo packaging source code
 rm -rf "${destdir}"
 mkdir "${destdir}"
+mkdir "${destdir}/src"
+mkdir "${destdir}/silk"
+mkdir "${destdir}/silk/float"
+mkdir "${destdir}/silk/fixed"
+mkdir "${destdir}/libcelt"
 for f in `cat "${toplevel}"/opus_sources.mk "${toplevel}"/celt_sources.mk \
  "${toplevel}"/silk_sources.mk "${toplevel}"/opus_headers.txt \
  "${toplevel}"/celt_headers.txt "${toplevel}"/silk_headers.txt \
  | grep '\.[ch]' | sed -e 's/^.*=//' -e 's/\\\\//'` ; do
-  cp -a "${toplevel}/${f}" "${destdir}"
+  cp -a "${toplevel}/${f}" "${destdir}/${f}"
 done
+cp -a "${toplevel}"/src/test_opus.c "${destdir}"/src/
 cp -a "${toplevel}"/Makefile.draft "${destdir}"/Makefile
 cp -a "${toplevel}"/opus_sources.mk "${destdir}"/
 cp -a "${toplevel}"/celt_sources.mk "${destdir}"/
-cp -a "${toplevel}"/silk_sources.mk "${destdir}"/
+cat "${toplevel}"/silk_sources.mk | sed 's/^if /ifdef /' \
+ > "${destdir}"/silk_sources.mk
 cp -a "${toplevel}"/README.draft "${destdir}"/README
 cp -a "${toplevel}"/COPYING "${destdir}"/COPYING
 
diff --git a/libcelt/celt_header.h b/libcelt/celt_header.h
deleted file mode 100644 (file)
index 3777484..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Copyright (c) 2007 CSIRO
-   Copyright (c) 2007-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 FOUNDATION 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 CELT_HEADER_H
-#define CELT_HEADER_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "celt.h"
-#include "celt_types.h"
-
-/** Header data to be used for Ogg files (or possibly other encapsulation) 
-    @brief Header data 
- */
-typedef struct {
-   char         codec_id[8];       /**< MUST be "CELT    " (four spaces) */
-   char         codec_version[20]; /**< Version used (as string) */
-   celt_int32 version_id;        /**< Version id (negative for until stream is frozen) */
-   celt_int32 header_size;       /**< Size of this header */
-   celt_int32 sample_rate;       /**< Sampling rate of the original audio */
-   celt_int32 nb_channels;       /**< Number of channels */
-   celt_int32 frame_size;        /**< Samples per frame (per channel) */
-   celt_int32 overlap;           /**< Overlapping samples (per channel) */
-   celt_int32 bytes_per_packet;  /**< Number of bytes per compressed packet (0 if unknown) */
-   celt_int32 extra_headers;     /**< Number of additional headers that follow this header */
-} CELTHeader;
-
-/** Creates a basic header struct */
-EXPORT int celt_header_init(CELTHeader *header, const CELTMode *m, int frame_size, int channels);
-
-EXPORT int celt_header_to_packet(const CELTHeader *header, unsigned char *packet, celt_uint32 size);
-
-EXPORT int celt_header_from_packet(const unsigned char *packet, celt_uint32 size, CELTHeader *header);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* CELT_HEADER_H */
index fe04999..6be1813 100644 (file)
@@ -75,7 +75,6 @@
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\..\win32\config.h" />\r
-    <ClInclude Include="..\msvc\config.h" />\r
     <ClInclude Include="arch.h" />\r
     <ClInclude Include="bands.h" />\r
     <ClInclude Include="celt.h" />\r
     <ClCompile Include="entcode.c" />\r
     <ClCompile Include="entdec.c" />\r
     <ClCompile Include="entenc.c" />\r
-    <ClCompile Include="header.c" />\r
     <ClCompile Include="kiss_fft.c" />\r
     <ClCompile Include="laplace.c" />\r
     <ClCompile Include="mathops.c" />\r
index 5c53e5c..4e650b9 100644 (file)
@@ -93,9 +93,6 @@
     <ClInclude Include="vq.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\msvc\config.h">\r
-      <Filter>Header Files</Filter>\r
-    </ClInclude>\r
     <ClInclude Include="..\..\win32\config.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
     <ClCompile Include="entenc.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="header.c">\r
-      <Filter>Source Files</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="kiss_fft.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
index 2df4309..c248b95 100644 (file)
--- a/opus.sln
+++ b/opus.sln
@@ -2,12 +2,30 @@
 Microsoft Visual Studio Solution File, Format Version 11.00\r
 # Visual Studio 2010\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "silk_common", "silk\silk_common.vcxproj", "{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {245603E3-F580-41A5-9632-B25FE3372CBF} = {245603E3-F580-41A5-9632-B25FE3372CBF}\r
+       EndProjectSection\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opus", "src\opus.vcxproj", "{219EC965-228A-1824-174D-96449D05F88A}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {8484C90D-1561-402F-A91D-2DB10F8C5171} = {8484C90D-1561-402F-A91D-2DB10F8C5171}\r
+               {9C4961D2-5DDB-40C7-9BE8-CA918DC4E782} = {9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}\r
+               {245603E3-F580-41A5-9632-B25FE3372CBF} = {245603E3-F580-41A5-9632-B25FE3372CBF}\r
+               {C303D2FC-FF97-49B8-9DDD-467B4C9A0B16} = {C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}\r
+       EndProjectSection\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "silk_fixed", "silk\fixed\silk_fixed.vcxproj", "{8484C90D-1561-402F-A91D-2DB10F8C5171}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {245603E3-F580-41A5-9632-B25FE3372CBF} = {245603E3-F580-41A5-9632-B25FE3372CBF}\r
+               {C303D2FC-FF97-49B8-9DDD-467B4C9A0B16} = {C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}\r
+       EndProjectSection\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "silk_float", "silk\float\silk_float.vcxproj", "{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {8484C90D-1561-402F-A91D-2DB10F8C5171} = {8484C90D-1561-402F-A91D-2DB10F8C5171}\r
+               {245603E3-F580-41A5-9632-B25FE3372CBF} = {245603E3-F580-41A5-9632-B25FE3372CBF}\r
+               {C303D2FC-FF97-49B8-9DDD-467B4C9A0B16} = {C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}\r
+       EndProjectSection\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcelt", "libcelt\libcelt.vcxproj", "{245603E3-F580-41A5-9632-B25FE3372CBF}"\r
 EndProject\r
diff --git a/silk/SKP_Silk_stereo_LR_to_MS.c b/silk/SKP_Silk_stereo_LR_to_MS.c
deleted file mode 100644 (file)
index 190d95f..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/***********************************************************************\r
-Copyright (c) 2006-2011, Skype Limited. All rights reserved. \r
-Redistribution and use in source and binary forms, with or without \r
-modification, (subject to the limitations in the disclaimer below) \r
-are permitted provided that the following conditions are met:\r
-- Redistributions of source code must retain the above copyright notice,\r
-this list of conditions and the following disclaimer.\r
-- Redistributions in binary form must reproduce the above copyright \r
-notice, this list of conditions and the following disclaimer in the \r
-documentation and/or other materials provided with the distribution.\r
-- Neither the name of Skype Limited, nor the names of specific \r
-contributors, may be used to endorse or promote products derived from \r
-this software without specific prior written permission.\r
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED \r
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND \r
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,\r
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND \r
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE \r
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, \r
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF \r
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON \r
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \r
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-***********************************************************************/\r
-\r
-#include "SKP_Silk_main.h"\r
-\r
-/* Convert Left/Right stereo signal to adaptive Mid/Side representation */\r
-void SKP_Silk_stereo_LR_to_MS( \r
-    ec_enc              *psRangeEnc,                    /* I/O  Compressor data structure                   */\r
-    stereo_state        *state,                         /* I/O  State                                       */\r
-    SKP_int16           x1[],                           /* I/O  Left input signal, becomes mid signal       */\r
-    SKP_int16           x2[],                           /* I/O  Right input signal, becomes side signal     */\r
-    SKP_int             fs_kHz,                         /* I    Samples rate (kHz)                          */\r
-    SKP_int             frame_length                    /* I    Number of samples                           */\r
-)\r
-{\r
-    SKP_int   n, denom_Q16, delta0_Q13, delta1_Q13;\r
-    SKP_int32 sum, diff, pred_Q13[ 2 ], pred0_Q13, pred1_Q13;\r
-    SKP_int16 mid[ MAX_FRAME_LENGTH + 2 ], side[ MAX_FRAME_LENGTH + 2 ];\r
-    SKP_int16 LP_mid[  MAX_FRAME_LENGTH ], HP_mid[  MAX_FRAME_LENGTH ];\r
-    SKP_int16 LP_side[ MAX_FRAME_LENGTH ], HP_side[ MAX_FRAME_LENGTH ];\r
-\r
-    /* Convert to basic mid/side signals */\r
-    for( n = 0; n < frame_length; n++ ) {\r
-        sum  = x1[ n ] + (SKP_int32)x2[ n ];\r
-        diff = x1[ n ] - (SKP_int32)x2[ n ];\r
-        mid[  n + 2 ] = (SKP_int16)SKP_RSHIFT_ROUND( sum,  1 );\r
-        side[ n + 2 ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( diff, 1 ) );\r
-    }\r
-\r
-    /* Buffering */\r
-    SKP_memcpy( mid,  state->sMid,  2 * sizeof( SKP_int16 ) );\r
-    SKP_memcpy( side, state->sSide, 2 * sizeof( SKP_int16 ) );\r
-    SKP_memcpy( state->sMid,  &mid[  frame_length ], 2 * sizeof( SKP_int16 ) );\r
-    SKP_memcpy( state->sSide, &side[ frame_length ], 2 * sizeof( SKP_int16 ) );\r
-\r
-    /* LP and HP filter mid signal */\r
-    for( n = 0; n < frame_length; n++ ) {\r
-        sum = SKP_RSHIFT_ROUND( SKP_ADD_LSHIFT( mid[ n ] + mid[ n + 2 ], mid[ n + 1 ], 1 ), 2 );\r
-        LP_mid[ n ] = sum;\r
-        HP_mid[ n ] = mid[ n + 1 ] - sum;\r
-    }\r
-\r
-    /* LP and HP filter side signal */\r
-    for( n = 0; n < frame_length; n++ ) {\r
-        sum = SKP_RSHIFT_ROUND( SKP_ADD_LSHIFT( side[ n ] + side[ n + 2 ], side[ n + 1 ], 1 ), 2 );\r
-        LP_side[ n ] = sum;\r
-        HP_side[ n ] = side[ n + 1 ] - sum;\r
-    }\r
-\r
-    /* Find predictors */\r
-    pred_Q13[ 0 ] = SKP_Silk_stereo_find_predictor( LP_mid, LP_side, frame_length );\r
-    pred_Q13[ 1 ] = SKP_Silk_stereo_find_predictor( HP_mid, HP_side, frame_length );\r
-\r
-    /* Quantize and encode predictors */\r
-    SKP_Silk_stereo_encode_pred( psRangeEnc, pred_Q13 );\r
-\r
-    /* Interpolate predictors and subtract prediction from side channel */\r
-    pred0_Q13  = -state->pred_prev_Q13[ 0 ];\r
-    pred1_Q13  = -state->pred_prev_Q13[ 1 ];\r
-    denom_Q16  = SKP_DIV32_16( 1 << 16, STEREO_INTERP_LEN_MS * fs_kHz );\r
-    delta0_Q13 = -SKP_RSHIFT_ROUND( SKP_SMULBB( pred_Q13[ 0 ] - state->pred_prev_Q13[ 0 ], denom_Q16 ), 16 );\r
-    delta1_Q13 = -SKP_RSHIFT_ROUND( SKP_SMULBB( pred_Q13[ 1 ] - state->pred_prev_Q13[ 1 ], denom_Q16 ), 16 );\r
-    for( n = 0; n < STEREO_INTERP_LEN_MS * fs_kHz; n++ ) {\r
-        pred0_Q13 += delta0_Q13;\r
-        pred1_Q13 += delta1_Q13;\r
-        sum = SKP_LSHIFT( SKP_ADD_LSHIFT( mid[ n ] + mid[ n + 2 ], mid[ n + 1 ], 1 ), 9 );      /* Q11 */ \r
-        sum = SKP_SMLAWB( SKP_LSHIFT( ( SKP_int32 )side[ n + 1 ], 8 ), sum, pred0_Q13 );        /* Q8  */\r
-        sum = SKP_SMLAWB( sum, SKP_LSHIFT( ( SKP_int32 )mid[ n + 1 ], 11 ), pred1_Q13 );        /* Q8  */\r
-        x2[ n ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( sum, 8 ) );\r
-    }\r
-    pred0_Q13 = -pred_Q13[ 0 ];\r
-    pred1_Q13 = -pred_Q13[ 1 ];\r
-    for( n = STEREO_INTERP_LEN_MS * fs_kHz; n < frame_length; n++ ) {\r
-        sum = SKP_LSHIFT( SKP_ADD_LSHIFT( mid[ n ] + mid[ n + 2 ], mid[ n + 1 ], 1 ), 9 );      /* Q11 */ \r
-        sum = SKP_SMLAWB( SKP_LSHIFT( ( SKP_int32 )side[ n + 1 ], 8 ), sum, pred0_Q13 );        /* Q8  */\r
-        sum = SKP_SMLAWB( sum, SKP_LSHIFT( ( SKP_int32 )mid[ n + 1 ], 11 ), pred1_Q13 );        /* Q8  */\r
-        x2[ n ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( sum, 8 ) );\r
-    }\r
-    state->pred_prev_Q13[ 0 ] = pred_Q13[ 0 ];\r
-    state->pred_prev_Q13[ 1 ] = pred_Q13[ 1 ];\r
-\r
-    SKP_memcpy( x1, mid + 1, frame_length * sizeof( SKP_int16 ) );\r
-}\r
diff --git a/silk/SKP_Silk_tables.h b/silk/SKP_Silk_tables.h
deleted file mode 100644 (file)
index 7cb5ac9..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/***********************************************************************\r
-Copyright (c) 2006-2011, Skype Limited. All rights reserved. \r
-Redistribution and use in source and binary forms, with or without \r
-modification, (subject to the limitations in the disclaimer below) \r
-are permitted provided that the following conditions are met:\r
-- Redistributions of source code must retain the above copyright notice,\r
-this list of conditions and the following disclaimer.\r
-- Redistributions in binary form must reproduce the above copyright \r
-notice, this list of conditions and the following disclaimer in the \r
-documentation and/or other materials provided with the distribution.\r
-- Neither the name of Skype Limited, nor the names of specific \r
-contributors, may be used to endorse or promote products derived from \r
-this software without specific prior written permission.\r
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED \r
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND \r
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,\r
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND \r
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE \r
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, \r
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF \r
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON \r
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \r
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-***********************************************************************/\r
-\r
-#ifndef SKP_SILK_TABLES_H\r
-#define SKP_SILK_TABLES_H\r
-\r
-#include "SKP_Silk_define.h"\r
-#include "SKP_Silk_structs.h"\r
-\r
-#ifdef __cplusplus\r
-extern "C"\r
-{\r
-#endif\r
-\r
-/* entropy coding tables */\r
-extern const SKP_uint8  SKP_Silk_gain_iCDF[ 3 ][ N_LEVELS_QGAIN / 8 ];                               /* 24 */\r
-extern const SKP_uint8  SKP_Silk_delta_gain_iCDF[ MAX_DELTA_GAIN_QUANT - MIN_DELTA_GAIN_QUANT + 1 ]; /* 41 */\r
-\r
-extern const SKP_uint8  SKP_Silk_pitch_lag_iCDF[ 2 * ( PITCH_EST_MAX_LAG_MS - PITCH_EST_MIN_LAG_MS ) ];  /* 32 */\r
-extern const SKP_uint8  SKP_Silk_pitch_delta_iCDF[ 21 ];                                            /*  21 */\r
-extern const SKP_uint8  SKP_Silk_pitch_contour_iCDF[ 34 ];                                          /*  34 */\r
-extern const SKP_uint8  SKP_Silk_pitch_contour_NB_iCDF[ 11 ];                                       /*  11 */\r
-extern const SKP_uint8  SKP_Silk_pitch_contour_10_ms_iCDF[ 12 ];                                    /*  12 */\r
-extern const SKP_uint8  SKP_Silk_pitch_contour_10_ms_NB_iCDF[ 3 ];                                  /*   3 */\r
-\r
-extern const SKP_uint8  SKP_Silk_pulses_per_block_iCDF[ N_RATE_LEVELS ][ MAX_PULSES + 2 ];          /* 180 */\r
-extern const SKP_uint8  SKP_Silk_pulses_per_block_BITS_Q5[ N_RATE_LEVELS - 1 ][ MAX_PULSES + 2 ];   /* 162 */\r
-\r
-extern const SKP_uint8  SKP_Silk_rate_levels_iCDF[ 2 ][ N_RATE_LEVELS - 1 ];                        /*  18 */\r
-extern const SKP_uint8  SKP_Silk_rate_levels_BITS_Q5[ 2 ][ N_RATE_LEVELS - 1 ];                     /*  18 */\r
-\r
-extern const SKP_uint8  SKP_Silk_max_pulses_table[ 4 ];                                             /*   4 */\r
-\r
-extern const SKP_uint8  SKP_Silk_shell_code_table0[  44 ];                                          /*  44 */\r
-extern const SKP_uint8  SKP_Silk_shell_code_table1[  65 ];                                          /*  65 */\r
-extern const SKP_uint8  SKP_Silk_shell_code_table2[  90 ];                                          /*  90 */\r
-extern const SKP_uint8  SKP_Silk_shell_code_table3[ 152 ];                                          /* 152 */\r
-extern const SKP_uint8  SKP_Silk_shell_code_table_offsets[ MAX_PULSES + 1 ];                        /*  17 */\r
-\r
-extern const SKP_uint8  SKP_Silk_lsb_iCDF[ 2 ];                                                     /*   2 */\r
-\r
-extern const SKP_uint8  SKP_Silk_sign_iCDF[ 36 ];                                                   /*  36 */\r
-\r
-extern const SKP_uint8  SKP_Silk_uniform2_iCDF[ 2 ];                                                /*   2 */\r
-extern const SKP_uint8  SKP_Silk_uniform3_iCDF[ 3 ];                                                /*   3 */\r
-extern const SKP_uint8  SKP_Silk_uniform4_iCDF[ 4 ];                                                /*   4 */\r
-extern const SKP_uint8  SKP_Silk_uniform5_iCDF[ 5 ];                                                /*   5 */\r
-extern const SKP_uint8  SKP_Silk_uniform6_iCDF[ 6 ];                                                /*   6 */\r
-extern const SKP_uint8  SKP_Silk_uniform8_iCDF[ 8 ];                                                /*   8 */\r
-\r
-extern const SKP_uint8  SKP_Silk_NLSF_EXT_iCDF[ 7 ];                                                /*   7 */\r
-\r
-extern const SKP_uint8  SKP_Silk_LTP_per_index_iCDF[ 3 ];                                           /*   3 */\r
-extern const SKP_uint8  * const SKP_Silk_LTP_gain_iCDF_ptrs[ NB_LTP_CBKS ];                         /*   3 */\r
-extern const SKP_uint8  * const SKP_Silk_LTP_gain_BITS_Q5_ptrs[ NB_LTP_CBKS ];                      /*   3 */\r
-extern const SKP_int16  SKP_Silk_LTP_gain_middle_avg_RD_Q14;\r
-extern const SKP_int8   * const SKP_Silk_LTP_vq_ptrs_Q7[ NB_LTP_CBKS ];                             /* 168 */\r
-extern const SKP_int8   SKP_Silk_LTP_vq_sizes[ NB_LTP_CBKS ];                                       /*   3 */\r
-\r
-extern const SKP_uint8  SKP_Silk_LTPscale_iCDF[ 3 ];                                                /*   4 */\r
-extern const SKP_int16  SKP_Silk_LTPScales_table_Q14[ 3 ];\r
-\r
-extern const SKP_uint8  SKP_Silk_type_offset_VAD_iCDF[ 4 ];                                         /*   4 */\r
-extern const SKP_uint8  SKP_Silk_type_offset_no_VAD_iCDF[ 2 ];                                      /*   2 */\r
-\r
-extern const SKP_int16  SKP_Silk_stereo_pred_quant_Q13[ STEREO_QUANT_TAB_SIZE ];                    /*  32 */\r
-extern const SKP_uint8  SKP_Silk_stereo_pred_joint_iCDF[ 25 ];                                      /*  25 */\r
-\r
-extern const SKP_uint8 * const SKP_Silk_LBRR_flags_iCDF_ptr[ 2 ];                                   /*  10 */\r
-\r
-extern const SKP_uint8  SKP_Silk_NLSF_interpolation_factor_iCDF[ 5 ];                               /*   5 */\r
-\r
-extern const SKP_Silk_NLSF_CB_struct SKP_Silk_NLSF_CB_WB;\r
-extern const SKP_Silk_NLSF_CB_struct SKP_Silk_NLSF_CB_NB_MB;\r
-\r
-/* Piece-wise linear mapping from bitrate in kbps to coding quality in dB SNR */\r
-extern const SKP_int32  TargetRate_table_NB[  TARGET_RATE_TAB_SZ ];\r
-extern const SKP_int32  TargetRate_table_MB[  TARGET_RATE_TAB_SZ ];\r
-extern const SKP_int32  TargetRate_table_WB[  TARGET_RATE_TAB_SZ ];\r
-extern const SKP_int16  SNR_table_Q1[         TARGET_RATE_TAB_SZ ];\r
-\r
-/* Quantization offsets */\r
-extern const SKP_int16  SKP_Silk_Quantization_Offsets_Q10[ 2 ][ 2 ];\r
-\r
-/* Interpolation points for filter coefficients used in the bandwidth transition smoother */\r
-extern const SKP_int32  SKP_Silk_Transition_LP_B_Q28[ TRANSITION_INT_NUM ][ TRANSITION_NB ];\r
-extern const SKP_int32  SKP_Silk_Transition_LP_A_Q28[ TRANSITION_INT_NUM ][ TRANSITION_NA ];\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
similarity index 96%
rename from silk/fixed/SKP_Silk_LTP_analysis_filter_FIX.c
rename to silk/fixed/silk_LTP_analysis_filter_FIX.c
index 4e21d65..2e864a4 100644 (file)
@@ -25,9 +25,9 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FIX.h"\r
+#include "silk_main_FIX.h"\r
 \r
-void SKP_Silk_LTP_analysis_filter_FIX(\r
+void silk_LTP_analysis_filter_FIX(\r
     SKP_int16       *LTP_res,                               /* O:   LTP residual signal of length MAX_NB_SUBFR * ( pre_length + subfr_length )  */\r
     const SKP_int16 *x,                                     /* I:   Pointer to input signal with at least max( pitchL ) preceeding samples      */\r
     const SKP_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ],/* I:   LTP_ORDER LTP coefficients for each MAX_NB_SUBFR subframe                   */\r
similarity index 82%
rename from silk/fixed/SKP_Silk_LTP_scale_ctrl_FIX.c
rename to silk/fixed/silk_LTP_scale_ctrl_FIX.c
index 0851605..946d24c 100644 (file)
@@ -25,11 +25,11 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FIX.h"\r
+#include "silk_main_FIX.h"\r
 \r
-void SKP_Silk_LTP_scale_ctrl_FIX(\r
-    SKP_Silk_encoder_state_FIX      *psEnc,     /* I/O  encoder state FIX                           */\r
-    SKP_Silk_encoder_control_FIX    *psEncCtrl  /* I/O  encoder control FIX                         */\r
+void silk_LTP_scale_ctrl_FIX(\r
+    silk_encoder_state_FIX      *psEnc,     /* I/O  encoder state FIX                           */\r
+    silk_encoder_control_FIX    *psEncCtrl  /* I/O  encoder control FIX                         */\r
 )\r
 {\r
     SKP_int round_loss;\r
@@ -40,13 +40,13 @@ void SKP_Silk_LTP_scale_ctrl_FIX(
     psEnc->prevLTPredCodGain_Q7 = psEncCtrl->LTPredCodGain_Q7;\r
 \r
     /* Only scale if first frame in packet */\r
-    if( psEnc->sCmn.nFramesAnalyzed == 0 ) {\r
+    if( psEnc->sCmn.nFramesEncoded == 0 ) {\r
         round_loss = psEnc->sCmn.PacketLoss_perc + psEnc->sCmn.nFramesPerPacket - 1;\r
         psEnc->sCmn.indices.LTP_scaleIndex = (SKP_int8)SKP_LIMIT( \r
-            SKP_SMULWB( SKP_SMULBB( round_loss, psEnc->HPLTPredCodGain_Q7 ), SKP_FIX_CONST( 0.1, 9 ) ), 0, 2 );\r
+            SKP_SMULWB( SKP_SMULBB( round_loss, psEnc->HPLTPredCodGain_Q7 ), SILK_FIX_CONST( 0.1, 9 ) ), 0, 2 );\r
     } else {\r
         /* Default is minimum scaling */\r
         psEnc->sCmn.indices.LTP_scaleIndex = 0;\r
     }\r
-    psEncCtrl->LTP_scale_Q14 = SKP_Silk_LTPScales_table_Q14[ psEnc->sCmn.indices.LTP_scaleIndex ];\r
+    psEncCtrl->LTP_scale_Q14 = silk_LTPScales_table_Q14[ psEnc->sCmn.indices.LTP_scaleIndex ];\r
 }\r
similarity index 93%
rename from silk/fixed/SKP_Silk_corrMatrix_FIX.c
rename to silk/fixed/silk_corrMatrix_FIX.c
index 1ac1b19..453cac8 100644 (file)
@@ -29,10 +29,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * Correlation Matrix Computations for LS estimate. \r
  **********************************************************************/\r
 \r
-#include "SKP_Silk_main_FIX.h"\r
+#include "silk_main_FIX.h"\r
 \r
 /* Calculates correlation vector X'*t */\r
-void SKP_Silk_corrVector_FIX(\r
+void silk_corrVector_FIX(\r
     const SKP_int16                 *x,         /* I    x vector [L + order - 1] used to form data matrix X */\r
     const SKP_int16                 *t,         /* I    target vector [L]                                   */\r
     const SKP_int                   L,          /* I    Length of vectors                                   */\r
@@ -61,14 +61,14 @@ void SKP_Silk_corrVector_FIX(
     } else {\r
         SKP_assert( rshifts == 0 );\r
         for( lag = 0; lag < order; lag++ ) {\r
-            Xt[ lag ] = SKP_Silk_inner_prod_aligned( ptr1, ptr2, L ); /* X[:,lag]'*t */\r
+            Xt[ lag ] = silk_inner_prod_aligned( ptr1, ptr2, L ); /* X[:,lag]'*t */\r
             ptr1--; /* Go to next column of X */\r
         }\r
     }\r
 }\r
 \r
 /* Calculates correlation matrix X'*X */\r
-void SKP_Silk_corrMatrix_FIX(\r
+void silk_corrMatrix_FIX(\r
     const SKP_int16                 *x,         /* I    x vector [L + order - 1] used to form data matrix X */\r
     const SKP_int                   L,          /* I    Length of vectors                                   */\r
     const SKP_int                   order,      /* I    Max lag for correlation                             */\r
@@ -82,9 +82,9 @@ void SKP_Silk_corrMatrix_FIX(
     const SKP_int16 *ptr1, *ptr2;\r
 \r
     /* Calculate energy to find shift used to fit in 32 bits */\r
-    SKP_Silk_sum_sqr_shift( &energy, &rshifts_local, x, L + order - 1 );\r
+    silk_sum_sqr_shift( &energy, &rshifts_local, x, L + order - 1 );\r
     /* Add shifts to get the desired head room */\r
-    head_room_rshifts = SKP_max( head_room - SKP_Silk_CLZ32( energy ), 0 );\r
+    head_room_rshifts = SKP_max( head_room - silk_CLZ32( energy ), 0 );\r
     \r
     energy = SKP_RSHIFT32( energy, head_room_rshifts );\r
     rshifts_local += head_room_rshifts;\r
@@ -134,7 +134,7 @@ void SKP_Silk_corrMatrix_FIX(
     } else {\r
         for( lag = 1; lag < order; lag++ ) {\r
             /* Inner product of column 0 and column lag: X[:,0]'*X[:,lag] */\r
-            energy = SKP_Silk_inner_prod_aligned( ptr1, ptr2, L );\r
+            energy = silk_inner_prod_aligned( ptr1, ptr2, L );\r
             matrix_ptr( XX, lag, 0, order ) = energy;\r
             matrix_ptr( XX, 0, lag, order ) = energy;\r
             /* Calculate remaining off diagonal: X[:,j]'*X[:,j + lag] */\r
similarity index 80%
rename from silk/fixed/SKP_Silk_encode_frame_FIX.c
rename to silk/fixed/silk_encode_frame_FIX.c
index a1fbf1e..06d1d32 100644 (file)
@@ -25,19 +25,19 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FIX.h"\r
-#include "SKP_Silk_tuning_parameters.h"\r
+#include "silk_main_FIX.h"\r
+#include "silk_tuning_parameters.h"\r
 \r
 /****************/\r
 /* Encode frame */\r
 /****************/\r
-SKP_int SKP_Silk_encode_frame_FIX( \r
-    SKP_Silk_encoder_state_FIX      *psEnc,             /* I/O  Encoder state FIX                       */\r
+SKP_int silk_encode_frame_FIX( \r
+    silk_encoder_state_FIX          *psEnc,             /* I/O  Encoder state FIX                       */\r
     SKP_int32                       *pnBytesOut,        /*   O  Number of payload bytes                 */\r
     ec_enc                          *psRangeEnc         /* I/O  compressor data structure               */\r
 )\r
 {\r
-    SKP_Silk_encoder_control_FIX sEncCtrl;\r
+    silk_encoder_control_FIX sEncCtrl;\r
     SKP_int     ret = 0;\r
     SKP_int16   *x_frame, *res_pitch_frame;\r
     SKP_int16   xfw[ MAX_FRAME_LENGTH ];\r
@@ -58,16 +58,16 @@ TIC(ENCODE_FRAME)
     /* Voice Activity Detection */\r
     /****************************/\r
 TIC(VAD)\r
-    ret = SKP_Silk_VAD_GetSA_Q8( &psEnc->sCmn, psEnc->sCmn.inputBuf );\r
+    ret = silk_VAD_GetSA_Q8( &psEnc->sCmn, psEnc->sCmn.inputBuf - 1 );\r
 TOC(VAD)\r
 \r
     /**************************************************/\r
     /* Convert speech activity into VAD and DTX flags */\r
     /**************************************************/\r
-    if( psEnc->sCmn.nFramesAnalyzed == 0 ) {\r
+    if( psEnc->sCmn.nFramesEncoded == 0 ) {\r
         psEnc->sCmn.inDTX = psEnc->sCmn.useDTX;\r
     }\r
-    if( psEnc->sCmn.speech_activity_Q8 < SKP_FIX_CONST( SPEECH_ACTIVITY_DTX_THRES, 8 ) ) {\r
+    if( psEnc->sCmn.speech_activity_Q8 < SILK_FIX_CONST( SPEECH_ACTIVITY_DTX_THRES, 8 ) ) {\r
         psEnc->sCmn.indices.signalType = TYPE_NO_VOICE_ACTIVITY;\r
         psEnc->sCmn.noSpeechCounter++;\r
         if( psEnc->sCmn.noSpeechCounter < NB_SPEECH_FRAMES_BEFORE_DTX ) {\r
@@ -76,76 +76,76 @@ TOC(VAD)
             psEnc->sCmn.noSpeechCounter = NB_SPEECH_FRAMES_BEFORE_DTX;\r
             psEnc->sCmn.inDTX           = 0;\r
         }\r
-        psEnc->sCmn.VAD_flags[ psEnc->sCmn.nFramesAnalyzed ] = 0;\r
+        psEnc->sCmn.VAD_flags[ psEnc->sCmn.nFramesEncoded ] = 0;\r
     } else {\r
         psEnc->sCmn.noSpeechCounter    = 0;\r
         psEnc->sCmn.inDTX              = 0;\r
         psEnc->sCmn.indices.signalType = TYPE_UNVOICED;\r
-        psEnc->sCmn.VAD_flags[ psEnc->sCmn.nFramesAnalyzed ] = 1;\r
+        psEnc->sCmn.VAD_flags[ psEnc->sCmn.nFramesEncoded ] = 1;\r
     }\r
 \r
+    /***************************************/\r
+    /* Ensure smooth bandwidth transitions */\r
+    /***************************************/\r
+    silk_LP_variable_cutoff( &psEnc->sCmn.sLP, psEnc->sCmn.inputBuf - 1, psEnc->sCmn.frame_length );\r
+    \r
     /*******************************************/\r
-    /* High-pass filtering of the input signal */\r
+    /* Copy new frame to front of input buffer */\r
     /*******************************************/\r
-TIC(HP_IN)\r
-    SKP_Silk_HP_variable_cutoff( &psEnc->sCmn, x_frame + LA_SHAPE_MS * psEnc->sCmn.fs_kHz, psEnc->sCmn.inputBuf, psEnc->sCmn.frame_length );\r
-TOC(HP_IN)\r
+    SKP_memcpy( x_frame + LA_SHAPE_MS * psEnc->sCmn.fs_kHz, psEnc->sCmn.inputBuf - 1, psEnc->sCmn.frame_length * sizeof( SKP_int16 ) );\r
 \r
-    /* Ensure smooth bandwidth transitions */\r
-    SKP_Silk_LP_variable_cutoff( &psEnc->sCmn.sLP, x_frame + LA_SHAPE_MS * psEnc->sCmn.fs_kHz, psEnc->sCmn.frame_length );\r
-    \r
     /*****************************************/\r
     /* Find pitch lags, initial LPC analysis */\r
     /*****************************************/\r
 TIC(FIND_PITCH)\r
-    SKP_Silk_find_pitch_lags_FIX( psEnc, &sEncCtrl, res_pitch, x_frame );\r
+    silk_find_pitch_lags_FIX( psEnc, &sEncCtrl, res_pitch, x_frame );\r
 TOC(FIND_PITCH)\r
 \r
     /************************/\r
     /* Noise shape analysis */\r
     /************************/\r
 TIC(NOISE_SHAPE_ANALYSIS)\r
-    SKP_Silk_noise_shape_analysis_FIX( psEnc, &sEncCtrl, res_pitch_frame, x_frame );\r
+    silk_noise_shape_analysis_FIX( psEnc, &sEncCtrl, res_pitch_frame, x_frame );\r
 TOC(NOISE_SHAPE_ANALYSIS)\r
 \r
     /***************************************************/\r
     /* Find linear prediction coefficients (LPC + LTP) */\r
     /***************************************************/\r
 TIC(FIND_PRED_COEF)\r
-    SKP_Silk_find_pred_coefs_FIX( psEnc, &sEncCtrl, res_pitch, x_frame );\r
+    silk_find_pred_coefs_FIX( psEnc, &sEncCtrl, res_pitch, x_frame );\r
 TOC(FIND_PRED_COEF)\r
 \r
     /****************************************/\r
     /* Process gains                        */\r
     /****************************************/\r
 TIC(PROCESS_GAINS)\r
-    SKP_Silk_process_gains_FIX( psEnc, &sEncCtrl );\r
+    silk_process_gains_FIX( psEnc, &sEncCtrl );\r
 TOC(PROCESS_GAINS)\r
     \r
-    /****************************************/\r
-    /* Low Bitrate Redundant Encoding       */\r
-    /****************************************/\r
-TIC(LBRR)\r
-    SKP_Silk_LBRR_encode_FIX( psEnc, &sEncCtrl, xfw );\r
-TOC(LBRR)\r
-\r
     /*****************************************/\r
     /* Prefiltering for noise shaper         */\r
     /*****************************************/\r
 TIC(PREFILTER)\r
-    SKP_Silk_prefilter_FIX( psEnc, &sEncCtrl, xfw, x_frame );\r
+    silk_prefilter_FIX( psEnc, &sEncCtrl, xfw, x_frame );\r
 TOC(PREFILTER)\r
 \r
+    /****************************************/\r
+    /* Low Bitrate Redundant Encoding       */\r
+    /****************************************/\r
+TIC(LBRR)\r
+    silk_LBRR_encode_FIX( psEnc, &sEncCtrl, xfw );\r
+TOC(LBRR)\r
+\r
     /*****************************************/\r
     /* Noise shaping quantization            */\r
     /*****************************************/\r
 TIC(NSQ)\r
     if( psEnc->sCmn.nStatesDelayedDecision > 1 || psEnc->sCmn.warping_Q16 > 0 ) {\r
-        SKP_Silk_NSQ_del_dec( &psEnc->sCmn, &psEnc->sCmn.sNSQ, &psEnc->sCmn.indices, xfw, psEnc->sCmn.pulses, \r
+        silk_NSQ_del_dec( &psEnc->sCmn, &psEnc->sCmn.sNSQ, &psEnc->sCmn.indices, xfw, psEnc->sCmn.pulses, \r
             sEncCtrl.PredCoef_Q12[ 0 ], sEncCtrl.LTPCoef_Q14, sEncCtrl.AR2_Q13, sEncCtrl.HarmShapeGain_Q14, \r
             sEncCtrl.Tilt_Q14, sEncCtrl.LF_shp_Q14, sEncCtrl.Gains_Q16, sEncCtrl.pitchL, sEncCtrl.Lambda_Q10, sEncCtrl.LTP_scale_Q14 );\r
     } else {\r
-        SKP_Silk_NSQ( &psEnc->sCmn, &psEnc->sCmn.sNSQ, &psEnc->sCmn.indices, xfw, psEnc->sCmn.pulses, \r
+        silk_NSQ( &psEnc->sCmn, &psEnc->sCmn.sNSQ, &psEnc->sCmn.indices, xfw, psEnc->sCmn.pulses, \r
             sEncCtrl.PredCoef_Q12[ 0 ], sEncCtrl.LTPCoef_Q14, sEncCtrl.AR2_Q13, sEncCtrl.HarmShapeGain_Q14, \r
             sEncCtrl.Tilt_Q14, sEncCtrl.LF_shp_Q14, sEncCtrl.Gains_Q16, sEncCtrl.pitchL, sEncCtrl.Lambda_Q10, sEncCtrl.LTP_scale_Q14 );\r
     }\r
@@ -170,14 +170,14 @@ TOC(NSQ)
     /* Encode Parameters                    */\r
     /****************************************/\r
 TIC(ENCODE_PARAMS)\r
-    SKP_Silk_encode_indices( &psEnc->sCmn, psRangeEnc, psEnc->sCmn.nFramesAnalyzed, 0 );\r
+    silk_encode_indices( &psEnc->sCmn, psRangeEnc, psEnc->sCmn.nFramesEncoded, 0 );\r
 TOC(ENCODE_PARAMS)\r
 \r
     /****************************************/\r
     /* Encode Excitation Signal             */\r
     /****************************************/\r
 TIC(ENCODE_PULSES)\r
-    SKP_Silk_encode_pulses( psRangeEnc, psEnc->sCmn.indices.signalType, psEnc->sCmn.indices.quantOffsetType, \r
+    silk_encode_pulses( psRangeEnc, psEnc->sCmn.indices.signalType, psEnc->sCmn.indices.quantOffsetType, \r
         psEnc->sCmn.pulses, psEnc->sCmn.frame_length );\r
 TOC(ENCODE_PULSES)\r
 \r
@@ -185,12 +185,12 @@ TOC(ENCODE_PULSES)
     /* Finalize payload                     */\r
     /****************************************/\r
     psEnc->sCmn.first_frame_after_reset = 0;\r
-    if( ++psEnc->sCmn.nFramesAnalyzed >= psEnc->sCmn.nFramesPerPacket ) {\r
+    if( ++psEnc->sCmn.nFramesEncoded >= psEnc->sCmn.nFramesPerPacket ) {\r
         /* Payload size */\r
         *pnBytesOut = SKP_RSHIFT( ec_tell( psRangeEnc ) + 7, 3 );\r
 \r
         /* Reset the number of frames in payload buffer */\r
-        psEnc->sCmn.nFramesAnalyzed = 0;\r
+        psEnc->sCmn.nFramesEncoded = 0;\r
     } else {\r
         /* No payload this time */\r
         *pnBytesOut = 0;\r
@@ -243,30 +243,30 @@ TOC(ENCODE_FRAME)
 }\r
 \r
 /* Low-Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode excitation at lower bitrate  */\r
-void SKP_Silk_LBRR_encode_FIX(\r
-    SKP_Silk_encoder_state_FIX      *psEnc,         /* I/O  Pointer to Silk FIX encoder state           */\r
-    SKP_Silk_encoder_control_FIX    *psEncCtrl,     /* I/O  Pointer to Silk FIX encoder control struct  */\r
+void silk_LBRR_encode_FIX(\r
+    silk_encoder_state_FIX          *psEnc,         /* I/O  Pointer to Silk FIX encoder state           */\r
+    silk_encoder_control_FIX        *psEncCtrl,     /* I/O  Pointer to Silk FIX encoder control struct  */\r
     const SKP_int16                 xfw[]           /* I    Input signal                                */\r
 )\r
 {\r
     SKP_int32   TempGains_Q16[ MAX_NB_SUBFR ];\r
-    SideInfoIndices *psIndices_LBRR = &psEnc->sCmn.indices_LBRR[ psEnc->sCmn.nFramesAnalyzed ];\r
-    SKP_Silk_nsq_state sNSQ_LBRR;\r
+    SideInfoIndices *psIndices_LBRR = &psEnc->sCmn.indices_LBRR[ psEnc->sCmn.nFramesEncoded ];\r
+    silk_nsq_state sNSQ_LBRR;\r
 \r
     /*******************************************/\r
     /* Control use of inband LBRR              */\r
     /*******************************************/\r
-    if( psEnc->sCmn.LBRR_enabled && psEnc->sCmn.speech_activity_Q8 > SKP_FIX_CONST( LBRR_SPEECH_ACTIVITY_THRES, 8 ) ) {\r
-        psEnc->sCmn.LBRR_flags[ psEnc->sCmn.nFramesAnalyzed ] = 1;\r
+    if( psEnc->sCmn.LBRR_enabled && psEnc->sCmn.speech_activity_Q8 > SILK_FIX_CONST( LBRR_SPEECH_ACTIVITY_THRES, 8 ) ) {\r
+        psEnc->sCmn.LBRR_flags[ psEnc->sCmn.nFramesEncoded ] = 1;\r
 \r
         /* Copy noise shaping quantizer state and quantization indices from regular encoding */\r
-        SKP_memcpy( &sNSQ_LBRR, &psEnc->sCmn.sNSQ, sizeof( SKP_Silk_nsq_state ) );\r
+        SKP_memcpy( &sNSQ_LBRR, &psEnc->sCmn.sNSQ, sizeof( silk_nsq_state ) );\r
         SKP_memcpy( psIndices_LBRR, &psEnc->sCmn.indices, sizeof( SideInfoIndices ) );\r
 \r
         /* Save original gains */\r
         SKP_memcpy( TempGains_Q16, psEncCtrl->Gains_Q16, psEnc->sCmn.nb_subfr * sizeof( SKP_int32 ) );\r
 \r
-        if( psEnc->sCmn.nFramesAnalyzed == 0 || psEnc->sCmn.LBRR_flags[ psEnc->sCmn.nFramesAnalyzed - 1 ] == 0 ) {\r
+        if( psEnc->sCmn.nFramesEncoded == 0 || psEnc->sCmn.LBRR_flags[ psEnc->sCmn.nFramesEncoded - 1 ] == 0 ) {\r
             /* First frame in packet or previous frame not LBRR coded */\r
             psEnc->sCmn.LBRRprevLastGainIndex = psEnc->sShape.LastGainIndex;\r
 \r
@@ -277,20 +277,20 @@ void SKP_Silk_LBRR_encode_FIX(
 \r
         /* Decode to get gains in sync with decoder         */\r
         /* Overwrite unquantized gains with quantized gains */\r
-        SKP_Silk_gains_dequant( psEncCtrl->Gains_Q16, psIndices_LBRR->GainsIndices, \r
-            &psEnc->sCmn.LBRRprevLastGainIndex, psEnc->sCmn.nFramesAnalyzed, psEnc->sCmn.nb_subfr );\r
+        silk_gains_dequant( psEncCtrl->Gains_Q16, psIndices_LBRR->GainsIndices, \r
+            &psEnc->sCmn.LBRRprevLastGainIndex, psEnc->sCmn.nFramesEncoded, psEnc->sCmn.nb_subfr );\r
 \r
         /*****************************************/\r
         /* Noise shaping quantization            */\r
         /*****************************************/\r
         if( psEnc->sCmn.nStatesDelayedDecision > 1 || psEnc->sCmn.warping_Q16 > 0 ) {\r
-            SKP_Silk_NSQ_del_dec( &psEnc->sCmn, &sNSQ_LBRR, psIndices_LBRR, xfw, \r
-                psEnc->sCmn.pulses_LBRR[ psEnc->sCmn.nFramesAnalyzed ], psEncCtrl->PredCoef_Q12[ 0 ], psEncCtrl->LTPCoef_Q14, \r
+            silk_NSQ_del_dec( &psEnc->sCmn, &sNSQ_LBRR, psIndices_LBRR, xfw, \r
+                psEnc->sCmn.pulses_LBRR[ psEnc->sCmn.nFramesEncoded ], psEncCtrl->PredCoef_Q12[ 0 ], psEncCtrl->LTPCoef_Q14, \r
                 psEncCtrl->AR2_Q13, psEncCtrl->HarmShapeGain_Q14, psEncCtrl->Tilt_Q14, psEncCtrl->LF_shp_Q14, \r
                 psEncCtrl->Gains_Q16, psEncCtrl->pitchL, psEncCtrl->Lambda_Q10, psEncCtrl->LTP_scale_Q14 );\r
         } else {\r
-            SKP_Silk_NSQ( &psEnc->sCmn, &sNSQ_LBRR, psIndices_LBRR, xfw, \r
-                psEnc->sCmn.pulses_LBRR[ psEnc->sCmn.nFramesAnalyzed ], psEncCtrl->PredCoef_Q12[ 0 ], psEncCtrl->LTPCoef_Q14, \r
+            silk_NSQ( &psEnc->sCmn, &sNSQ_LBRR, psIndices_LBRR, xfw, \r
+                psEnc->sCmn.pulses_LBRR[ psEnc->sCmn.nFramesEncoded ], psEncCtrl->PredCoef_Q12[ 0 ], psEncCtrl->LTPCoef_Q14, \r
                 psEncCtrl->AR2_Q13, psEncCtrl->HarmShapeGain_Q14, psEncCtrl->Tilt_Q14, psEncCtrl->LF_shp_Q14, \r
                 psEncCtrl->Gains_Q16, psEncCtrl->pitchL, psEncCtrl->Lambda_Q10, psEncCtrl->LTP_scale_Q14 );\r
         }\r
similarity index 81%
rename from silk/fixed/SKP_Silk_find_LPC_FIX.c
rename to silk/fixed/silk_find_LPC_FIX.c
index bf065db..01d8246 100644 (file)
@@ -25,11 +25,11 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FIX.h"\r
-#include "SKP_Silk_tuning_parameters.h"\r
+#include "silk_main_FIX.h"\r
+#include "silk_tuning_parameters.h"\r
 \r
 /* Finds LPC vector from correlations, and converts to NLSF */\r
-void SKP_Silk_find_LPC_FIX(\r
+void silk_find_LPC_FIX(\r
     SKP_int16                       NLSF_Q15[],             /* O    NLSFs                                                           */\r
     SKP_int8                        *interpIndex,           /* O    NLSF interpolation index, only used for NLSF interpolation      */\r
     const SKP_int16                 prev_NLSFq_Q15[],       /* I    previous NLSFs, only used for NLSF interpolation                */\r
@@ -58,21 +58,21 @@ void SKP_Silk_find_LPC_FIX(
     *interpIndex = 4;\r
 \r
     /* Burg AR analysis for the full frame */\r
-    SKP_Silk_burg_modified( &res_nrg, &res_nrg_Q, a_Q16, x, subfr_length, nb_subfr, SKP_FIX_CONST( FIND_LPC_COND_FAC, 32 ), LPC_order );\r
+    silk_burg_modified( &res_nrg, &res_nrg_Q, a_Q16, x, subfr_length, nb_subfr, SILK_FIX_CONST( FIND_LPC_COND_FAC, 32 ), LPC_order );\r
 \r
     if( firstFrameAfterReset ) {\r
-        SKP_Silk_bwexpander_32( a_Q16, LPC_order, SKP_FIX_CONST( FIND_LPC_CHIRP_FIRST_FRAME, 16 ) );\r
+        silk_bwexpander_32( a_Q16, LPC_order, SILK_FIX_CONST( FIND_LPC_CHIRP_FIRST_FRAME, 16 ) );\r
     } else {\r
-        SKP_Silk_bwexpander_32( a_Q16, LPC_order, SKP_FIX_CONST( FIND_LPC_CHIRP, 16 ) );\r
+        silk_bwexpander_32( a_Q16, LPC_order, SILK_FIX_CONST( FIND_LPC_CHIRP, 16 ) );\r
     }\r
 \r
     if( useInterpNLSFs && !firstFrameAfterReset && nb_subfr == MAX_NB_SUBFR ) {\r
 \r
         /* Optimal solution for last 10 ms */\r
-        SKP_Silk_burg_modified( &res_tmp_nrg, &res_tmp_nrg_Q, a_tmp_Q16, x + ( MAX_NB_SUBFR >> 1 ) * subfr_length, \r
-            subfr_length, ( MAX_NB_SUBFR >> 1 ), SKP_FIX_CONST( FIND_LPC_COND_FAC, 32 ), LPC_order );\r
+        silk_burg_modified( &res_tmp_nrg, &res_tmp_nrg_Q, a_tmp_Q16, x + ( MAX_NB_SUBFR >> 1 ) * subfr_length, \r
+            subfr_length, ( MAX_NB_SUBFR >> 1 ), SILK_FIX_CONST( FIND_LPC_COND_FAC, 32 ), LPC_order );\r
 \r
-        SKP_Silk_bwexpander_32( a_tmp_Q16, LPC_order, SKP_FIX_CONST( FIND_LPC_CHIRP, 16 ) );\r
+        silk_bwexpander_32( a_tmp_Q16, LPC_order, SILK_FIX_CONST( FIND_LPC_CHIRP, 16 ) );\r
 \r
         /* subtract residual energy here, as that's easier than adding it to the    */\r
         /* residual energy of the first 10 ms in each iteration of the search below */\r
@@ -88,22 +88,22 @@ void SKP_Silk_find_LPC_FIX(
         }\r
         \r
         /* Convert to NLSFs */\r
-        SKP_Silk_A2NLSF( NLSF_Q15, a_tmp_Q16, LPC_order );\r
+        silk_A2NLSF( NLSF_Q15, a_tmp_Q16, LPC_order );\r
 \r
         /* Search over interpolation indices to find the one with lowest residual energy */\r
         res_nrg_2nd = SKP_int32_MAX;\r
         for( k = 3; k >= 0; k-- ) {\r
             /* Interpolate NLSFs for first half */\r
-            SKP_Silk_interpolate( NLSF0_Q15, prev_NLSFq_Q15, NLSF_Q15, k, LPC_order );\r
+            silk_interpolate( NLSF0_Q15, prev_NLSFq_Q15, NLSF_Q15, k, LPC_order );\r
 \r
             /* Convert to LPC for residual energy evaluation */\r
-            SKP_Silk_NLSF2A_stable( a_tmp_Q12, NLSF0_Q15, LPC_order );\r
+            silk_NLSF2A_stable( a_tmp_Q12, NLSF0_Q15, LPC_order );\r
 \r
             /* Calculate residual energy with NLSF interpolation */\r
-            SKP_Silk_LPC_analysis_filter( LPC_res, x, a_tmp_Q12, 2 * subfr_length, LPC_order );\r
+            silk_LPC_analysis_filter( LPC_res, x, a_tmp_Q12, 2 * subfr_length, LPC_order );\r
 \r
-            SKP_Silk_sum_sqr_shift( &res_nrg0, &rshift0, LPC_res + LPC_order,                subfr_length - LPC_order );\r
-            SKP_Silk_sum_sqr_shift( &res_nrg1, &rshift1, LPC_res + LPC_order + subfr_length, subfr_length - LPC_order );\r
+            silk_sum_sqr_shift( &res_nrg0, &rshift0, LPC_res + LPC_order,                subfr_length - LPC_order );\r
+            silk_sum_sqr_shift( &res_nrg1, &rshift1, LPC_res + LPC_order + subfr_length, subfr_length - LPC_order );\r
 \r
             /* Add subframe energies from first half frame */\r
             shift = rshift0 - rshift1;\r
@@ -150,7 +150,7 @@ void SKP_Silk_find_LPC_FIX(
 \r
     if( *interpIndex == 4 ) {\r
         /* NLSF interpolation is currently inactive, calculate NLSFs from full frame AR coefficients */\r
-        SKP_Silk_A2NLSF( NLSF_Q15, a_Q16, LPC_order );\r
+        silk_A2NLSF( NLSF_Q15, a_Q16, LPC_order );\r
     }\r
 \r
     SKP_assert( *interpIndex == 4 || ( useInterpNLSFs && !firstFrameAfterReset && nb_subfr == MAX_NB_SUBFR ) );\r
similarity index 81%
rename from silk/fixed/SKP_Silk_find_LTP_FIX.c
rename to silk/fixed/silk_find_LTP_FIX.c
index 50aeb56..21b28d3 100644 (file)
@@ -25,18 +25,18 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FIX.h"\r
-#include "SKP_Silk_tuning_parameters.h"\r
+#include "silk_main_FIX.h"\r
+#include "silk_tuning_parameters.h"\r
 \r
 /* Head room for correlations                           */\r
 #define LTP_CORRS_HEAD_ROOM                             2\r
 \r
-void SKP_Silk_fit_LTP(\r
+void silk_fit_LTP(\r
     SKP_int32 LTP_coefs_Q16[ LTP_ORDER ],\r
     SKP_int16 LTP_coefs_Q14[ LTP_ORDER ]\r
 );\r
 \r
-void SKP_Silk_find_LTP_FIX(\r
+void silk_find_LTP_FIX(\r
     SKP_int16           b_Q14[ MAX_NB_SUBFR * LTP_ORDER ],              /* O    LTP coefs                                                   */\r
     SKP_int32           WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ],   /* O    Weight for LTP quantization                                 */\r
     SKP_int             *LTPredCodGain_Q7,                              /* O    LTP coding gain                                             */\r
@@ -71,37 +71,37 @@ void SKP_Silk_find_LTP_FIX(
     for( k = 0; k < nb_subfr; k++ ) {\r
         lag_ptr = r_ptr - ( lag[ k ] + LTP_ORDER / 2 );\r
 \r
-        SKP_Silk_sum_sqr_shift( &rr[ k ], &rr_shifts, r_ptr, subfr_length ); /* rr[ k ] in Q( -rr_shifts ) */\r
+        silk_sum_sqr_shift( &rr[ k ], &rr_shifts, r_ptr, subfr_length ); /* rr[ k ] in Q( -rr_shifts ) */\r
 \r
         /* Assure headroom */\r
-        LZs = SKP_Silk_CLZ32( rr[k] );\r
+        LZs = silk_CLZ32( rr[k] );\r
         if( LZs < LTP_CORRS_HEAD_ROOM ) {\r
             rr[ k ] = SKP_RSHIFT_ROUND( rr[ k ], LTP_CORRS_HEAD_ROOM - LZs );\r
             rr_shifts += ( LTP_CORRS_HEAD_ROOM - LZs );\r
         }\r
         corr_rshifts[ k ] = rr_shifts;\r
-        SKP_Silk_corrMatrix_FIX( lag_ptr, subfr_length, LTP_ORDER, LTP_CORRS_HEAD_ROOM, WLTP_ptr, &corr_rshifts[ k ] );  /* WLTP_fix_ptr in Q( -corr_rshifts[ k ] ) */\r
+        silk_corrMatrix_FIX( lag_ptr, subfr_length, LTP_ORDER, LTP_CORRS_HEAD_ROOM, WLTP_ptr, &corr_rshifts[ k ] );  /* WLTP_fix_ptr in Q( -corr_rshifts[ k ] ) */\r
 \r
         /* The correlation vector always has lower max abs value than rr and/or RR so head room is assured */\r
-        SKP_Silk_corrVector_FIX( lag_ptr, r_ptr, subfr_length, LTP_ORDER, Rr, corr_rshifts[ k ] );  /* Rr_fix_ptr   in Q( -corr_rshifts[ k ] ) */\r
+        silk_corrVector_FIX( lag_ptr, r_ptr, subfr_length, LTP_ORDER, Rr, corr_rshifts[ k ] );  /* Rr_fix_ptr   in Q( -corr_rshifts[ k ] ) */\r
         if( corr_rshifts[ k ] > rr_shifts ) {\r
             rr[ k ] = SKP_RSHIFT( rr[ k ], corr_rshifts[ k ] - rr_shifts ); /* rr[ k ] in Q( -corr_rshifts[ k ] ) */\r
         }\r
         SKP_assert( rr[ k ] >= 0 );\r
 \r
         regu = 1;\r
-        regu = SKP_SMLAWB( regu, rr[ k ], SKP_FIX_CONST( LTP_DAMPING/3, 16 ) );\r
-        regu = SKP_SMLAWB( regu, matrix_ptr( WLTP_ptr, 0, 0, LTP_ORDER ), SKP_FIX_CONST( LTP_DAMPING/3, 16 ) );\r
-        regu = SKP_SMLAWB( regu, matrix_ptr( WLTP_ptr, LTP_ORDER-1, LTP_ORDER-1, LTP_ORDER ), SKP_FIX_CONST( LTP_DAMPING/3, 16 ) );\r
-        SKP_Silk_regularize_correlations_FIX( WLTP_ptr, &rr[k], regu, LTP_ORDER );\r
+        regu = SKP_SMLAWB( regu, rr[ k ], SILK_FIX_CONST( LTP_DAMPING/3, 16 ) );\r
+        regu = SKP_SMLAWB( regu, matrix_ptr( WLTP_ptr, 0, 0, LTP_ORDER ), SILK_FIX_CONST( LTP_DAMPING/3, 16 ) );\r
+        regu = SKP_SMLAWB( regu, matrix_ptr( WLTP_ptr, LTP_ORDER-1, LTP_ORDER-1, LTP_ORDER ), SILK_FIX_CONST( LTP_DAMPING/3, 16 ) );\r
+        silk_regularize_correlations_FIX( WLTP_ptr, &rr[k], regu, LTP_ORDER );\r
 \r
-        SKP_Silk_solve_LDL_FIX( WLTP_ptr, LTP_ORDER, Rr, b_Q16 ); /* WLTP_fix_ptr and Rr_fix_ptr both in Q(-corr_rshifts[k]) */\r
+        silk_solve_LDL_FIX( WLTP_ptr, LTP_ORDER, Rr, b_Q16 ); /* WLTP_fix_ptr and Rr_fix_ptr both in Q(-corr_rshifts[k]) */\r
 \r
         /* Limit and store in Q14 */\r
-        SKP_Silk_fit_LTP( b_Q16, b_Q14_ptr );\r
+        silk_fit_LTP( b_Q16, b_Q14_ptr );\r
 \r
         /* Calculate residual energy */\r
-        nrg[ k ] = SKP_Silk_residual_energy16_covar_FIX( b_Q14_ptr, WLTP_ptr, Rr, rr[ k ], LTP_ORDER, 14 ); /* nrg_fix in Q( -corr_rshifts[ k ] ) */\r
+        nrg[ k ] = silk_residual_energy16_covar_FIX( b_Q14_ptr, WLTP_ptr, Rr, rr[ k ], LTP_ORDER, 14 ); /* nrg_fix in Q( -corr_rshifts[ k ] ) */\r
 \r
         /* temp = Wght[ k ] / ( nrg[ k ] * Wght[ k ] + 0.01f * subfr_length ); */\r
         extra_shifts = SKP_min_int( corr_rshifts[ k ], LTP_CORRS_HEAD_ROOM );\r
@@ -117,13 +117,13 @@ void SKP_Silk_find_LTP_FIX(
         for( i = 0; i < LTP_ORDER * LTP_ORDER; i++ ) {\r
             WLTP_max = SKP_max( WLTP_ptr[ i ], WLTP_max );\r
         }\r
-        lshift = SKP_Silk_CLZ32( WLTP_max ) - 1 - 3; /* keep 3 bits free for vq_nearest_neighbor_fix */\r
+        lshift = silk_CLZ32( WLTP_max ) - 1 - 3; /* keep 3 bits free for vq_nearest_neighbor_fix */\r
         SKP_assert( 26 - 18 + lshift >= 0 );\r
         if( 26 - 18 + lshift < 31 ) {\r
             temp32 = SKP_min_32( temp32, SKP_LSHIFT( ( SKP_int32 )1, 26 - 18 + lshift ) );\r
         }\r
 \r
-        SKP_Silk_scale_vector32_Q26_lshift_18( WLTP_ptr, temp32, LTP_ORDER * LTP_ORDER ); /* WLTP_ptr in Q( 18 - corr_rshifts[ k ] ) */\r
+        silk_scale_vector32_Q26_lshift_18( WLTP_ptr, temp32, LTP_ORDER * LTP_ORDER ); /* WLTP_ptr in Q( 18 - corr_rshifts[ k ] ) */\r
         \r
         w[ k ] = matrix_ptr( WLTP_ptr, LTP_ORDER/2, LTP_ORDER/2, LTP_ORDER ); /* w in Q( 18 - corr_rshifts[ k ] ) */\r
         SKP_assert( w[k] >= 0 );\r
@@ -149,10 +149,10 @@ void SKP_Silk_find_LTP_FIX(
         }\r
         LPC_LTP_res_nrg = SKP_max( LPC_LTP_res_nrg, 1 ); /* avoid division by zero */\r
 \r
-        div_Q16 = SKP_DIV32_varQ( LPC_res_nrg, LPC_LTP_res_nrg, 16 );\r
-        *LTPredCodGain_Q7 = ( SKP_int )SKP_SMULBB( 3, SKP_Silk_lin2log( div_Q16 ) - ( 16 << 7 ) );\r
+        div_Q16 = silk_DIV32_varQ( LPC_res_nrg, LPC_LTP_res_nrg, 16 );\r
+        *LTPredCodGain_Q7 = ( SKP_int )SKP_SMULBB( 3, silk_lin2log( div_Q16 ) - ( 16 << 7 ) );\r
 \r
-        SKP_assert( *LTPredCodGain_Q7 == ( SKP_int )SKP_SAT16( SKP_MUL( 3, SKP_Silk_lin2log( div_Q16 ) - ( 16 << 7 ) ) ) );\r
+        SKP_assert( *LTPredCodGain_Q7 == ( SKP_int )SKP_SAT16( SKP_MUL( 3, silk_lin2log( div_Q16 ) - ( 16 << 7 ) ) ) );\r
     }\r
 \r
     /* smoothing */\r
@@ -175,14 +175,14 @@ void SKP_Silk_find_LTP_FIX(
         max_abs_d_Q14 = SKP_max_32( max_abs_d_Q14, SKP_abs( d_Q14[ k ] ) );\r
         /* w[ k ] is in Q( 18 - corr_rshifts[ k ] ) */\r
         /* Find bits needed in Q( 18 - maxRshifts ) */\r
-        max_w_bits = SKP_max_32( max_w_bits, 32 - SKP_Silk_CLZ32( w[ k ] ) + corr_rshifts[ k ] - maxRshifts ); \r
+        max_w_bits = SKP_max_32( max_w_bits, 32 - silk_CLZ32( w[ k ] ) + corr_rshifts[ k ] - maxRshifts ); \r
     }\r
 \r
     /* max_abs_d_Q14 = (5 << 15); worst case, i.e. LTP_ORDER * -SKP_int16_MIN */\r
     SKP_assert( max_abs_d_Q14 <= ( 5 << 15 ) );\r
 \r
     /* How many bits is needed for w*d' in Q( 18 - maxRshifts ) in the worst case, of all d_Q14's being equal to max_abs_d_Q14 */\r
-    extra_shifts = max_w_bits + 32 - SKP_Silk_CLZ32( max_abs_d_Q14 ) - 14;\r
+    extra_shifts = max_w_bits + 32 - silk_CLZ32( max_abs_d_Q14 ) - 14;\r
     \r
     /* Subtract what we got available; bits in output var plus maxRshifts */\r
     extra_shifts -= ( 32 - 1 - 2 + maxRshifts ); /* Keep sign bit free as well as 2 bits for accumulation */\r
@@ -197,7 +197,7 @@ void SKP_Silk_find_LTP_FIX(
         temp32 = SKP_ADD32( temp32,                     SKP_RSHIFT( w[ k ], maxRshifts_wxtra - corr_rshifts[ k ] ) );                    /* Q( 18 - maxRshifts_wxtra ) */\r
         wd     = SKP_ADD32( wd, SKP_LSHIFT( SKP_SMULWW( SKP_RSHIFT( w[ k ], maxRshifts_wxtra - corr_rshifts[ k ] ), d_Q14[ k ] ), 2 ) ); /* Q( 18 - maxRshifts_wxtra ) */\r
     }\r
-    m_Q12 = SKP_DIV32_varQ( wd, temp32, 12 );\r
+    m_Q12 = silk_DIV32_varQ( wd, temp32, 12 );\r
 \r
     b_Q14_ptr = b_Q14;\r
     for( k = 0; k < nb_subfr; k++ ) {\r
@@ -210,8 +210,8 @@ void SKP_Silk_find_LTP_FIX(
 \r
         g_Q26 = SKP_MUL( \r
             SKP_DIV32( \r
-                SKP_FIX_CONST( LTP_SMOOTHING, 26 ), \r
-                SKP_RSHIFT( SKP_FIX_CONST( LTP_SMOOTHING, 26 ), 10 ) + temp32 ),                                       /* Q10 */ \r
+                SILK_FIX_CONST( LTP_SMOOTHING, 26 ), \r
+                SKP_RSHIFT( SILK_FIX_CONST( LTP_SMOOTHING, 26 ), 10 ) + temp32 ),                                       /* Q10 */ \r
             SKP_LSHIFT_SAT32( SKP_SUB_SAT32( ( SKP_int32 )m_Q12, SKP_RSHIFT( d_Q14[ k ], 2 ) ), 4 ) );  /* Q16 */\r
 \r
         temp32 = 0;\r
@@ -228,7 +228,7 @@ void SKP_Silk_find_LTP_FIX(
 TOC(find_LTP_FIX)\r
 }\r
 \r
-void SKP_Silk_fit_LTP(\r
+void silk_fit_LTP(\r
     SKP_int32 LTP_coefs_Q16[ LTP_ORDER ],\r
     SKP_int16 LTP_coefs_Q14[ LTP_ORDER ]\r
 )\r
similarity index 74%
rename from silk/fixed/SKP_Silk_find_pitch_lags_FIX.c
rename to silk/fixed/silk_find_pitch_lags_FIX.c
index bfc3e36..d6c4ee8 100644 (file)
@@ -25,13 +25,13 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FIX.h"\r
-#include "SKP_Silk_tuning_parameters.h"\r
+#include "silk_main_FIX.h"\r
+#include "silk_tuning_parameters.h"\r
 \r
 /* Find pitch lags */\r
-void SKP_Silk_find_pitch_lags_FIX(\r
-    SKP_Silk_encoder_state_FIX      *psEnc,         /* I/O  encoder state                               */\r
-    SKP_Silk_encoder_control_FIX    *psEncCtrl,     /* I/O  encoder control                             */\r
+void silk_find_pitch_lags_FIX(\r
+    silk_encoder_state_FIX          *psEnc,         /* I/O  encoder state                               */\r
+    silk_encoder_control_FIX        *psEncCtrl,     /* I/O  encoder control                             */\r
     SKP_int16                       res[],          /* O    residual                                    */\r
     const SKP_int16                 x[]             /* I    Speech signal                               */\r
 )\r
@@ -64,7 +64,7 @@ void SKP_Silk_find_pitch_lags_FIX(
     /* First LA_LTP samples */\r
     x_buf_ptr = x_buf + buf_len - psEnc->sCmn.pitch_LPC_win_length;\r
     Wsig_ptr  = Wsig;\r
-    SKP_Silk_apply_sine_window( Wsig_ptr, x_buf_ptr, 1, psEnc->sCmn.la_pitch );\r
+    silk_apply_sine_window( Wsig_ptr, x_buf_ptr, 1, psEnc->sCmn.la_pitch );\r
 \r
     /* Middle un - windowed samples */\r
     Wsig_ptr  += psEnc->sCmn.la_pitch;\r
@@ -74,22 +74,22 @@ void SKP_Silk_find_pitch_lags_FIX(
     /* Last LA_LTP samples */\r
     Wsig_ptr  += psEnc->sCmn.pitch_LPC_win_length - SKP_LSHIFT( psEnc->sCmn.la_pitch, 1 );\r
     x_buf_ptr += psEnc->sCmn.pitch_LPC_win_length - SKP_LSHIFT( psEnc->sCmn.la_pitch, 1 );\r
-    SKP_Silk_apply_sine_window( Wsig_ptr, x_buf_ptr, 2, psEnc->sCmn.la_pitch );\r
+    silk_apply_sine_window( Wsig_ptr, x_buf_ptr, 2, psEnc->sCmn.la_pitch );\r
 \r
     /* Calculate autocorrelation sequence */\r
-    SKP_Silk_autocorr( auto_corr, &scale, Wsig, psEnc->sCmn.pitch_LPC_win_length, psEnc->sCmn.pitchEstimationLPCOrder + 1 ); \r
+    silk_autocorr( auto_corr, &scale, Wsig, psEnc->sCmn.pitch_LPC_win_length, psEnc->sCmn.pitchEstimationLPCOrder + 1 ); \r
         \r
     /* Add white noise, as fraction of energy */\r
-    auto_corr[ 0 ] = SKP_SMLAWB( auto_corr[ 0 ], auto_corr[ 0 ], SKP_FIX_CONST( FIND_PITCH_WHITE_NOISE_FRACTION, 16 ) ) + 1;\r
+    auto_corr[ 0 ] = SKP_SMLAWB( auto_corr[ 0 ], auto_corr[ 0 ], SILK_FIX_CONST( FIND_PITCH_WHITE_NOISE_FRACTION, 16 ) ) + 1;\r
 \r
     /* Calculate the reflection coefficients using schur */\r
-    res_nrg = SKP_Silk_schur( rc_Q15, auto_corr, psEnc->sCmn.pitchEstimationLPCOrder );\r
+    res_nrg = silk_schur( rc_Q15, auto_corr, psEnc->sCmn.pitchEstimationLPCOrder );\r
 \r
     /* Prediction gain */\r
-    psEncCtrl->predGain_Q16 = SKP_DIV32_varQ( auto_corr[ 0 ], SKP_max_int( res_nrg, 1 ), 16 );\r
+    psEncCtrl->predGain_Q16 = silk_DIV32_varQ( auto_corr[ 0 ], SKP_max_int( res_nrg, 1 ), 16 );\r
 \r
     /* Convert reflection coefficients to prediction coefficients */\r
-    SKP_Silk_k2a( A_Q24, rc_Q15, psEnc->sCmn.pitchEstimationLPCOrder );\r
+    silk_k2a( A_Q24, rc_Q15, psEnc->sCmn.pitchEstimationLPCOrder );\r
     \r
     /* Convert From 32 bit Q24 to 16 bit Q12 coefs */\r
     for( i = 0; i < psEnc->sCmn.pitchEstimationLPCOrder; i++ ) {\r
@@ -97,26 +97,26 @@ void SKP_Silk_find_pitch_lags_FIX(
     }\r
 \r
     /* Do BWE */\r
-    SKP_Silk_bwexpander( A_Q12, psEnc->sCmn.pitchEstimationLPCOrder, SKP_FIX_CONST( FIND_PITCH_BANDWITH_EXPANSION, 16 ) );\r
+    silk_bwexpander( A_Q12, psEnc->sCmn.pitchEstimationLPCOrder, SILK_FIX_CONST( FIND_PITCH_BANDWITH_EXPANSION, 16 ) );\r
     \r
     /*****************************************/\r
     /* LPC analysis filtering                */\r
     /*****************************************/\r
-    SKP_Silk_LPC_analysis_filter( res, x_buf, A_Q12, buf_len, psEnc->sCmn.pitchEstimationLPCOrder );\r
+    silk_LPC_analysis_filter( res, x_buf, A_Q12, buf_len, psEnc->sCmn.pitchEstimationLPCOrder );\r
 \r
     if( psEnc->sCmn.indices.signalType != TYPE_NO_VOICE_ACTIVITY && psEnc->sCmn.first_frame_after_reset == 0 ) {\r
         /* Threshold for pitch estimator */\r
-        thrhld_Q15 = SKP_FIX_CONST( 0.6, 15 );\r
-        thrhld_Q15 = SKP_SMLABB( thrhld_Q15, SKP_FIX_CONST( -0.004, 15 ), psEnc->sCmn.pitchEstimationLPCOrder );\r
-        thrhld_Q15 = SKP_SMLABB( thrhld_Q15, SKP_FIX_CONST( -0.1,   7  ), psEnc->sCmn.speech_activity_Q8 );\r
-        thrhld_Q15 = SKP_SMLABB( thrhld_Q15, SKP_FIX_CONST( -0.15,  15 ), SKP_RSHIFT( psEnc->sCmn.prevSignalType, 1 ) );\r
-        thrhld_Q15 = SKP_SMLAWB( thrhld_Q15, SKP_FIX_CONST( -0.1,   16 ), psEnc->sCmn.input_tilt_Q15 );\r
+        thrhld_Q15 = SILK_FIX_CONST( 0.6, 15 );\r
+        thrhld_Q15 = SKP_SMLABB( thrhld_Q15, SILK_FIX_CONST( -0.004, 15 ), psEnc->sCmn.pitchEstimationLPCOrder );\r
+        thrhld_Q15 = SKP_SMLABB( thrhld_Q15, SILK_FIX_CONST( -0.1,   7  ), psEnc->sCmn.speech_activity_Q8 );\r
+        thrhld_Q15 = SKP_SMLABB( thrhld_Q15, SILK_FIX_CONST( -0.15,  15 ), SKP_RSHIFT( psEnc->sCmn.prevSignalType, 1 ) );\r
+        thrhld_Q15 = SKP_SMLAWB( thrhld_Q15, SILK_FIX_CONST( -0.1,   16 ), psEnc->sCmn.input_tilt_Q15 );\r
         thrhld_Q15 = SKP_SAT16(  thrhld_Q15 );\r
 \r
         /*****************************************/\r
         /* Call pitch estimator                  */\r
         /*****************************************/\r
-        if( SKP_Silk_pitch_analysis_core( res, psEncCtrl->pitchL, &psEnc->sCmn.indices.lagIndex, &psEnc->sCmn.indices.contourIndex, \r
+        if( silk_pitch_analysis_core( res, psEncCtrl->pitchL, &psEnc->sCmn.indices.lagIndex, &psEnc->sCmn.indices.contourIndex, \r
                 &psEnc->LTPCorr_Q15, psEnc->sCmn.prevLag, psEnc->sCmn.pitchEstimationThreshold_Q16, \r
                 ( SKP_int16 )thrhld_Q15, psEnc->sCmn.fs_kHz, psEnc->sCmn.pitchEstimationComplexity, psEnc->sCmn.nb_subfr ) == 0 ) \r
         {\r
similarity index 82%
rename from silk/fixed/SKP_Silk_find_pred_coefs_FIX.c
rename to silk/fixed/silk_find_pred_coefs_FIX.c
index 033a5a0..21885b4 100644 (file)
@@ -25,11 +25,11 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FIX.h"\r
+#include "silk_main_FIX.h"\r
 \r
-void SKP_Silk_find_pred_coefs_FIX(\r
-    SKP_Silk_encoder_state_FIX      *psEnc,         /* I/O  encoder state                               */\r
-    SKP_Silk_encoder_control_FIX    *psEncCtrl,     /* I/O  encoder control                             */\r
+void silk_find_pred_coefs_FIX(\r
+    silk_encoder_state_FIX          *psEnc,         /* I/O  encoder state                               */\r
+    silk_encoder_control_FIX        *psEncCtrl,     /* I/O  encoder control                             */\r
     const SKP_int16                 res_pitch[],    /* I    Residual from pitch analysis                */\r
     const SKP_int16                 x[]             /* I    Speech signal                               */\r
 )\r
@@ -52,7 +52,7 @@ void SKP_Silk_find_pred_coefs_FIX(
         /* Divide to Q16 */\r
         SKP_assert( psEncCtrl->Gains_Q16[ i ] > 0 );\r
         /* Invert and normalize gains, and ensure that maximum invGains_Q16 is within range of a 16 bit int */\r
-        invGains_Q16[ i ] = SKP_DIV32_varQ( min_gain_Q16, psEncCtrl->Gains_Q16[ i ], 16 - 2 );\r
+        invGains_Q16[ i ] = silk_DIV32_varQ( min_gain_Q16, psEncCtrl->Gains_Q16[ i ], 16 - 2 );\r
 \r
         /* Ensure Wght_Q15 a minimum value 1 */\r
         invGains_Q16[ i ] = SKP_max( invGains_Q16[ i ], 363 ); \r
@@ -73,19 +73,19 @@ void SKP_Silk_find_pred_coefs_FIX(
         SKP_assert( psEnc->sCmn.ltp_mem_length - psEnc->sCmn.predictLPCOrder >= psEncCtrl->pitchL[ 0 ] + LTP_ORDER / 2 );\r
 \r
         /* LTP analysis */\r
-        SKP_Silk_find_LTP_FIX( psEncCtrl->LTPCoef_Q14, WLTP, &psEncCtrl->LTPredCodGain_Q7, \r
+        silk_find_LTP_FIX( psEncCtrl->LTPCoef_Q14, WLTP, &psEncCtrl->LTPredCodGain_Q7, \r
             res_pitch, psEncCtrl->pitchL, Wght_Q15, psEnc->sCmn.subfr_length, \r
             psEnc->sCmn.nb_subfr, psEnc->sCmn.ltp_mem_length, LTP_corrs_rshift );\r
 \r
         /* Quantize LTP gain parameters */\r
-        SKP_Silk_quant_LTP_gains( psEncCtrl->LTPCoef_Q14, psEnc->sCmn.indices.LTPIndex, &psEnc->sCmn.indices.PERIndex, \r
+        silk_quant_LTP_gains( psEncCtrl->LTPCoef_Q14, psEnc->sCmn.indices.LTPIndex, &psEnc->sCmn.indices.PERIndex, \r
             WLTP, psEnc->sCmn.mu_LTP_Q9, psEnc->sCmn.LTPQuantLowComplexity, psEnc->sCmn.nb_subfr);\r
 \r
         /* Control LTP scaling */\r
-        SKP_Silk_LTP_scale_ctrl_FIX( psEnc, psEncCtrl );\r
+        silk_LTP_scale_ctrl_FIX( psEnc, psEncCtrl );\r
 \r
         /* Create LTP residual */\r
-        SKP_Silk_LTP_analysis_filter_FIX( LPC_in_pre, x - psEnc->sCmn.predictLPCOrder, psEncCtrl->LTPCoef_Q14, \r
+        silk_LTP_analysis_filter_FIX( LPC_in_pre, x - psEnc->sCmn.predictLPCOrder, psEncCtrl->LTPCoef_Q14, \r
             psEncCtrl->pitchL, invGains_Q16, psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr, psEnc->sCmn.predictLPCOrder );\r
 \r
     } else {\r
@@ -96,7 +96,7 @@ void SKP_Silk_find_pred_coefs_FIX(
         x_ptr     = x - psEnc->sCmn.predictLPCOrder;\r
         x_pre_ptr = LPC_in_pre;\r
         for( i = 0; i < psEnc->sCmn.nb_subfr; i++ ) {\r
-            SKP_Silk_scale_copy_vector16( x_pre_ptr, x_ptr, invGains_Q16[ i ], \r
+            silk_scale_copy_vector16( x_pre_ptr, x_ptr, invGains_Q16[ i ], \r
                 psEnc->sCmn.subfr_length + psEnc->sCmn.predictLPCOrder );\r
             x_pre_ptr += psEnc->sCmn.subfr_length + psEnc->sCmn.predictLPCOrder;\r
             x_ptr     += psEnc->sCmn.subfr_length;\r
@@ -108,18 +108,18 @@ void SKP_Silk_find_pred_coefs_FIX(
 \r
     /* LPC_in_pre contains the LTP-filtered input for voiced, and the unfiltered input for unvoiced */\r
     TIC(FIND_LPC)\r
-    SKP_Silk_find_LPC_FIX( NLSF_Q15, &psEnc->sCmn.indices.NLSFInterpCoef_Q2, psEnc->sCmn.prev_NLSFq_Q15, \r
+    silk_find_LPC_FIX( NLSF_Q15, &psEnc->sCmn.indices.NLSFInterpCoef_Q2, psEnc->sCmn.prev_NLSFq_Q15, \r
         psEnc->sCmn.useInterpolatedNLSFs, psEnc->sCmn.first_frame_after_reset, psEnc->sCmn.predictLPCOrder, \r
         LPC_in_pre, psEnc->sCmn.subfr_length + psEnc->sCmn.predictLPCOrder, psEnc->sCmn.nb_subfr );\r
     TOC(FIND_LPC)\r
 \r
     /* Quantize LSFs */\r
     TIC(PROCESS_LSFS)\r
-    SKP_Silk_process_NLSFs( &psEnc->sCmn, psEncCtrl->PredCoef_Q12, NLSF_Q15, psEnc->sCmn.prev_NLSFq_Q15 );\r
+    silk_process_NLSFs( &psEnc->sCmn, psEncCtrl->PredCoef_Q12, NLSF_Q15, psEnc->sCmn.prev_NLSFq_Q15 );\r
     TOC(PROCESS_LSFS)\r
 \r
     /* Calculate residual energy using quantized LPC coefficients */\r
-    SKP_Silk_residual_energy_FIX( psEncCtrl->ResNrg, psEncCtrl->ResNrgQ, LPC_in_pre, psEncCtrl->PredCoef_Q12, local_gains,\r
+    silk_residual_energy_FIX( psEncCtrl->ResNrg, psEncCtrl->ResNrgQ, LPC_in_pre, psEncCtrl->PredCoef_Q12, local_gains,\r
         psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr, psEnc->sCmn.predictLPCOrder );\r
 \r
     /* Copy to prediction struct for use in next frame for fluctuation reduction */\r
index 004b032..10840be 100644 (file)
     <None Include="ReadMe.txt" />\r
   </ItemGroup>\r
   <ItemGroup>\r
-    <ClCompile Include="SKP_Silk_corrMatrix_FIX.c" />\r
-    <ClCompile Include="SKP_Silk_encode_frame_FIX.c" />\r
-    <ClCompile Include="SKP_Silk_find_LPC_FIX.c" />\r
-    <ClCompile Include="SKP_Silk_find_LTP_FIX.c" />\r
-    <ClCompile Include="SKP_Silk_find_pitch_lags_FIX.c" />\r
-    <ClCompile Include="SKP_Silk_find_pred_coefs_FIX.c" />\r
-    <ClCompile Include="SKP_Silk_LTP_analysis_filter_FIX.c" />\r
-    <ClCompile Include="SKP_Silk_LTP_scale_ctrl_FIX.c" />\r
-    <ClCompile Include="SKP_Silk_noise_shape_analysis_FIX.c" />\r
-    <ClCompile Include="SKP_Silk_prefilter_FIX.c" />\r
-    <ClCompile Include="SKP_Silk_process_gains_FIX.c" />\r
-    <ClCompile Include="SKP_Silk_regularize_correlations_FIX.c" />\r
-    <ClCompile Include="SKP_Silk_residual_energy16_FIX.c" />\r
-    <ClCompile Include="SKP_Silk_residual_energy_FIX.c" />\r
-    <ClCompile Include="SKP_Silk_solve_LS_FIX.c" />\r
-    <ClCompile Include="SKP_Silk_warped_autocorrelation_FIX.c" />\r
+    <ClCompile Include="silk_corrMatrix_FIX.c" />\r
+    <ClCompile Include="silk_encode_frame_FIX.c" />\r
+    <ClCompile Include="silk_find_LPC_FIX.c" />\r
+    <ClCompile Include="silk_find_LTP_FIX.c" />\r
+    <ClCompile Include="silk_find_pitch_lags_FIX.c" />\r
+    <ClCompile Include="silk_find_pred_coefs_FIX.c" />\r
+    <ClCompile Include="silk_LTP_analysis_filter_FIX.c" />\r
+    <ClCompile Include="silk_LTP_scale_ctrl_FIX.c" />\r
+    <ClCompile Include="silk_noise_shape_analysis_FIX.c" />\r
+    <ClCompile Include="silk_prefilter_FIX.c" />\r
+    <ClCompile Include="silk_process_gains_FIX.c" />\r
+    <ClCompile Include="silk_regularize_correlations_FIX.c" />\r
+    <ClCompile Include="silk_residual_energy16_FIX.c" />\r
+    <ClCompile Include="silk_residual_energy_FIX.c" />\r
+    <ClCompile Include="silk_solve_LS_FIX.c" />\r
+    <ClCompile Include="silk_warped_autocorrelation_FIX.c" />\r
   </ItemGroup>\r
   <ItemGroup>\r
-    <ClInclude Include="SKP_Silk_main_FIX.h" />\r
-    <ClInclude Include="SKP_Silk_structs_FIX.h" />\r
+    <ClInclude Include="..\..\win32\config.h" />\r
+    <ClInclude Include="..\silk_SigProc_FIX.h" />\r
+    <ClInclude Include="silk_main_FIX.h" />\r
+    <ClInclude Include="silk_structs_FIX.h" />\r
   </ItemGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
   <ImportGroup Label="ExtensionTargets">\r
index 49c8f28..4fbb369 100644 (file)
     <None Include="ReadMe.txt" />\r
   </ItemGroup>\r
   <ItemGroup>\r
-    <ClCompile Include="SKP_Silk_LTP_scale_ctrl_FIX.c">\r
+    <ClCompile Include="silk_corrMatrix_FIX.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_noise_shape_analysis_FIX.c">\r
+    <ClCompile Include="silk_encode_frame_FIX.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_prefilter_FIX.c">\r
+    <ClCompile Include="silk_find_LPC_FIX.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_process_gains_FIX.c">\r
+    <ClCompile Include="silk_find_LTP_FIX.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_regularize_correlations_FIX.c">\r
+    <ClCompile Include="silk_find_pitch_lags_FIX.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_residual_energy_FIX.c">\r
+    <ClCompile Include="silk_find_pred_coefs_FIX.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_residual_energy16_FIX.c">\r
+    <ClCompile Include="silk_LTP_analysis_filter_FIX.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_solve_LS_FIX.c">\r
+    <ClCompile Include="silk_LTP_scale_ctrl_FIX.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_warped_autocorrelation_FIX.c">\r
+    <ClCompile Include="silk_noise_shape_analysis_FIX.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_corrMatrix_FIX.c">\r
+    <ClCompile Include="silk_prefilter_FIX.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_encode_frame_FIX.c">\r
+    <ClCompile Include="silk_process_gains_FIX.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_find_LPC_FIX.c">\r
+    <ClCompile Include="silk_regularize_correlations_FIX.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_find_LTP_FIX.c">\r
+    <ClCompile Include="silk_residual_energy16_FIX.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_find_pitch_lags_FIX.c">\r
+    <ClCompile Include="silk_residual_energy_FIX.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_find_pred_coefs_FIX.c">\r
+    <ClCompile Include="silk_solve_LS_FIX.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_LTP_analysis_filter_FIX.c">\r
+    <ClCompile Include="silk_warped_autocorrelation_FIX.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
-    <ClInclude Include="SKP_Silk_main_FIX.h">\r
+    <ClInclude Include="..\..\win32\config.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="SKP_Silk_structs_FIX.h">\r
+    <ClInclude Include="silk_main_FIX.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\silk_SigProc_FIX.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="silk_structs_FIX.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
   </ItemGroup>\r
similarity index 83%
rename from silk/fixed/SKP_Silk_main_FIX.h
rename to silk/fixed/silk_main_FIX.h
index b65c78f..cc3be26 100644 (file)
@@ -25,15 +25,15 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#ifndef SKP_SILK_MAIN_FIX_H\r
-#define SKP_SILK_MAIN_FIX_H\r
-\r
-#include "SKP_Silk_SigProc_FIX.h"\r
-#include "SKP_Silk_structs_FIX.h"\r
-#include "SKP_Silk_control.h"\r
-#include "SKP_Silk_main.h"\r
-#include "SKP_Silk_PLC.h"\r
-#include "SKP_debug.h"\r
+#ifndef SILK_MAIN_FIX_H\r
+#define SILK_MAIN_FIX_H\r
+\r
+#include "silk_SigProc_FIX.h"\r
+#include "silk_structs_FIX.h"\r
+#include "silk_control.h"\r
+#include "silk_main.h"\r
+#include "silk_PLC.h"\r
+#include "silk_debug.h"\r
 #include "entenc.h"\r
 \r
 #ifndef FORCE_CPP_BUILD\r
@@ -43,33 +43,42 @@ extern "C"
 #endif\r
 #endif\r
 \r
+#define silk_encoder_state_Fxx      silk_encoder_state_FIX\r
+#define silk_encode_frame_Fxx       silk_encode_frame_FIX\r
+\r
 /*********************/\r
 /* Encoder Functions */\r
 /*********************/\r
 \r
+/* High-pass filter with cutoff frequency adaptation based on pitch lag statistics */\r
+void silk_HP_variable_cutoff(\r
+    silk_encoder_state_Fxx          state_Fxx[],    /* I/O  Encoder states                              */\r
+    const SKP_int                   nChannels       /* I    Number of channels                          */\r
+);\r
+\r
 /* Encoder main function */\r
-SKP_int SKP_Silk_encode_frame_FIX( \r
-    SKP_Silk_encoder_state_FIX      *psEnc,             /* I/O  Pointer to Silk FIX encoder state       */\r
+SKP_int silk_encode_frame_FIX( \r
+    silk_encoder_state_FIX          *psEnc,             /* I/O  Pointer to Silk FIX encoder state       */\r
     SKP_int32                       *pnBytesOut,        /*   O  Pointer to number of payload bytes;     */\r
     ec_enc                          *psRangeEnc         /* I/O  compressor data structure               */\r
 );\r
 \r
 /* Low Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode with lower bitrate           */\r
-void SKP_Silk_LBRR_encode_FIX(\r
-    SKP_Silk_encoder_state_FIX      *psEnc,             /* I/O  Pointer to Silk FIX encoder state           */\r
-    SKP_Silk_encoder_control_FIX    *psEncCtrl,         /* I/O  Pointer to Silk FIX encoder control struct  */\r
+void silk_LBRR_encode_FIX(\r
+    silk_encoder_state_FIX          *psEnc,             /* I/O  Pointer to Silk FIX encoder state           */\r
+    silk_encoder_control_FIX        *psEncCtrl,         /* I/O  Pointer to Silk FIX encoder control struct  */\r
     const SKP_int16                 xfw[]               /* I    Input signal                                */\r
 );\r
 \r
 /* Initializes the Silk encoder state */\r
-SKP_int SKP_Silk_init_encoder(\r
-    SKP_Silk_encoder_state_FIX      *psEnc              /* I/O  Pointer to Silk FIX encoder state           */\r
+SKP_int silk_init_encoder(\r
+    silk_encoder_state_FIX          *psEnc              /* I/O  Pointer to Silk FIX encoder state           */\r
 );\r
 \r
 /* Control the Silk encoder */\r
-SKP_int SKP_Silk_control_encoder( \r
-    SKP_Silk_encoder_state_FIX      *psEnc,             /* I/O  Pointer to Silk encoder state           */\r
-    SKP_SILK_SDK_EncControlStruct   *encControl,        /* I:   Control structure                       */\r
+SKP_int silk_control_encoder( \r
+    silk_encoder_state_FIX          *psEnc,             /* I/O  Pointer to Silk encoder state           */\r
+    silk_EncControlStruct           *encControl,        /* I:   Control structure                       */\r
     const SKP_int32                 TargetRate_bps,     /* I    Target max bitrate (bps)                */\r
     const SKP_int                   allow_bw_switch,    /* I    Flag to allow switching audio bandwidth */\r
     const SKP_int                   channelNb           /* I    Channel number                          */\r
@@ -78,9 +87,9 @@ SKP_int SKP_Silk_control_encoder(
 /****************/\r
 /* Prefiltering */\r
 /****************/\r
-void SKP_Silk_prefilter_FIX(\r
-    SKP_Silk_encoder_state_FIX          *psEnc,         /* I/O  Encoder state                               */\r
-    const SKP_Silk_encoder_control_FIX  *psEncCtrl,     /* I    Encoder control                             */\r
+void silk_prefilter_FIX(\r
+    silk_encoder_state_FIX              *psEnc,         /* I/O  Encoder state                               */\r
+    const silk_encoder_control_FIX      *psEncCtrl,     /* I    Encoder control                             */\r
     SKP_int16                           xw[],           /* O    Weighted signal                             */\r
     const SKP_int16                     x[]             /* I    Speech signal                               */\r
 );\r
@@ -89,15 +98,15 @@ void SKP_Silk_prefilter_FIX(
 /* Noise shaping analysis */\r
 /**************************/\r
 /* Compute noise shaping coefficients and initial gain values */\r
-void SKP_Silk_noise_shape_analysis_FIX(\r
-    SKP_Silk_encoder_state_FIX      *psEnc,         /* I/O  Encoder state FIX                           */\r
-    SKP_Silk_encoder_control_FIX    *psEncCtrl,     /* I/O  Encoder control FIX                         */\r
+void silk_noise_shape_analysis_FIX(\r
+    silk_encoder_state_FIX          *psEnc,         /* I/O  Encoder state FIX                           */\r
+    silk_encoder_control_FIX        *psEncCtrl,     /* I/O  Encoder control FIX                         */\r
     const SKP_int16                 *pitch_res,     /* I    LPC residual from pitch analysis            */\r
     const SKP_int16                 *x              /* I    Input signal [ frame_length + la_shape ]    */\r
 );\r
 \r
 /* Autocorrelations for a warped frequency axis */\r
-void SKP_Silk_warped_autocorrelation_FIX(\r
+void silk_warped_autocorrelation_FIX(\r
           SKP_int32                 *corr,              /* O    Result [order + 1]                      */\r
           SKP_int                   *scale,             /* O    Scaling of the correlation vector       */\r
     const SKP_int16                 *input,             /* I    Input data to correlate                 */\r
@@ -107,32 +116,32 @@ void SKP_Silk_warped_autocorrelation_FIX(
 );\r
 \r
 /* Calculation of LTP state scaling */\r
-void SKP_Silk_LTP_scale_ctrl_FIX(\r
-    SKP_Silk_encoder_state_FIX      *psEnc,         /* I/O  encoder state                               */\r
-    SKP_Silk_encoder_control_FIX    *psEncCtrl      /* I/O  encoder control                             */\r
+void silk_LTP_scale_ctrl_FIX(\r
+    silk_encoder_state_FIX          *psEnc,         /* I/O  encoder state                               */\r
+    silk_encoder_control_FIX        *psEncCtrl      /* I/O  encoder control                             */\r
 );\r
 \r
 /**********************************************/\r
 /* Prediction Analysis                        */\r
 /**********************************************/\r
 /* Find pitch lags */\r
-void SKP_Silk_find_pitch_lags_FIX(\r
-    SKP_Silk_encoder_state_FIX      *psEnc,         /* I/O  encoder state                               */\r
-    SKP_Silk_encoder_control_FIX    *psEncCtrl,     /* I/O  encoder control                             */\r
+void silk_find_pitch_lags_FIX(\r
+    silk_encoder_state_FIX          *psEnc,         /* I/O  encoder state                               */\r
+    silk_encoder_control_FIX        *psEncCtrl,     /* I/O  encoder control                             */\r
     SKP_int16                       res[],          /* O    residual                                    */\r
     const SKP_int16                 x[]             /* I    Speech signal                               */\r
 );\r
 \r
 /* Find LPC and LTP coefficients */\r
-void SKP_Silk_find_pred_coefs_FIX(\r
-    SKP_Silk_encoder_state_FIX      *psEnc,         /* I/O  encoder state                               */\r
-    SKP_Silk_encoder_control_FIX    *psEncCtrl,     /* I/O  encoder control                             */\r
+void silk_find_pred_coefs_FIX(\r
+    silk_encoder_state_FIX          *psEnc,         /* I/O  encoder state                               */\r
+    silk_encoder_control_FIX        *psEncCtrl,     /* I/O  encoder control                             */\r
     const SKP_int16                 res_pitch[],    /* I    Residual from pitch analysis                */\r
     const SKP_int16                 x[]             /* I    Speech signal                               */\r
 );\r
 \r
 /* LPC analysis */\r
-void SKP_Silk_find_LPC_FIX(\r
+void silk_find_LPC_FIX(\r
     SKP_int16                       NLSF_Q15[],             /* O    NLSFs                                                           */\r
     SKP_int8                        *interpIndex,           /* O    NLSF interpolation index, only used for NLSF interpolation      */\r
     const SKP_int16                 prev_NLSFq_Q15[],       /* I    previous NLSFs, only used for NLSF interpolation                */\r
@@ -145,7 +154,7 @@ void SKP_Silk_find_LPC_FIX(
 );\r
 \r
 /* LTP analysis */\r
-void SKP_Silk_find_LTP_FIX(\r
+void silk_find_LTP_FIX(\r
     SKP_int16           b_Q14[ MAX_NB_SUBFR * LTP_ORDER ],              /* O    LTP coefs                                                   */\r
     SKP_int32           WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ],   /* O    Weight for LTP quantization                                 */\r
     SKP_int             *LTPredCodGain_Q7,                              /* O    LTP coding gain                                             */\r
@@ -158,7 +167,7 @@ void SKP_Silk_find_LTP_FIX(
     SKP_int             corr_rshifts[ MAX_NB_SUBFR ]                    /* O    right shifts applied to correlations                        */\r
 );\r
 \r
-void SKP_Silk_LTP_analysis_filter_FIX(\r
+void silk_LTP_analysis_filter_FIX(\r
     SKP_int16           *LTP_res,                               /* O:   LTP residual signal of length MAX_NB_SUBFR * ( pre_length + subfr_length )  */\r
     const SKP_int16     *x,                                     /* I:   Pointer to input signal with at least max( pitchL ) preceeding samples      */\r
     const SKP_int16     LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ],/* I:   LTP_ORDER LTP coefficients for each MAX_NB_SUBFR subframe                   */\r
@@ -171,11 +180,11 @@ void SKP_Silk_LTP_analysis_filter_FIX(
 \r
 /* Calculates residual energies of input subframes where all subframes have LPC_order   */\r
 /* of preceeding samples                                                                */\r
-void SKP_Silk_residual_energy_FIX(\r
+void silk_residual_energy_FIX(\r
           SKP_int32 nrgs[ MAX_NB_SUBFR ],           /* O    Residual energy per subframe    */\r
           SKP_int   nrgsQ[ MAX_NB_SUBFR ],          /* O    Q value per subframe            */\r
     const SKP_int16 x[],                            /* I    Input signal                    */\r
-    const SKP_int16 a_Q12[ 2 ][ MAX_LPC_ORDER ],    /* I    AR coefs for each frame half    */\r
+          SKP_int16 a_Q12[ 2 ][ MAX_LPC_ORDER ],    /* I    AR coefs for each frame half    */\r
     const SKP_int32 gains[ MAX_NB_SUBFR ],          /* I    Quantization gains              */\r
     const SKP_int   subfr_length,                   /* I    Subframe length                 */\r
     const SKP_int   nb_subfr,                       /* I    Number of subframes             */\r
@@ -183,7 +192,7 @@ void SKP_Silk_residual_energy_FIX(
 );\r
 \r
 /* Residual energy: nrg = wxx - 2 * wXx * c + c' * wXX * c */\r
-SKP_int32 SKP_Silk_residual_energy16_covar_FIX(\r
+SKP_int32 silk_residual_energy16_covar_FIX(\r
     const SKP_int16                 *c,                 /* I    Prediction vector                           */\r
     const SKP_int32                 *wXX,               /* I    Correlation matrix                          */\r
     const SKP_int32                 *wXx,               /* I    Correlation vector                          */\r
@@ -193,16 +202,16 @@ SKP_int32 SKP_Silk_residual_energy16_covar_FIX(
 );\r
 \r
 /* Processing of gains */\r
-void SKP_Silk_process_gains_FIX(\r
-    SKP_Silk_encoder_state_FIX      *psEnc,         /* I/O  Encoder state                               */\r
-    SKP_Silk_encoder_control_FIX    *psEncCtrl      /* I/O  Encoder control                             */\r
+void silk_process_gains_FIX(\r
+    silk_encoder_state_FIX          *psEnc,         /* I/O  Encoder state                               */\r
+    silk_encoder_control_FIX        *psEncCtrl      /* I/O  Encoder control                             */\r
 );\r
 \r
 /******************/\r
 /* Linear Algebra */\r
 /******************/\r
 /* Calculates correlation matrix X'*X */\r
-void SKP_Silk_corrMatrix_FIX(\r
+void silk_corrMatrix_FIX(\r
     const SKP_int16                 *x,         /* I    x vector [L + order - 1] used to form data matrix X */\r
     const SKP_int                   L,          /* I    Length of vectors                                   */\r
     const SKP_int                   order,      /* I    Max lag for correlation                             */\r
@@ -212,7 +221,7 @@ void SKP_Silk_corrMatrix_FIX(
 );\r
 \r
 /* Calculates correlation vector X'*t */\r
-void SKP_Silk_corrVector_FIX(\r
+void silk_corrVector_FIX(\r
     const SKP_int16                 *x,         /* I    x vector [L + order - 1] used to form data matrix X */\r
     const SKP_int16                 *t,         /* I    Target vector [L]                                   */\r
     const SKP_int                   L,          /* I    Length of vectors                                   */\r
@@ -222,7 +231,7 @@ void SKP_Silk_corrVector_FIX(
 );\r
 \r
 /* Add noise to matrix diagonal */\r
-void SKP_Silk_regularize_correlations_FIX(\r
+void silk_regularize_correlations_FIX(\r
     SKP_int32                       *XX,                /* I/O  Correlation matrices                        */\r
     SKP_int32                       *xx,                /* I/O  Correlation values                          */\r
     SKP_int32                       noise,              /* I    Noise to add                                */\r
@@ -230,7 +239,7 @@ void SKP_Silk_regularize_correlations_FIX(
 );\r
 \r
 /* Solves Ax = b, assuming A is symmetric */\r
-void SKP_Silk_solve_LDL_FIX(\r
+void silk_solve_LDL_FIX(\r
     SKP_int32                       *A,                 /* I    Pointer to symetric square matrix A         */\r
     SKP_int                         M,                  /* I    Size of matrix                              */\r
     const SKP_int32                 *b,                 /* I    Pointer to b vector                         */\r
@@ -242,4 +251,4 @@ void SKP_Silk_solve_LDL_FIX(
 }\r
 #endif /* __cplusplus */\r
 #endif /* FORCE_CPP_BUILD */\r
-#endif /* SKP_SILK_MAIN_FIX_H */\r
+#endif /* SILK_MAIN_FIX_H */\r
similarity index 65%
rename from silk/fixed/SKP_Silk_noise_shape_analysis_FIX.c
rename to silk/fixed/silk_noise_shape_analysis_FIX.c
index b8d804c..ad23d3b 100644 (file)
@@ -25,8 +25,8 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FIX.h"\r
-#include "SKP_Silk_tuning_parameters.h"\r
+#include "silk_main_FIX.h"\r
+#include "silk_tuning_parameters.h"\r
 \r
 /* Compute gain to make warped filter coefficients have a zero mean log frequency response on a     */\r
 /* non-warped frequency scale. (So that it can be implemented with a minimum-phase monic filter.)   */\r
@@ -43,8 +43,8 @@ SKP_INLINE SKP_int32 warped_gain( // gain in Q16
     for( i = order - 2; i >= 0; i-- ) {\r
         gain_Q24 = SKP_SMLAWB( coefs_Q24[ i ], gain_Q24, lambda_Q16 );\r
     }\r
-    gain_Q24  = SKP_SMLAWB( SKP_FIX_CONST( 1.0, 24 ), gain_Q24, -lambda_Q16 );\r
-    return SKP_INVERSE32_varQ( gain_Q24, 40 );\r
+    gain_Q24  = SKP_SMLAWB( SILK_FIX_CONST( 1.0, 24 ), gain_Q24, -lambda_Q16 );\r
+    return silk_INVERSE32_varQ( gain_Q24, 40 );\r
 }\r
 \r
 /* Convert warped filter coefficients to monic pseudo-warped coefficients and limit maximum     */\r
@@ -67,11 +67,11 @@ SKP_INLINE void limit_warped_coefs(
         coefs_ana_Q24[ i - 1 ] = SKP_SMLAWB( coefs_ana_Q24[ i - 1 ], coefs_ana_Q24[ i ], lambda_Q16 );\r
     }\r
     lambda_Q16 = -lambda_Q16;\r
-    nom_Q16  = SKP_SMLAWB( SKP_FIX_CONST( 1.0, 16 ), -lambda_Q16,        lambda_Q16 );\r
-    den_Q24  = SKP_SMLAWB( SKP_FIX_CONST( 1.0, 24 ), coefs_syn_Q24[ 0 ], lambda_Q16 );\r
-    gain_syn_Q16 = SKP_DIV32_varQ( nom_Q16, den_Q24, 24 );\r
-    den_Q24  = SKP_SMLAWB( SKP_FIX_CONST( 1.0, 24 ), coefs_ana_Q24[ 0 ], lambda_Q16 );\r
-    gain_ana_Q16 = SKP_DIV32_varQ( nom_Q16, den_Q24, 24 );\r
+    nom_Q16  = SKP_SMLAWB( SILK_FIX_CONST( 1.0, 16 ), -lambda_Q16,        lambda_Q16 );\r
+    den_Q24  = SKP_SMLAWB( SILK_FIX_CONST( 1.0, 24 ), coefs_syn_Q24[ 0 ], lambda_Q16 );\r
+    gain_syn_Q16 = silk_DIV32_varQ( nom_Q16, den_Q24, 24 );\r
+    den_Q24  = SKP_SMLAWB( SILK_FIX_CONST( 1.0, 24 ), coefs_ana_Q24[ 0 ], lambda_Q16 );\r
+    gain_ana_Q16 = silk_DIV32_varQ( nom_Q16, den_Q24, 24 );\r
     for( i = 0; i < order; i++ ) {\r
         coefs_syn_Q24[ i ] = SKP_SMULWW( gain_syn_Q16, coefs_syn_Q24[ i ] );\r
         coefs_ana_Q24[ i ] = SKP_SMULWW( gain_ana_Q16, coefs_ana_Q24[ i ] );\r
@@ -97,19 +97,19 @@ SKP_INLINE void limit_warped_coefs(
             coefs_syn_Q24[ i - 1 ] = SKP_SMLAWB( coefs_syn_Q24[ i - 1 ], coefs_syn_Q24[ i ], lambda_Q16 );\r
             coefs_ana_Q24[ i - 1 ] = SKP_SMLAWB( coefs_ana_Q24[ i - 1 ], coefs_ana_Q24[ i ], lambda_Q16 );\r
         }\r
-        gain_syn_Q16 = SKP_INVERSE32_varQ( gain_syn_Q16, 32 );\r
-        gain_ana_Q16 = SKP_INVERSE32_varQ( gain_ana_Q16, 32 );\r
+        gain_syn_Q16 = silk_INVERSE32_varQ( gain_syn_Q16, 32 );\r
+        gain_ana_Q16 = silk_INVERSE32_varQ( gain_ana_Q16, 32 );\r
         for( i = 0; i < order; i++ ) {\r
             coefs_syn_Q24[ i ] = SKP_SMULWW( gain_syn_Q16, coefs_syn_Q24[ i ] );\r
             coefs_ana_Q24[ i ] = SKP_SMULWW( gain_ana_Q16, coefs_ana_Q24[ i ] );\r
         }\r
 \r
         /* Apply bandwidth expansion */\r
-        chirp_Q16 = SKP_FIX_CONST( 0.99, 16 ) - SKP_DIV32_varQ(\r
-            SKP_SMULWB( maxabs_Q24 - limit_Q24, SKP_SMLABB( SKP_FIX_CONST( 0.8, 10 ), SKP_FIX_CONST( 0.1, 10 ), iter ) ), \r
+        chirp_Q16 = SILK_FIX_CONST( 0.99, 16 ) - silk_DIV32_varQ(\r
+            SKP_SMULWB( maxabs_Q24 - limit_Q24, SKP_SMLABB( SILK_FIX_CONST( 0.8, 10 ), SILK_FIX_CONST( 0.1, 10 ), iter ) ), \r
             SKP_MUL( maxabs_Q24, ind + 1 ), 22 );\r
-        SKP_Silk_bwexpander_32( coefs_syn_Q24, order, chirp_Q16 );\r
-        SKP_Silk_bwexpander_32( coefs_ana_Q24, order, chirp_Q16 );\r
+        silk_bwexpander_32( coefs_syn_Q24, order, chirp_Q16 );\r
+        silk_bwexpander_32( coefs_ana_Q24, order, chirp_Q16 );\r
 \r
         /* Convert to monic warped coefficients */\r
         lambda_Q16 = -lambda_Q16;\r
@@ -118,11 +118,11 @@ SKP_INLINE void limit_warped_coefs(
             coefs_ana_Q24[ i - 1 ] = SKP_SMLAWB( coefs_ana_Q24[ i - 1 ], coefs_ana_Q24[ i ], lambda_Q16 );\r
         }\r
         lambda_Q16 = -lambda_Q16;\r
-        nom_Q16  = SKP_SMLAWB( SKP_FIX_CONST( 1.0, 16 ), -lambda_Q16,        lambda_Q16 );\r
-        den_Q24  = SKP_SMLAWB( SKP_FIX_CONST( 1.0, 24 ), coefs_syn_Q24[ 0 ], lambda_Q16 );\r
-        gain_syn_Q16 = SKP_DIV32_varQ( nom_Q16, den_Q24, 24 );\r
-        den_Q24  = SKP_SMLAWB( SKP_FIX_CONST( 1.0, 24 ), coefs_ana_Q24[ 0 ], lambda_Q16 );\r
-        gain_ana_Q16 = SKP_DIV32_varQ( nom_Q16, den_Q24, 24 );\r
+        nom_Q16  = SKP_SMLAWB( SILK_FIX_CONST( 1.0, 16 ), -lambda_Q16,        lambda_Q16 );\r
+        den_Q24  = SKP_SMLAWB( SILK_FIX_CONST( 1.0, 24 ), coefs_syn_Q24[ 0 ], lambda_Q16 );\r
+        gain_syn_Q16 = silk_DIV32_varQ( nom_Q16, den_Q24, 24 );\r
+        den_Q24  = SKP_SMLAWB( SILK_FIX_CONST( 1.0, 24 ), coefs_ana_Q24[ 0 ], lambda_Q16 );\r
+        gain_ana_Q16 = silk_DIV32_varQ( nom_Q16, den_Q24, 24 );\r
         for( i = 0; i < order; i++ ) {\r
             coefs_syn_Q24[ i ] = SKP_SMULWW( gain_syn_Q16, coefs_syn_Q24[ i ] );\r
             coefs_ana_Q24[ i ] = SKP_SMULWW( gain_ana_Q16, coefs_ana_Q24[ i ] );\r
@@ -134,14 +134,14 @@ SKP_INLINE void limit_warped_coefs(
 /**************************************************************/\r
 /* Compute noise shaping coefficients and initial gain values */\r
 /**************************************************************/\r
-void SKP_Silk_noise_shape_analysis_FIX(\r
-    SKP_Silk_encoder_state_FIX      *psEnc,         /* I/O  Encoder state FIX                           */\r
-    SKP_Silk_encoder_control_FIX    *psEncCtrl,     /* I/O  Encoder control FIX                         */\r
+void silk_noise_shape_analysis_FIX(\r
+    silk_encoder_state_FIX          *psEnc,         /* I/O  Encoder state FIX                           */\r
+    silk_encoder_control_FIX        *psEncCtrl,     /* I/O  Encoder control FIX                         */\r
     const SKP_int16                 *pitch_res,     /* I    LPC residual from pitch analysis            */\r
     const SKP_int16                 *x              /* I    Input signal [ frame_length + la_shape ]    */\r
 )\r
 {\r
-    SKP_Silk_shape_state_FIX *psShapeSt = &psEnc->sShape;\r
+    silk_shape_state_FIX *psShapeSt = &psEnc->sShape;\r
     SKP_int     k, i, nSamples, Qnrg, b_Q14, warping_Q16, scale = 0;\r
     SKP_int32   SNR_adj_dB_Q7, HarmBoost_Q16, HarmShapeGain_Q16, Tilt_Q16, tmp32;\r
     SKP_int32   nrg, pre_nrg_Q30, log_energy_Q7, log_energy_prev_Q7, energy_variation_Q7;\r
@@ -167,26 +167,26 @@ void SKP_Silk_noise_shape_analysis_FIX(
         + psEnc->sCmn.input_quality_bands_Q15[ 1 ], 2 );\r
 \r
     /* Coding quality level, between 0.0_Q0 and 1.0_Q0, but in Q14 */\r
-    psEncCtrl->coding_quality_Q14 = SKP_RSHIFT( SKP_Silk_sigm_Q15( SKP_RSHIFT_ROUND( SNR_adj_dB_Q7 - \r
-        SKP_FIX_CONST( 18.0, 7 ), 4 ) ), 1 );\r
+    psEncCtrl->coding_quality_Q14 = SKP_RSHIFT( silk_sigm_Q15( SKP_RSHIFT_ROUND( SNR_adj_dB_Q7 - \r
+        SILK_FIX_CONST( 18.0, 7 ), 4 ) ), 1 );\r
 \r
     /* Reduce coding SNR during low speech activity */\r
     if( psEnc->sCmn.useCBR == 0 ) {\r
-        b_Q8 = SKP_FIX_CONST( 1.0, 8 ) - psEnc->sCmn.speech_activity_Q8;\r
+        b_Q8 = SILK_FIX_CONST( 1.0, 8 ) - psEnc->sCmn.speech_activity_Q8;\r
         b_Q8 = SKP_SMULWB( SKP_LSHIFT( b_Q8, 8 ), b_Q8 );\r
         SNR_adj_dB_Q7 = SKP_SMLAWB( SNR_adj_dB_Q7,\r
-            SKP_SMULBB( SKP_FIX_CONST( -BG_SNR_DECR_dB, 7 ) >> ( 4 + 1 ), b_Q8 ),                                       // Q11\r
-            SKP_SMULWB( SKP_FIX_CONST( 1.0, 14 ) + psEncCtrl->input_quality_Q14, psEncCtrl->coding_quality_Q14 ) );     // Q12\r
+            SKP_SMULBB( SILK_FIX_CONST( -BG_SNR_DECR_dB, 7 ) >> ( 4 + 1 ), b_Q8 ),                                       // Q11\r
+            SKP_SMULWB( SILK_FIX_CONST( 1.0, 14 ) + psEncCtrl->input_quality_Q14, psEncCtrl->coding_quality_Q14 ) );     // Q12\r
     }\r
 \r
     if( psEnc->sCmn.indices.signalType == TYPE_VOICED ) {\r
         /* Reduce gains for periodic signals */\r
-        SNR_adj_dB_Q7 = SKP_SMLAWB( SNR_adj_dB_Q7, SKP_FIX_CONST( HARM_SNR_INCR_dB, 8 ), psEnc->LTPCorr_Q15 );\r
+        SNR_adj_dB_Q7 = SKP_SMLAWB( SNR_adj_dB_Q7, SILK_FIX_CONST( HARM_SNR_INCR_dB, 8 ), psEnc->LTPCorr_Q15 );\r
     } else { \r
         /* For unvoiced signals and low-quality input, adjust the quality slower than SNR_dB setting */\r
         SNR_adj_dB_Q7 = SKP_SMLAWB( SNR_adj_dB_Q7, \r
-            SKP_SMLAWB( SKP_FIX_CONST( 6.0, 9 ), -SKP_FIX_CONST( 0.4, 18 ), psEnc->sCmn.SNR_dB_Q7 ),\r
-            SKP_FIX_CONST( 1.0, 14 ) - psEncCtrl->input_quality_Q14 );\r
+            SKP_SMLAWB( SILK_FIX_CONST( 6.0, 9 ), -SILK_FIX_CONST( 0.4, 18 ), psEnc->sCmn.SNR_dB_Q7 ),\r
+            SILK_FIX_CONST( 1.0, 14 ) - psEncCtrl->input_quality_Q14 );\r
     }\r
 \r
     /*************************/\r
@@ -204,10 +204,10 @@ void SKP_Silk_noise_shape_analysis_FIX(
         log_energy_prev_Q7  = 0;\r
         pitch_res_ptr = pitch_res;\r
         for( k = 0; k < SKP_SMULBB( SUB_FRAME_LENGTH_MS, psEnc->sCmn.nb_subfr ) / 2; k++ ) {\r
-            SKP_Silk_sum_sqr_shift( &nrg, &scale, pitch_res_ptr, nSamples );\r
+            silk_sum_sqr_shift( &nrg, &scale, pitch_res_ptr, nSamples );\r
             nrg += SKP_RSHIFT( nSamples, scale );           // Q(-scale)\r
             \r
-            log_energy_Q7 = SKP_Silk_lin2log( nrg );\r
+            log_energy_Q7 = silk_lin2log( nrg );\r
             if( k > 0 ) {\r
                 energy_variation_Q7 += SKP_abs( log_energy_Q7 - log_energy_prev_Q7 );\r
             }\r
@@ -215,29 +215,29 @@ void SKP_Silk_noise_shape_analysis_FIX(
             pitch_res_ptr += nSamples;\r
         }\r
 \r
-        psEncCtrl->sparseness_Q8 = SKP_RSHIFT( SKP_Silk_sigm_Q15( SKP_SMULWB( energy_variation_Q7 - \r
-            SKP_FIX_CONST( 5.0, 7 ), SKP_FIX_CONST( 0.1, 16 ) ) ), 7 );\r
+        psEncCtrl->sparseness_Q8 = SKP_RSHIFT( silk_sigm_Q15( SKP_SMULWB( energy_variation_Q7 - \r
+            SILK_FIX_CONST( 5.0, 7 ), SILK_FIX_CONST( 0.1, 16 ) ) ), 7 );\r
 \r
         /* Set quantization offset depending on sparseness measure */\r
-        if( psEncCtrl->sparseness_Q8 > SKP_FIX_CONST( SPARSENESS_THRESHOLD_QNT_OFFSET, 8 ) ) {\r
+        if( psEncCtrl->sparseness_Q8 > SILK_FIX_CONST( SPARSENESS_THRESHOLD_QNT_OFFSET, 8 ) ) {\r
             psEnc->sCmn.indices.quantOffsetType = 0;\r
         } else {\r
             psEnc->sCmn.indices.quantOffsetType = 1;\r
         }\r
         \r
         /* Increase coding SNR for sparse signals */\r
-        SNR_adj_dB_Q7 = SKP_SMLAWB( SNR_adj_dB_Q7, SKP_FIX_CONST( SPARSE_SNR_INCR_dB, 15 ), psEncCtrl->sparseness_Q8 - SKP_FIX_CONST( 0.5, 8 ) );\r
+        SNR_adj_dB_Q7 = SKP_SMLAWB( SNR_adj_dB_Q7, SILK_FIX_CONST( SPARSE_SNR_INCR_dB, 15 ), psEncCtrl->sparseness_Q8 - SILK_FIX_CONST( 0.5, 8 ) );\r
     }\r
 \r
     /*******************************/\r
     /* Control bandwidth expansion */\r
     /*******************************/\r
     /* More BWE for signals with high prediction gain */\r
-    strength_Q16 = SKP_SMULWB( psEncCtrl->predGain_Q16, SKP_FIX_CONST( FIND_PITCH_WHITE_NOISE_FRACTION, 16 ) );\r
-    BWExp1_Q16 = BWExp2_Q16 = SKP_DIV32_varQ( SKP_FIX_CONST( BANDWIDTH_EXPANSION, 16 ), \r
-        SKP_SMLAWW( SKP_FIX_CONST( 1.0, 16 ), strength_Q16, strength_Q16 ), 16 );\r
-    delta_Q16  = SKP_SMULWB( SKP_FIX_CONST( 1.0, 16 ) - SKP_SMULBB( 3, psEncCtrl->coding_quality_Q14 ), \r
-        SKP_FIX_CONST( LOW_RATE_BANDWIDTH_EXPANSION_DELTA, 16 ) );\r
+    strength_Q16 = SKP_SMULWB( psEncCtrl->predGain_Q16, SILK_FIX_CONST( FIND_PITCH_WHITE_NOISE_FRACTION, 16 ) );\r
+    BWExp1_Q16 = BWExp2_Q16 = silk_DIV32_varQ( SILK_FIX_CONST( BANDWIDTH_EXPANSION, 16 ), \r
+        SKP_SMLAWW( SILK_FIX_CONST( 1.0, 16 ), strength_Q16, strength_Q16 ), 16 );\r
+    delta_Q16  = SKP_SMULWB( SILK_FIX_CONST( 1.0, 16 ) - SKP_SMULBB( 3, psEncCtrl->coding_quality_Q14 ), \r
+        SILK_FIX_CONST( LOW_RATE_BANDWIDTH_EXPANSION_DELTA, 16 ) );\r
     BWExp1_Q16 = SKP_SUB32( BWExp1_Q16, delta_Q16 );\r
     BWExp2_Q16 = SKP_ADD32( BWExp2_Q16, delta_Q16 );\r
     /* BWExp1 will be applied after BWExp2, so make it relative */\r
@@ -245,7 +245,7 @@ void SKP_Silk_noise_shape_analysis_FIX(
 \r
     if( psEnc->sCmn.warping_Q16 > 0 ) {\r
         /* Slightly more warping in analysis will move quantization noise up in frequency, where it's better masked */\r
-        warping_Q16 = SKP_SMLAWB( psEnc->sCmn.warping_Q16, psEncCtrl->coding_quality_Q14, SKP_FIX_CONST( 0.01, 18 ) );\r
+        warping_Q16 = SKP_SMLAWB( psEnc->sCmn.warping_Q16, psEncCtrl->coding_quality_Q14, SILK_FIX_CONST( 0.01, 18 ) );\r
     } else {\r
         warping_Q16 = 0;\r
     }\r
@@ -259,33 +259,33 @@ void SKP_Silk_noise_shape_analysis_FIX(
         flat_part = psEnc->sCmn.fs_kHz * 3;\r
         slope_part = SKP_RSHIFT( psEnc->sCmn.shapeWinLength - flat_part, 1 );\r
 \r
-        SKP_Silk_apply_sine_window( x_windowed, x_ptr, 1, slope_part );\r
+        silk_apply_sine_window( x_windowed, x_ptr, 1, slope_part );\r
         shift = slope_part;\r
         SKP_memcpy( x_windowed + shift, x_ptr + shift, flat_part * sizeof(SKP_int16) );\r
         shift += flat_part;\r
-        SKP_Silk_apply_sine_window( x_windowed + shift, x_ptr + shift, 2, slope_part );\r
+        silk_apply_sine_window( x_windowed + shift, x_ptr + shift, 2, slope_part );\r
 \r
         /* Update pointer: next LPC analysis block */\r
         x_ptr += psEnc->sCmn.subfr_length;\r
 \r
         if( psEnc->sCmn.warping_Q16 > 0 ) {\r
             /* Calculate warped auto correlation */\r
-            SKP_Silk_warped_autocorrelation_FIX( auto_corr, &scale, x_windowed, warping_Q16, psEnc->sCmn.shapeWinLength, psEnc->sCmn.shapingLPCOrder ); \r
+            silk_warped_autocorrelation_FIX( auto_corr, &scale, x_windowed, warping_Q16, psEnc->sCmn.shapeWinLength, psEnc->sCmn.shapingLPCOrder ); \r
         } else {\r
             /* Calculate regular auto correlation */\r
-            SKP_Silk_autocorr( auto_corr, &scale, x_windowed, psEnc->sCmn.shapeWinLength, psEnc->sCmn.shapingLPCOrder + 1 );\r
+            silk_autocorr( auto_corr, &scale, x_windowed, psEnc->sCmn.shapeWinLength, psEnc->sCmn.shapingLPCOrder + 1 );\r
         }\r
 \r
         /* Add white noise, as a fraction of energy */\r
         auto_corr[0] = SKP_ADD32( auto_corr[0], SKP_max_32( SKP_SMULWB( SKP_RSHIFT( auto_corr[ 0 ], 4 ), \r
-            SKP_FIX_CONST( SHAPE_WHITE_NOISE_FRACTION, 20 ) ), 1 ) ); \r
+            SILK_FIX_CONST( SHAPE_WHITE_NOISE_FRACTION, 20 ) ), 1 ) ); \r
 \r
         /* Calculate the reflection coefficients using schur */\r
-        nrg = SKP_Silk_schur64( refl_coef_Q16, auto_corr, psEnc->sCmn.shapingLPCOrder );\r
+        nrg = silk_schur64( refl_coef_Q16, auto_corr, psEnc->sCmn.shapingLPCOrder );\r
         SKP_assert( nrg >= 0 );\r
 \r
         /* Convert reflection coefficients to prediction coefficients */\r
-        SKP_Silk_k2a_Q16( AR2_Q24, refl_coef_Q16, psEnc->sCmn.shapingLPCOrder );\r
+        silk_k2a_Q16( AR2_Q24, refl_coef_Q16, psEnc->sCmn.shapingLPCOrder );\r
 \r
         Qnrg = -scale;          // range: -12...30\r
         SKP_assert( Qnrg >= -12 );\r
@@ -297,7 +297,7 @@ void SKP_Silk_noise_shape_analysis_FIX(
             nrg >>= 1;\r
         }\r
 \r
-        tmp32 = SKP_Silk_SQRT_APPROX( nrg );\r
+        tmp32 = silk_SQRT_APPROX( nrg );\r
         Qnrg >>= 1;             // range: -6...15\r
 \r
         sqrt_nrg[ k ] = tmp32;\r
@@ -312,25 +312,25 @@ void SKP_Silk_noise_shape_analysis_FIX(
         }\r
 \r
         /* Bandwidth expansion for synthesis filter shaping */\r
-        SKP_Silk_bwexpander_32( AR2_Q24, psEnc->sCmn.shapingLPCOrder, BWExp2_Q16 );\r
+        silk_bwexpander_32( AR2_Q24, psEnc->sCmn.shapingLPCOrder, BWExp2_Q16 );\r
 \r
         /* Compute noise shaping filter coefficients */\r
         SKP_memcpy( AR1_Q24, AR2_Q24, psEnc->sCmn.shapingLPCOrder * sizeof( SKP_int32 ) );\r
 \r
         /* Bandwidth expansion for analysis filter shaping */\r
-        SKP_assert( BWExp1_Q16 <= SKP_FIX_CONST( 1.0, 16 ) );\r
-        SKP_Silk_bwexpander_32( AR1_Q24, psEnc->sCmn.shapingLPCOrder, BWExp1_Q16 );\r
+        SKP_assert( BWExp1_Q16 <= SILK_FIX_CONST( 1.0, 16 ) );\r
+        silk_bwexpander_32( AR1_Q24, psEnc->sCmn.shapingLPCOrder, BWExp1_Q16 );\r
 \r
         /* Ratio of prediction gains, in energy domain */\r
-        SKP_Silk_LPC_inverse_pred_gain_Q24( &pre_nrg_Q30, AR2_Q24, psEnc->sCmn.shapingLPCOrder );\r
-        SKP_Silk_LPC_inverse_pred_gain_Q24( &nrg,         AR1_Q24, psEnc->sCmn.shapingLPCOrder );\r
+        silk_LPC_inverse_pred_gain_Q24( &pre_nrg_Q30, AR2_Q24, psEnc->sCmn.shapingLPCOrder );\r
+        silk_LPC_inverse_pred_gain_Q24( &nrg,         AR1_Q24, psEnc->sCmn.shapingLPCOrder );\r
 \r
         //psEncCtrl->GainsPre[ k ] = 1.0f - 0.7f * ( 1.0f - pre_nrg / nrg ) = 0.3f + 0.7f * pre_nrg / nrg;\r
-        pre_nrg_Q30 = SKP_LSHIFT32( SKP_SMULWB( pre_nrg_Q30, SKP_FIX_CONST( 0.7, 15 ) ), 1 );\r
-        psEncCtrl->GainsPre_Q14[ k ] = ( SKP_int ) SKP_FIX_CONST( 0.3, 14 ) + SKP_DIV32_varQ( pre_nrg_Q30, nrg, 14 );\r
+        pre_nrg_Q30 = SKP_LSHIFT32( SKP_SMULWB( pre_nrg_Q30, SILK_FIX_CONST( 0.7, 15 ) ), 1 );\r
+        psEncCtrl->GainsPre_Q14[ k ] = ( SKP_int ) SILK_FIX_CONST( 0.3, 14 ) + silk_DIV32_varQ( pre_nrg_Q30, nrg, 14 );\r
 \r
         /* Convert to monic warped prediction coefficients and limit absolute values */\r
-        limit_warped_coefs( AR2_Q24, AR1_Q24, warping_Q16, SKP_FIX_CONST( 3.999, 24 ), psEnc->sCmn.shapingLPCOrder );\r
+        limit_warped_coefs( AR2_Q24, AR1_Q24, warping_Q16, SILK_FIX_CONST( 3.999, 24 ), psEnc->sCmn.shapingLPCOrder );\r
 \r
         /* Convert from Q24 to Q13 and store in int16 */\r
         for( i = 0; i < psEnc->sCmn.shapingLPCOrder; i++ ) {\r
@@ -343,8 +343,8 @@ void SKP_Silk_noise_shape_analysis_FIX(
     /* Gain tweaking */\r
     /*****************/\r
     /* Increase gains during low speech activity and put lower limit on gains */\r
-    gain_mult_Q16 = SKP_Silk_log2lin( -SKP_SMLAWB( -SKP_FIX_CONST( 16.0, 7 ), SNR_adj_dB_Q7, SKP_FIX_CONST( 0.16, 16 ) ) );\r
-    gain_add_Q16  = SKP_Silk_log2lin(  SKP_SMLAWB(  SKP_FIX_CONST( 16.0, 7 ), SKP_FIX_CONST( MIN_QGAIN_DB, 7 ), SKP_FIX_CONST( 0.16, 16 ) ) );\r
+    gain_mult_Q16 = silk_log2lin( -SKP_SMLAWB( -SILK_FIX_CONST( 16.0, 7 ), SNR_adj_dB_Q7, SILK_FIX_CONST( 0.16, 16 ) ) );\r
+    gain_add_Q16  = silk_log2lin(  SKP_SMLAWB(  SILK_FIX_CONST( 16.0, 7 ), SILK_FIX_CONST( MIN_QGAIN_DB, 7 ), SILK_FIX_CONST( 0.16, 16 ) ) );\r
     SKP_assert( gain_mult_Q16 > 0 );\r
     for( k = 0; k < psEnc->sCmn.nb_subfr; k++ ) {\r
         psEncCtrl->Gains_Q16[ k ] = SKP_SMULWW( psEncCtrl->Gains_Q16[ k ], gain_mult_Q16 );\r
@@ -352,8 +352,8 @@ void SKP_Silk_noise_shape_analysis_FIX(
         psEncCtrl->Gains_Q16[ k ] = SKP_ADD_POS_SAT32( psEncCtrl->Gains_Q16[ k ], gain_add_Q16 );\r
     }\r
 \r
-    gain_mult_Q16 = SKP_FIX_CONST( 1.0, 16 ) + SKP_RSHIFT_ROUND( SKP_MLA( SKP_FIX_CONST( INPUT_TILT, 26 ), \r
-        psEncCtrl->coding_quality_Q14, SKP_FIX_CONST( HIGH_RATE_INPUT_TILT, 12 ) ), 10 );\r
+    gain_mult_Q16 = SILK_FIX_CONST( 1.0, 16 ) + SKP_RSHIFT_ROUND( SKP_MLA( SILK_FIX_CONST( INPUT_TILT, 26 ), \r
+        psEncCtrl->coding_quality_Q14, SILK_FIX_CONST( HIGH_RATE_INPUT_TILT, 12 ) ), 10 );\r
     for( k = 0; k < psEnc->sCmn.nb_subfr; k++ ) {\r
         psEncCtrl->GainsPre_Q14[ k ] = SKP_SMULWB( gain_mult_Q16, psEncCtrl->GainsPre_Q14[ k ] );\r
     }\r
@@ -362,55 +362,55 @@ void SKP_Silk_noise_shape_analysis_FIX(
     /* Control low-frequency shaping and noise tilt */\r
     /************************************************/\r
     /* Less low frequency shaping for noisy inputs */\r
-    strength_Q16 = SKP_MUL( SKP_FIX_CONST( LOW_FREQ_SHAPING, 4 ), SKP_SMLAWB( SKP_FIX_CONST( 1.0, 12 ),\r
-        SKP_FIX_CONST( LOW_QUALITY_LOW_FREQ_SHAPING_DECR, 13 ), psEnc->sCmn.input_quality_bands_Q15[ 0 ] - SKP_FIX_CONST( 1.0, 15 ) ) );\r
+    strength_Q16 = SKP_MUL( SILK_FIX_CONST( LOW_FREQ_SHAPING, 4 ), SKP_SMLAWB( SILK_FIX_CONST( 1.0, 12 ),\r
+        SILK_FIX_CONST( LOW_QUALITY_LOW_FREQ_SHAPING_DECR, 13 ), psEnc->sCmn.input_quality_bands_Q15[ 0 ] - SILK_FIX_CONST( 1.0, 15 ) ) );\r
     strength_Q16 = SKP_RSHIFT( SKP_MUL( strength_Q16, psEnc->sCmn.speech_activity_Q8 ), 8 );\r
     if( psEnc->sCmn.indices.signalType == TYPE_VOICED ) {\r
         /* Reduce low frequencies quantization noise for periodic signals, depending on pitch lag */\r
         /*f = 400; freqz([1, -0.98 + 2e-4 * f], [1, -0.97 + 7e-4 * f], 2^12, Fs); axis([0, 1000, -10, 1])*/\r
-        SKP_int fs_kHz_inv = SKP_DIV32_16( SKP_FIX_CONST( 0.2, 14 ), psEnc->sCmn.fs_kHz );\r
+        SKP_int fs_kHz_inv = SKP_DIV32_16( SILK_FIX_CONST( 0.2, 14 ), psEnc->sCmn.fs_kHz );\r
         for( k = 0; k < psEnc->sCmn.nb_subfr; k++ ) {\r
-            b_Q14 = fs_kHz_inv + SKP_DIV32_16( SKP_FIX_CONST( 3.0, 14 ), psEncCtrl->pitchL[ k ] ); \r
+            b_Q14 = fs_kHz_inv + SKP_DIV32_16( SILK_FIX_CONST( 3.0, 14 ), psEncCtrl->pitchL[ k ] ); \r
             /* Pack two coefficients in one int32 */\r
-            psEncCtrl->LF_shp_Q14[ k ]  = SKP_LSHIFT( SKP_FIX_CONST( 1.0, 14 ) - b_Q14 - SKP_SMULWB( strength_Q16, b_Q14 ), 16 );\r
-            psEncCtrl->LF_shp_Q14[ k ] |= (SKP_uint16)( b_Q14 - SKP_FIX_CONST( 1.0, 14 ) );\r
+            psEncCtrl->LF_shp_Q14[ k ]  = SKP_LSHIFT( SILK_FIX_CONST( 1.0, 14 ) - b_Q14 - SKP_SMULWB( strength_Q16, b_Q14 ), 16 );\r
+            psEncCtrl->LF_shp_Q14[ k ] |= (SKP_uint16)( b_Q14 - SILK_FIX_CONST( 1.0, 14 ) );\r
         }\r
-        SKP_assert( SKP_FIX_CONST( HARM_HP_NOISE_COEF, 24 ) < SKP_FIX_CONST( 0.5, 24 ) ); // Guarantees that second argument to SMULWB() is within range of an SKP_int16\r
-        Tilt_Q16 = - SKP_FIX_CONST( HP_NOISE_COEF, 16 ) - \r
-            SKP_SMULWB( SKP_FIX_CONST( 1.0, 16 ) - SKP_FIX_CONST( HP_NOISE_COEF, 16 ), \r
-                SKP_SMULWB( SKP_FIX_CONST( HARM_HP_NOISE_COEF, 24 ), psEnc->sCmn.speech_activity_Q8 ) );\r
+        SKP_assert( SILK_FIX_CONST( HARM_HP_NOISE_COEF, 24 ) < SILK_FIX_CONST( 0.5, 24 ) ); // Guarantees that second argument to SMULWB() is within range of an SKP_int16\r
+        Tilt_Q16 = - SILK_FIX_CONST( HP_NOISE_COEF, 16 ) - \r
+            SKP_SMULWB( SILK_FIX_CONST( 1.0, 16 ) - SILK_FIX_CONST( HP_NOISE_COEF, 16 ), \r
+                SKP_SMULWB( SILK_FIX_CONST( HARM_HP_NOISE_COEF, 24 ), psEnc->sCmn.speech_activity_Q8 ) );\r
     } else {\r
         b_Q14 = SKP_DIV32_16( 21299, psEnc->sCmn.fs_kHz ); // 1.3_Q0 = 21299_Q14\r
         /* Pack two coefficients in one int32 */\r
-        psEncCtrl->LF_shp_Q14[ 0 ]  = SKP_LSHIFT( SKP_FIX_CONST( 1.0, 14 ) - b_Q14 - \r
-            SKP_SMULWB( strength_Q16, SKP_SMULWB( SKP_FIX_CONST( 0.6, 16 ), b_Q14 ) ), 16 );\r
-        psEncCtrl->LF_shp_Q14[ 0 ] |= (SKP_uint16)( b_Q14 - SKP_FIX_CONST( 1.0, 14 ) );\r
+        psEncCtrl->LF_shp_Q14[ 0 ]  = SKP_LSHIFT( SILK_FIX_CONST( 1.0, 14 ) - b_Q14 - \r
+            SKP_SMULWB( strength_Q16, SKP_SMULWB( SILK_FIX_CONST( 0.6, 16 ), b_Q14 ) ), 16 );\r
+        psEncCtrl->LF_shp_Q14[ 0 ] |= (SKP_uint16)( b_Q14 - SILK_FIX_CONST( 1.0, 14 ) );\r
         for( k = 1; k < psEnc->sCmn.nb_subfr; k++ ) {\r
             psEncCtrl->LF_shp_Q14[ k ] = psEncCtrl->LF_shp_Q14[ 0 ];\r
         }\r
-        Tilt_Q16 = -SKP_FIX_CONST( HP_NOISE_COEF, 16 );\r
+        Tilt_Q16 = -SILK_FIX_CONST( HP_NOISE_COEF, 16 );\r
     }\r
 \r
     /****************************/\r
     /* HARMONIC SHAPING CONTROL */\r
     /****************************/\r
     /* Control boosting of harmonic frequencies */\r
-    HarmBoost_Q16 = SKP_SMULWB( SKP_SMULWB( SKP_FIX_CONST( 1.0, 17 ) - SKP_LSHIFT( psEncCtrl->coding_quality_Q14, 3 ), \r
-        psEnc->LTPCorr_Q15 ), SKP_FIX_CONST( LOW_RATE_HARMONIC_BOOST, 16 ) );\r
+    HarmBoost_Q16 = SKP_SMULWB( SKP_SMULWB( SILK_FIX_CONST( 1.0, 17 ) - SKP_LSHIFT( psEncCtrl->coding_quality_Q14, 3 ), \r
+        psEnc->LTPCorr_Q15 ), SILK_FIX_CONST( LOW_RATE_HARMONIC_BOOST, 16 ) );\r
 \r
     /* More harmonic boost for noisy input signals */\r
     HarmBoost_Q16 = SKP_SMLAWB( HarmBoost_Q16, \r
-        SKP_FIX_CONST( 1.0, 16 ) - SKP_LSHIFT( psEncCtrl->input_quality_Q14, 2 ), SKP_FIX_CONST( LOW_INPUT_QUALITY_HARMONIC_BOOST, 16 ) );\r
+        SILK_FIX_CONST( 1.0, 16 ) - SKP_LSHIFT( psEncCtrl->input_quality_Q14, 2 ), SILK_FIX_CONST( LOW_INPUT_QUALITY_HARMONIC_BOOST, 16 ) );\r
 \r
     if( USE_HARM_SHAPING && psEnc->sCmn.indices.signalType == TYPE_VOICED ) {\r
         /* More harmonic noise shaping for high bitrates or noisy input */\r
-        HarmShapeGain_Q16 = SKP_SMLAWB( SKP_FIX_CONST( HARMONIC_SHAPING, 16 ), \r
-                SKP_FIX_CONST( 1.0, 16 ) - SKP_SMULWB( SKP_FIX_CONST( 1.0, 18 ) - SKP_LSHIFT( psEncCtrl->coding_quality_Q14, 4 ),\r
-                psEncCtrl->input_quality_Q14 ), SKP_FIX_CONST( HIGH_RATE_OR_LOW_QUALITY_HARMONIC_SHAPING, 16 ) );\r
+        HarmShapeGain_Q16 = SKP_SMLAWB( SILK_FIX_CONST( HARMONIC_SHAPING, 16 ), \r
+                SILK_FIX_CONST( 1.0, 16 ) - SKP_SMULWB( SILK_FIX_CONST( 1.0, 18 ) - SKP_LSHIFT( psEncCtrl->coding_quality_Q14, 4 ),\r
+                psEncCtrl->input_quality_Q14 ), SILK_FIX_CONST( HIGH_RATE_OR_LOW_QUALITY_HARMONIC_SHAPING, 16 ) );\r
 \r
         /* Less harmonic noise shaping for less periodic signals */\r
         HarmShapeGain_Q16 = SKP_SMULWB( SKP_LSHIFT( HarmShapeGain_Q16, 1 ), \r
-            SKP_Silk_SQRT_APPROX( SKP_LSHIFT( psEnc->LTPCorr_Q15, 15 ) ) );\r
+            silk_SQRT_APPROX( SKP_LSHIFT( psEnc->LTPCorr_Q15, 15 ) ) );\r
     } else {\r
         HarmShapeGain_Q16 = 0;\r
     }\r
@@ -420,11 +420,11 @@ void SKP_Silk_noise_shape_analysis_FIX(
     /*************************/\r
     for( k = 0; k < MAX_NB_SUBFR; k++ ) {\r
         psShapeSt->HarmBoost_smth_Q16 =\r
-            SKP_SMLAWB( psShapeSt->HarmBoost_smth_Q16,     HarmBoost_Q16     - psShapeSt->HarmBoost_smth_Q16,     SKP_FIX_CONST( SUBFR_SMTH_COEF, 16 ) );\r
+            SKP_SMLAWB( psShapeSt->HarmBoost_smth_Q16,     HarmBoost_Q16     - psShapeSt->HarmBoost_smth_Q16,     SILK_FIX_CONST( SUBFR_SMTH_COEF, 16 ) );\r
         psShapeSt->HarmShapeGain_smth_Q16 =\r
-            SKP_SMLAWB( psShapeSt->HarmShapeGain_smth_Q16, HarmShapeGain_Q16 - psShapeSt->HarmShapeGain_smth_Q16, SKP_FIX_CONST( SUBFR_SMTH_COEF, 16 ) );\r
+            SKP_SMLAWB( psShapeSt->HarmShapeGain_smth_Q16, HarmShapeGain_Q16 - psShapeSt->HarmShapeGain_smth_Q16, SILK_FIX_CONST( SUBFR_SMTH_COEF, 16 ) );\r
         psShapeSt->Tilt_smth_Q16 =\r
-            SKP_SMLAWB( psShapeSt->Tilt_smth_Q16,          Tilt_Q16          - psShapeSt->Tilt_smth_Q16,          SKP_FIX_CONST( SUBFR_SMTH_COEF, 16 ) );\r
+            SKP_SMLAWB( psShapeSt->Tilt_smth_Q16,          Tilt_Q16          - psShapeSt->Tilt_smth_Q16,          SILK_FIX_CONST( SUBFR_SMTH_COEF, 16 ) );\r
 \r
         psEncCtrl->HarmBoost_Q14[ k ]     = ( SKP_int )SKP_RSHIFT_ROUND( psShapeSt->HarmBoost_smth_Q16,     2 );\r
         psEncCtrl->HarmShapeGain_Q14[ k ] = ( SKP_int )SKP_RSHIFT_ROUND( psShapeSt->HarmShapeGain_smth_Q16, 2 );\r
similarity index 88%
rename from silk/fixed/SKP_Silk_prefilter_FIX.c
rename to silk/fixed/silk_prefilter_FIX.c
index 58be293..44e6034 100644 (file)
@@ -25,12 +25,12 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FIX.h"\r
-#include "SKP_Silk_tuning_parameters.h"\r
+#include "silk_main_FIX.h"\r
+#include "silk_tuning_parameters.h"\r
 \r
-/* SKP_Silk_prefilter. Prefilter for finding Quantizer input signal */\r
-SKP_INLINE void SKP_Silk_prefilt_FIX(\r
-    SKP_Silk_prefilter_state_FIX *P,                    /* I/O state                          */\r
+/* silk_prefilter. Prefilter for finding Quantizer input signal */\r
+SKP_INLINE void silk_prefilt_FIX(\r
+    silk_prefilter_state_FIX *P,                    /* I/O state                          */\r
     SKP_int32   st_res_Q12[],                           /* I short term residual signal       */\r
     SKP_int16   xw[],                                   /* O prefiltered signal               */\r
     SKP_int32   HarmShapeFIRPacked_Q12,                 /* I Harmonic shaping coeficients     */\r
@@ -40,7 +40,7 @@ SKP_INLINE void SKP_Silk_prefilt_FIX(
     SKP_int     length                                  /* I Length of signals                */\r
 );\r
 \r
-void SKP_Silk_warped_LPC_analysis_filter_FIX(\r
+void silk_warped_LPC_analysis_filter_FIX(\r
           SKP_int32                 state[],            /* I/O  State [order + 1]                       */\r
           SKP_int16                 res[],              /* O    Residual signal [length]                */\r
     const SKP_int16                 coef_Q13[],         /* I    Coefficients [order]                    */\r
@@ -81,14 +81,14 @@ void SKP_Silk_warped_LPC_analysis_filter_FIX(
     }\r
 }\r
 \r
-void SKP_Silk_prefilter_FIX(\r
-    SKP_Silk_encoder_state_FIX          *psEnc,         /* I/O  Encoder state FIX                           */\r
-    const SKP_Silk_encoder_control_FIX  *psEncCtrl,     /* I    Encoder control FIX                         */\r
+void silk_prefilter_FIX(\r
+    silk_encoder_state_FIX              *psEnc,         /* I/O  Encoder state FIX                           */\r
+    const silk_encoder_control_FIX      *psEncCtrl,     /* I    Encoder control FIX                         */\r
     SKP_int16                           xw[],           /* O    Weighted signal                             */\r
     const SKP_int16                     x[]             /* I    Speech signal                               */\r
 )\r
 {\r
-    SKP_Silk_prefilter_state_FIX *P = &psEnc->sPrefilt;\r
+    silk_prefilter_state_FIX *P = &psEnc->sPrefilt;\r
     SKP_int   j, k, lag;\r
     SKP_int32 tmp_32;\r
     const SKP_int16 *AR1_shp_Q13;\r
@@ -120,13 +120,13 @@ void SKP_Silk_prefilter_FIX(
         AR1_shp_Q13 = &psEncCtrl->AR1_Q13[   k * MAX_SHAPE_LPC_ORDER ];\r
 \r
         /* Short term FIR filtering*/\r
-        SKP_Silk_warped_LPC_analysis_filter_FIX( P->sAR_shp, st_res, AR1_shp_Q13, px, \r
+        silk_warped_LPC_analysis_filter_FIX( P->sAR_shp, st_res, AR1_shp_Q13, px, \r
             psEnc->sCmn.warping_Q16, psEnc->sCmn.subfr_length, psEnc->sCmn.shapingLPCOrder );\r
 \r
         /* reduce (mainly) low frequencies during harmonic emphasis */\r
         B_Q12[ 0 ] = SKP_RSHIFT_ROUND( psEncCtrl->GainsPre_Q14[ k ], 2 );\r
-        tmp_32 = SKP_SMLABB( SKP_FIX_CONST( INPUT_TILT, 26 ), psEncCtrl->HarmBoost_Q14[ k ], HarmShapeGain_Q12 );   /* Q26 */\r
-        tmp_32 = SKP_SMLABB( tmp_32, psEncCtrl->coding_quality_Q14, SKP_FIX_CONST( HIGH_RATE_INPUT_TILT, 12 ) );    /* Q26 */\r
+        tmp_32 = SKP_SMLABB( SILK_FIX_CONST( INPUT_TILT, 26 ), psEncCtrl->HarmBoost_Q14[ k ], HarmShapeGain_Q12 );   /* Q26 */\r
+        tmp_32 = SKP_SMLABB( tmp_32, psEncCtrl->coding_quality_Q14, SILK_FIX_CONST( HIGH_RATE_INPUT_TILT, 12 ) );    /* Q26 */\r
         tmp_32 = SKP_SMULWB( tmp_32, -psEncCtrl->GainsPre_Q14[ k ] );                                               /* Q24 */\r
         tmp_32 = SKP_RSHIFT_ROUND( tmp_32, 12 );                                                                    /* Q12 */\r
         B_Q12[ 1 ]= SKP_SAT16( tmp_32 );\r
@@ -137,7 +137,7 @@ void SKP_Silk_prefilter_FIX(
         }\r
         P->sHarmHP = st_res[ psEnc->sCmn.subfr_length - 1 ];\r
 \r
-        SKP_Silk_prefilt_FIX( P, x_filt_Q12, pxw, HarmShapeFIRPacked_Q12, Tilt_Q14, \r
+        silk_prefilt_FIX( P, x_filt_Q12, pxw, HarmShapeFIRPacked_Q12, Tilt_Q14, \r
             LF_shp_Q14, lag, psEnc->sCmn.subfr_length );\r
 \r
         px  += psEnc->sCmn.subfr_length;\r
@@ -147,9 +147,9 @@ void SKP_Silk_prefilter_FIX(
     P->lagPrev = psEncCtrl->pitchL[ MAX_NB_SUBFR - 1 ];\r
 }\r
 \r
-/* SKP_Silk_prefilter. Prefilter for finding Quantizer input signal                           */\r
-SKP_INLINE void SKP_Silk_prefilt_FIX(\r
-    SKP_Silk_prefilter_state_FIX *P,                    /* I/O state                          */\r
+/* silk_prefilter. Prefilter for finding Quantizer input signal                           */\r
+SKP_INLINE void silk_prefilt_FIX(\r
+    silk_prefilter_state_FIX *P,                    /* I/O state                          */\r
     SKP_int32   st_res_Q12[],                           /* I short term residual signal       */\r
     SKP_int16   xw[],                                   /* O prefiltered signal               */\r
     SKP_int32   HarmShapeFIRPacked_Q12,                 /* I Harmonic shaping coeficients     */\r
similarity index 67%
rename from silk/fixed/SKP_Silk_process_gains_FIX.c
rename to silk/fixed/silk_process_gains_FIX.c
index c11502b..b884129 100644 (file)
@@ -25,23 +25,23 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FIX.h"\r
-#include "SKP_Silk_tuning_parameters.h"\r
+#include "silk_main_FIX.h"\r
+#include "silk_tuning_parameters.h"\r
 \r
 /* Processing of gains */\r
-void SKP_Silk_process_gains_FIX(\r
-    SKP_Silk_encoder_state_FIX      *psEnc,         /* I/O  Encoder state_FIX                           */\r
-    SKP_Silk_encoder_control_FIX    *psEncCtrl      /* I/O  Encoder control_FIX                         */\r
+void silk_process_gains_FIX(\r
+    silk_encoder_state_FIX      *psEnc,         /* I/O  Encoder state_FIX                           */\r
+    silk_encoder_control_FIX    *psEncCtrl      /* I/O  Encoder control_FIX                         */\r
 )\r
 {\r
-    SKP_Silk_shape_state_FIX    *psShapeSt = &psEnc->sShape;\r
+    silk_shape_state_FIX    *psShapeSt = &psEnc->sShape;\r
     SKP_int     k;\r
     SKP_int32   s_Q16, InvMaxSqrVal_Q16, gain, gain_squared, ResNrg, ResNrgPart, quant_offset_Q10;\r
 \r
     /* Gain reduction when LTP coding gain is high */\r
     if( psEnc->sCmn.indices.signalType == TYPE_VOICED ) {\r
         /*s = -0.5f * SKP_sigmoid( 0.25f * ( psEncCtrl->LTPredCodGain - 12.0f ) ); */\r
-        s_Q16 = -SKP_Silk_sigm_Q15( SKP_RSHIFT_ROUND( psEncCtrl->LTPredCodGain_Q7 - SKP_FIX_CONST( 12.0, 7 ), 4 ) );\r
+        s_Q16 = -silk_sigm_Q15( SKP_RSHIFT_ROUND( psEncCtrl->LTPredCodGain_Q7 - SILK_FIX_CONST( 12.0, 7 ), 4 ) );\r
         for( k = 0; k < psEnc->sCmn.nb_subfr; k++ ) {\r
             psEncCtrl->Gains_Q16[ k ] = SKP_SMLAWB( psEncCtrl->Gains_Q16[ k ], psEncCtrl->Gains_Q16[ k ], s_Q16 );\r
         }\r
@@ -49,8 +49,8 @@ void SKP_Silk_process_gains_FIX(
 \r
     /* Limit the quantized signal */\r
     /* InvMaxSqrVal = pow( 2.0f, 0.33f * ( 21.0f - SNR_dB ) ) / subfr_length; */\r
-    InvMaxSqrVal_Q16 = SKP_DIV32_16( SKP_Silk_log2lin( \r
-        SKP_SMULWB( SKP_FIX_CONST( 21 + 16 / 0.33, 7 ) - psEnc->sCmn.SNR_dB_Q7, SKP_FIX_CONST( 0.33, 16 ) ) ), psEnc->sCmn.subfr_length );\r
+    InvMaxSqrVal_Q16 = SKP_DIV32_16( silk_log2lin( \r
+        SKP_SMULWB( SILK_FIX_CONST( 21 + 16 / 0.33, 7 ) - psEnc->sCmn.SNR_dB_Q7, SILK_FIX_CONST( 0.33, 16 ) ) ), psEnc->sCmn.subfr_length );\r
 \r
     for( k = 0; k < psEnc->sCmn.nb_subfr; k++ ) {\r
         /* Soft limit on ratio residual energy and squared gains */\r
@@ -71,23 +71,23 @@ void SKP_Silk_process_gains_FIX(
             /* recalculate with higher precision */\r
             gain_squared = SKP_SMLAWW( SKP_LSHIFT( ResNrgPart, 16 ), gain, gain );\r
             SKP_assert( gain_squared > 0 );\r
-            gain = SKP_Silk_SQRT_APPROX( gain_squared );                    /* Q8   */\r
+            gain = silk_SQRT_APPROX( gain_squared );                    /* Q8   */\r
             gain = SKP_min( gain, SKP_int32_MAX >> 8 );\r
             psEncCtrl->Gains_Q16[ k ] = SKP_LSHIFT_SAT32( gain, 8 );        /* Q16  */\r
         } else {\r
-            gain = SKP_Silk_SQRT_APPROX( gain_squared );                    /* Q0   */\r
+            gain = silk_SQRT_APPROX( gain_squared );                    /* Q0   */\r
             gain = SKP_min( gain, SKP_int32_MAX >> 16 );\r
             psEncCtrl->Gains_Q16[ k ] = SKP_LSHIFT_SAT32( gain, 16 );       /* Q16  */\r
         }\r
     }\r
 \r
     /* Noise shaping quantization */\r
-    SKP_Silk_gains_quant( psEnc->sCmn.indices.GainsIndices, psEncCtrl->Gains_Q16, \r
-        &psShapeSt->LastGainIndex, psEnc->sCmn.nFramesAnalyzed, psEnc->sCmn.nb_subfr );\r
+    silk_gains_quant( psEnc->sCmn.indices.GainsIndices, psEncCtrl->Gains_Q16, \r
+        &psShapeSt->LastGainIndex, psEnc->sCmn.nFramesEncoded, psEnc->sCmn.nb_subfr );\r
 \r
     /* Set quantizer offset for voiced signals. Larger offset when LTP coding gain is low or tilt is high (ie low-pass) */\r
     if( psEnc->sCmn.indices.signalType == TYPE_VOICED ) {\r
-        if( psEncCtrl->LTPredCodGain_Q7 + SKP_RSHIFT( psEnc->sCmn.input_tilt_Q15, 8 ) > SKP_FIX_CONST( 1.0, 7 ) ) {\r
+        if( psEncCtrl->LTPredCodGain_Q7 + SKP_RSHIFT( psEnc->sCmn.input_tilt_Q15, 8 ) > SILK_FIX_CONST( 1.0, 7 ) ) {\r
             psEnc->sCmn.indices.quantOffsetType = 0;\r
         } else {\r
             psEnc->sCmn.indices.quantOffsetType = 1;\r
@@ -95,14 +95,14 @@ void SKP_Silk_process_gains_FIX(
     }\r
 \r
     /* Quantizer boundary adjustment */\r
-    quant_offset_Q10 = SKP_Silk_Quantization_Offsets_Q10[ psEnc->sCmn.indices.signalType >> 1 ][ psEnc->sCmn.indices.quantOffsetType ];\r
-    psEncCtrl->Lambda_Q10 = SKP_FIX_CONST( LAMBDA_OFFSET, 10 )\r
-                          + SKP_SMULBB( SKP_FIX_CONST( LAMBDA_DELAYED_DECISIONS, 10 ), psEnc->sCmn.nStatesDelayedDecision )\r
-                          + SKP_SMULWB( SKP_FIX_CONST( LAMBDA_SPEECH_ACT,        18 ), psEnc->sCmn.speech_activity_Q8     )\r
-                          + SKP_SMULWB( SKP_FIX_CONST( LAMBDA_INPUT_QUALITY,     12 ), psEncCtrl->input_quality_Q14       )\r
-                          + SKP_SMULWB( SKP_FIX_CONST( LAMBDA_CODING_QUALITY,    12 ), psEncCtrl->coding_quality_Q14      )\r
-                          + SKP_SMULWB( SKP_FIX_CONST( LAMBDA_QUANT_OFFSET,      16 ), quant_offset_Q10                   );\r
+    quant_offset_Q10 = silk_Quantization_Offsets_Q10[ psEnc->sCmn.indices.signalType >> 1 ][ psEnc->sCmn.indices.quantOffsetType ];\r
+    psEncCtrl->Lambda_Q10 = SILK_FIX_CONST( LAMBDA_OFFSET, 10 )\r
+                          + SKP_SMULBB( SILK_FIX_CONST( LAMBDA_DELAYED_DECISIONS, 10 ), psEnc->sCmn.nStatesDelayedDecision )\r
+                          + SKP_SMULWB( SILK_FIX_CONST( LAMBDA_SPEECH_ACT,        18 ), psEnc->sCmn.speech_activity_Q8     )\r
+                          + SKP_SMULWB( SILK_FIX_CONST( LAMBDA_INPUT_QUALITY,     12 ), psEncCtrl->input_quality_Q14       )\r
+                          + SKP_SMULWB( SILK_FIX_CONST( LAMBDA_CODING_QUALITY,    12 ), psEncCtrl->coding_quality_Q14      )\r
+                          + SKP_SMULWB( SILK_FIX_CONST( LAMBDA_QUANT_OFFSET,      16 ), quant_offset_Q10                   );\r
 \r
     SKP_assert( psEncCtrl->Lambda_Q10 > 0 );\r
-    SKP_assert( psEncCtrl->Lambda_Q10 < SKP_FIX_CONST( 2, 10 ) );\r
+    SKP_assert( psEncCtrl->Lambda_Q10 < SILK_FIX_CONST( 2, 10 ) );\r
 }\r
@@ -25,10 +25,10 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FIX.h"\r
+#include "silk_main_FIX.h"\r
 \r
 /* Add noise to matrix diagonal */\r
-void SKP_Silk_regularize_correlations_FIX(\r
+void silk_regularize_correlations_FIX(\r
     SKP_int32                       *XX,                /* I/O  Correlation matrices                        */\r
     SKP_int32                       *xx,                /* I/O  Correlation values                          */\r
     SKP_int32                       noise,              /* I    Noise to add                                */\r
similarity index 92%
rename from silk/fixed/SKP_Silk_residual_energy16_FIX.c
rename to silk/fixed/silk_residual_energy16_FIX.c
index b559ce6..f651160 100644 (file)
@@ -25,10 +25,10 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FIX.h"\r
+#include "silk_main_FIX.h"\r
 \r
 /* Residual energy: nrg = wxx - 2 * wXx * c + c' * wXX * c */\r
-SKP_int32 SKP_Silk_residual_energy16_covar_FIX(\r
+SKP_int32 silk_residual_energy16_covar_FIX(\r
     const SKP_int16                 *c,                 /* I    Prediction vector                           */\r
     const SKP_int32                 *wXX,               /* I    Correlation matrix                          */\r
     const SKP_int32                 *wXx,               /* I    Correlation vector                          */\r
@@ -55,10 +55,10 @@ SKP_int32 SKP_Silk_residual_energy16_covar_FIX(
     for( i = 0; i < D; i++ ) {\r
         c_max = SKP_max_32( c_max, SKP_abs( ( SKP_int32 )c[ i ] ) );\r
     }\r
-    Qxtra = SKP_min_int( Qxtra, SKP_Silk_CLZ32( c_max ) - 17 );\r
+    Qxtra = SKP_min_int( Qxtra, silk_CLZ32( c_max ) - 17 );\r
 \r
     w_max = SKP_max_32( wXX[ 0 ], wXX[ D * D - 1 ] );\r
-    Qxtra = SKP_min_int( Qxtra, SKP_Silk_CLZ32( SKP_MUL( D, SKP_RSHIFT( SKP_SMULWB( w_max, c_max ), 4 ) ) ) - 5 );\r
+    Qxtra = SKP_min_int( Qxtra, silk_CLZ32( SKP_MUL( D, SKP_RSHIFT( SKP_SMULWB( w_max, c_max ), 4 ) ) ) - 5 );\r
     Qxtra = SKP_max_int( Qxtra, 0 );\r
     for( i = 0; i < D; i++ ) {\r
         cn[ i ] = SKP_LSHIFT( ( SKP_int )c[ i ], Qxtra );\r
similarity index 88%
rename from silk/fixed/SKP_Silk_residual_energy_FIX.c
rename to silk/fixed/silk_residual_energy_FIX.c
index 2fb531c..c161bb2 100644 (file)
@@ -25,15 +25,15 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FIX.h"\r
+#include "silk_main_FIX.h"\r
 \r
 /* Calculates residual energies of input subframes where all subframes have LPC_order   */\r
 /* of preceeding samples                                                                */\r
-void SKP_Silk_residual_energy_FIX(\r
+void silk_residual_energy_FIX(\r
           SKP_int32 nrgs[ MAX_NB_SUBFR ],           /* O    Residual energy per subframe    */\r
           SKP_int   nrgsQ[ MAX_NB_SUBFR ],          /* O    Q value per subframe            */\r
     const SKP_int16 x[],                            /* I    Input signal                    */\r
-    const SKP_int16 a_Q12[ 2 ][ MAX_LPC_ORDER ],    /* I    AR coefs for each frame half    */\r
+          SKP_int16 a_Q12[ 2 ][ MAX_LPC_ORDER ],    /* I    AR coefs for each frame half    */\r
     const SKP_int32 gains[ MAX_NB_SUBFR ],          /* I    Quantization gains              */\r
     const SKP_int   subfr_length,                   /* I    Subframe length                 */\r
     const SKP_int   nb_subfr,                       /* I    Number of subframes             */\r
@@ -51,13 +51,13 @@ void SKP_Silk_residual_energy_FIX(
     /* Filter input to create the LPC residual for each frame half, and measure subframe energies */\r
     for( i = 0; i < nb_subfr >> 1; i++ ) {\r
         /* Calculate half frame LPC residual signal including preceeding samples */\r
-        SKP_Silk_LPC_analysis_filter( LPC_res, x_ptr, a_Q12[ i ], ( MAX_NB_SUBFR >> 1 ) * offset, LPC_order );\r
+        silk_LPC_analysis_filter( LPC_res, x_ptr, a_Q12[ i ], ( MAX_NB_SUBFR >> 1 ) * offset, LPC_order );\r
 \r
         /* Point to first subframe of the just calculated LPC residual signal */\r
         LPC_res_ptr = LPC_res + LPC_order;\r
         for( j = 0; j < ( MAX_NB_SUBFR >> 1 ); j++ ) {\r
             /* Measure subframe energy */\r
-            SKP_Silk_sum_sqr_shift( &nrgs[ i * ( MAX_NB_SUBFR >> 1 ) + j ], &rshift, LPC_res_ptr, subfr_length ); \r
+            silk_sum_sqr_shift( &nrgs[ i * ( MAX_NB_SUBFR >> 1 ) + j ], &rshift, LPC_res_ptr, subfr_length ); \r
             \r
             /* Set Q values for the measured energy */\r
             nrgsQ[ i * ( MAX_NB_SUBFR >> 1 ) + j ] = -rshift;\r
@@ -72,8 +72,8 @@ void SKP_Silk_residual_energy_FIX(
     /* Apply the squared subframe gains */\r
     for( i = 0; i < nb_subfr; i++ ) {\r
         /* Fully upscale gains and energies */\r
-        lz1 = SKP_Silk_CLZ32( nrgs[  i ] ) - 1; \r
-        lz2 = SKP_Silk_CLZ32( gains[ i ] ) - 1; \r
+        lz1 = silk_CLZ32( nrgs[  i ] ) - 1; \r
+        lz2 = silk_CLZ32( gains[ i ] ) - 1; \r
         \r
         tmp32 = SKP_LSHIFT32( gains[ i ], lz2 );\r
 \r
similarity index 89%
rename from silk/fixed/SKP_Silk_solve_LS_FIX.c
rename to silk/fixed/silk_solve_LS_FIX.c
index 2568418..a287a29 100644 (file)
@@ -25,8 +25,8 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FIX.h"\r
-#include "SKP_Silk_tuning_parameters.h"\r
+#include "silk_main_FIX.h"\r
+#include "silk_tuning_parameters.h"\r
 \r
 /*****************************/\r
 /* Internal function headers */\r
@@ -38,7 +38,7 @@ typedef struct {
 } inv_D_t;\r
 \r
 /* Factorize square matrix A into LDL form */\r
-SKP_INLINE void SKP_Silk_LDL_factorize_FIX(\r
+SKP_INLINE void silk_LDL_factorize_FIX(\r
     SKP_int32           *A,         /* I/O Pointer to Symetric Square Matrix */\r
     SKP_int             M,          /* I   Size of Matrix */\r
     SKP_int32           *L_Q16,     /* I/O Pointer to Square Upper triangular Matrix */\r
@@ -46,7 +46,7 @@ SKP_INLINE void SKP_Silk_LDL_factorize_FIX(
 );\r
 \r
 /* Solve Lx = b, when L is lower triangular and has ones on the diagonal */\r
-SKP_INLINE void SKP_Silk_LS_SolveFirst_FIX(\r
+SKP_INLINE void silk_LS_SolveFirst_FIX(\r
     const SKP_int32     *L_Q16,     /* I Pointer to Lower Triangular Matrix */\r
     SKP_int             M,          /* I Dim of Matrix equation */\r
     const SKP_int32     *b,         /* I b Vector */\r
@@ -54,21 +54,21 @@ SKP_INLINE void SKP_Silk_LS_SolveFirst_FIX(
 );\r
 \r
 /* Solve L^t*x = b, where L is lower triangular with ones on the diagonal */\r
-SKP_INLINE void SKP_Silk_LS_SolveLast_FIX(\r
+SKP_INLINE void silk_LS_SolveLast_FIX(\r
     const SKP_int32     *L_Q16,     /* I Pointer to Lower Triangular Matrix */\r
     const SKP_int       M,          /* I Dim of Matrix equation */\r
     const SKP_int32     *b,         /* I b Vector */\r
     SKP_int32           *x_Q16      /* O x Vector */  \r
 );\r
 \r
-SKP_INLINE void SKP_Silk_LS_divide_Q16_FIX(\r
+SKP_INLINE void silk_LS_divide_Q16_FIX(\r
     SKP_int32           T[],    /* I/O Numenator vector */\r
     inv_D_t             *inv_D, /* I   1 / D vector     */\r
     SKP_int             M       /* I   dimension        */\r
 );\r
 \r
 /* Solves Ax = b, assuming A is symmetric */\r
-void SKP_Silk_solve_LDL_FIX(\r
+void silk_solve_LDL_FIX(\r
     SKP_int32                       *A,                 /* I    Pointer to symetric square matrix A         */\r
     SKP_int                         M,                  /* I    Size of matrix                              */\r
     const SKP_int32                 *b,                 /* I    Pointer to b vector                         */\r
@@ -85,27 +85,27 @@ void SKP_Silk_solve_LDL_FIX(
     Factorize A by LDL such that A = L*D*L',\r
     where L is lower triangular with ones on diagonal\r
     ****************************************************/\r
-    SKP_Silk_LDL_factorize_FIX( A, M, L_Q16, inv_D );\r
+    silk_LDL_factorize_FIX( A, M, L_Q16, inv_D );\r
         \r
     /****************************************************\r
     * substitute D*L'*x = Y. ie:\r
     L*D*L'*x = b => L*Y = b <=> Y = inv(L)*b\r
     ******************************************************/\r
-    SKP_Silk_LS_SolveFirst_FIX( L_Q16, M, b, Y );\r
+    silk_LS_SolveFirst_FIX( L_Q16, M, b, Y );\r
 \r
     /****************************************************\r
     D*L'*x = Y <=> L'*x = inv(D)*Y, because D is \r
     diagonal just multiply with 1/d_i\r
     ****************************************************/\r
-    SKP_Silk_LS_divide_Q16_FIX( Y, inv_D, M );\r
+    silk_LS_divide_Q16_FIX( Y, inv_D, M );\r
 \r
     /****************************************************\r
     x = inv(L') * inv(D) * Y\r
     *****************************************************/\r
-    SKP_Silk_LS_SolveLast_FIX( L_Q16, M, Y, x_Q16 );\r
+    silk_LS_SolveLast_FIX( L_Q16, M, Y, x_Q16 );\r
 }\r
 \r
-SKP_INLINE void SKP_Silk_LDL_factorize_FIX(\r
+SKP_INLINE void silk_LDL_factorize_FIX(\r
     SKP_int32           *A,         /* I   Pointer to Symetric Square Matrix */\r
     SKP_int             M,          /* I   Size of Matrix */\r
     SKP_int32           *L_Q16,     /* I/O Pointer to Square Upper triangular Matrix */\r
@@ -121,7 +121,7 @@ SKP_INLINE void SKP_Silk_LDL_factorize_FIX(
     SKP_assert( M <= MAX_MATRIX_SIZE );\r
 \r
     status = 1;\r
-    diag_min_value = SKP_max_32( SKP_SMMUL( SKP_ADD_SAT32( A[ 0 ], A[ SKP_SMULBB( M, M ) - 1 ] ), SKP_FIX_CONST( FIND_LTP_COND_FAC, 31 ) ), 1 << 9 );\r
+    diag_min_value = SKP_max_32( SKP_SMMUL( SKP_ADD_SAT32( A[ 0 ], A[ SKP_SMULBB( M, M ) - 1 ] ), SILK_FIX_CONST( FIND_LTP_COND_FAC, 31 ) ), 1 << 9 );\r
     for( loop_count = 0; loop_count < M && status == 1; loop_count++ ) {\r
         status = 0;\r
         for( j = 0; j < M; j++ ) {\r
@@ -145,7 +145,7 @@ SKP_INLINE void SKP_Silk_LDL_factorize_FIX(
             D_Q0[ j ] = tmp_32;                         /* always < max(Correlation) */\r
         \r
             /* two-step division */\r
-            one_div_diag_Q36 = SKP_INVERSE32_varQ( tmp_32, 36 );                    /* Q36 */\r
+            one_div_diag_Q36 = silk_INVERSE32_varQ( tmp_32, 36 );                    /* Q36 */\r
             one_div_diag_Q40 = SKP_LSHIFT( one_div_diag_Q36, 4 );                   /* Q40 */\r
             err = SKP_SUB32( 1 << 24, SKP_SMULWW( tmp_32, one_div_diag_Q40 ) );     /* Q24 */\r
             one_div_diag_Q48 = SKP_SMULWW( err, one_div_diag_Q40 );                 /* Q48 */\r
@@ -177,7 +177,7 @@ SKP_INLINE void SKP_Silk_LDL_factorize_FIX(
     SKP_assert( status == 0 );\r
 }\r
 \r
-SKP_INLINE void SKP_Silk_LS_divide_Q16_FIX(\r
+SKP_INLINE void silk_LS_divide_Q16_FIX(\r
     SKP_int32 T[],      /* I/O Numenator vector */\r
     inv_D_t *inv_D,     /* I   1 / D vector     */\r
     SKP_int M           /* I   Order */\r
@@ -197,7 +197,7 @@ SKP_INLINE void SKP_Silk_LS_divide_Q16_FIX(
 }\r
 \r
 /* Solve Lx = b, when L is lower triangular and has ones on the diagonal */\r
-SKP_INLINE void SKP_Silk_LS_SolveFirst_FIX(\r
+SKP_INLINE void silk_LS_SolveFirst_FIX(\r
     const SKP_int32     *L_Q16, /* I Pointer to Lower Triangular Matrix */\r
     SKP_int             M,      /* I Dim of Matrix equation */\r
     const SKP_int32     *b,     /* I b Vector */\r
@@ -219,7 +219,7 @@ SKP_INLINE void SKP_Silk_LS_SolveFirst_FIX(
 }\r
 \r
 /* Solve L^t*x = b, where L is lower triangular with ones on the diagonal */\r
-SKP_INLINE void SKP_Silk_LS_SolveLast_FIX(\r
+SKP_INLINE void silk_LS_SolveLast_FIX(\r
     const SKP_int32     *L_Q16,     /* I Pointer to Lower Triangular Matrix */\r
     const SKP_int       M,          /* I Dim of Matrix equation */\r
     const SKP_int32     *b,         /* I b Vector */\r
similarity index 78%
rename from silk/fixed/SKP_Silk_structs_FIX.h
rename to silk/fixed/silk_structs_FIX.h
index f7e91d2..a479b52 100644 (file)
@@ -25,12 +25,12 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#ifndef SKP_SILK_STRUCTS_FIX_H\r
-#define SKP_SILK_STRUCTS_FIX_H\r
+#ifndef SILK_STRUCTS_FIX_H\r
+#define SILK_STRUCTS_FIX_H\r
 \r
-#include "SKP_Silk_typedef.h"\r
-#include "SKP_Silk_main.h"\r
-#include "SKP_Silk_structs.h"\r
+#include "silk_typedef.h"\r
+#include "silk_main.h"\r
+#include "silk_structs.h"\r
 \r
 #ifdef __cplusplus\r
 extern "C"\r
@@ -45,7 +45,7 @@ typedef struct {
     SKP_int32   HarmBoost_smth_Q16;\r
     SKP_int32   HarmShapeGain_smth_Q16;\r
     SKP_int32   Tilt_smth_Q16;\r
-} SKP_Silk_shape_state_FIX;\r
+} silk_shape_state_FIX;\r
 \r
 /********************************/\r
 /* Prefilter state              */\r
@@ -59,15 +59,15 @@ typedef struct {
     SKP_int     sHarmHP;\r
     SKP_int32   rand_seed;\r
     SKP_int     lagPrev;\r
-} SKP_Silk_prefilter_state_FIX;\r
+} silk_prefilter_state_FIX;\r
 \r
 /********************************/\r
 /* Encoder state FIX            */\r
 /********************************/\r
 typedef struct {\r
-    SKP_Silk_encoder_state          sCmn;                           /* Common struct, shared with floating-point code */\r
-    SKP_Silk_shape_state_FIX        sShape;                         /* Shape state                                                          */\r
-    SKP_Silk_prefilter_state_FIX    sPrefilt;                       /* Prefilter State                                                      */\r
+    silk_encoder_state          sCmn;                           /* Common struct, shared with floating-point code */\r
+    silk_shape_state_FIX        sShape;                         /* Shape state                                                          */\r
+    silk_prefilter_state_FIX    sPrefilt;                       /* Prefilter State                                                      */\r
 \r
     /* Buffer for find pitch and noise shape analysis */\r
     SKP_DWORD_ALIGN SKP_int16 x_buf[ 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ];\r
@@ -76,7 +76,7 @@ typedef struct {
     /* Parameters For LTP scaling Control */\r
     SKP_int                         prevLTPredCodGain_Q7;\r
     SKP_int                         HPLTPredCodGain_Q7;\r
-} SKP_Silk_encoder_state_FIX;\r
+} silk_encoder_state_FIX;\r
 \r
 /************************/\r
 /* Encoder control FIX  */\r
@@ -109,7 +109,19 @@ typedef struct {
     SKP_int32   ResNrg[ MAX_NB_SUBFR ];             /* Residual energy per subframe                             */\r
     SKP_int     ResNrgQ[ MAX_NB_SUBFR ];            /* Q domain for the residual energy > 0                     */\r
     \r
-} SKP_Silk_encoder_control_FIX;\r
+} silk_encoder_control_FIX;\r
+\r
+/************************/\r
+/* Encoder Super Struct */\r
+/************************/\r
+typedef struct {\r
+    silk_encoder_state_FIX          state_Fxx[ ENCODER_NUM_CHANNELS ];\r
+    stereo_enc_state                    sStereo;\r
+    SKP_int32                           nBitsExceeded;\r
+    SKP_int                             nChannels;\r
+    SKP_int                             timeSinceSwitchAllowed_ms;\r
+    SKP_int                             allowBandwidthSwitch;\r
+} silk_encoder;\r
 \r
 \r
 #ifdef __cplusplus\r
@@ -25,13 +25,13 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FIX.h"\r
+#include "silk_main_FIX.h"\r
 \r
 #define QC  10\r
 #define QS  14\r
 \r
 /* Autocorrelations for a warped frequency axis */\r
-void SKP_Silk_warped_autocorrelation_FIX(\r
+void silk_warped_autocorrelation_FIX(\r
           SKP_int32                 *corr,              /* O    Result [order + 1]                      */\r
           SKP_int                   *scale,             /* O    Scaling of the correlation vector       */\r
     const SKP_int16                 *input,             /* I    Input data to correlate                 */\r
@@ -67,7 +67,7 @@ void SKP_Silk_warped_autocorrelation_FIX(
         corr_QC[  order ] += SKP_RSHIFT64( SKP_SMULL( tmp1_QS, state_QS[ 0 ] ), 2 * QS - QC );\r
     }\r
 \r
-    lsh = SKP_Silk_CLZ64( corr_QC[ 0 ] ) - 35;\r
+    lsh = silk_CLZ64( corr_QC[ 0 ] ) - 35;\r
     lsh = SKP_LIMIT( lsh, -12 - QC, 30 - QC );\r
     *scale = -( QC + lsh ); \r
     SKP_assert( *scale >= -30 && *scale <= 12 );\r
similarity index 91%
rename from silk/float/SKP_Silk_LPC_analysis_filter_FLP.c
rename to silk/float/silk_LPC_analysis_filter_FLP.c
index e8d7d6b..b28196c 100644 (file)
@@ -26,7 +26,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 ***********************************************************************/\r
 \r
 #include <stdlib.h>\r
-#include "SKP_Silk_main_FLP.h"\r
+#include "silk_main_FLP.h"\r
 \r
 /*******************************************/\r
 /* LPC analysis filter                     */\r
@@ -36,7 +36,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 /*******************************************/\r
 \r
 /* 16th order LPC analysis filter, does not write first 16 samples */\r
-void SKP_Silk_LPC_analysis_filter16_FLP(\r
+void silk_LPC_analysis_filter16_FLP(\r
           SKP_float                 r_LPC[],            /* O    LPC residual signal                     */\r
     const SKP_float                 PredCoef[],         /* I    LPC coefficients                        */\r
     const SKP_float                 s[],                /* I    Input signal                            */\r
@@ -74,7 +74,7 @@ void SKP_Silk_LPC_analysis_filter16_FLP(
 }\r
 \r
 /* 14th order LPC analysis filter, does not write first 14 samples */\r
-void SKP_Silk_LPC_analysis_filter14_FLP(\r
+void silk_LPC_analysis_filter14_FLP(\r
           SKP_float                 r_LPC[],            /* O    LPC residual signal                     */\r
     const SKP_float                 PredCoef[],         /* I    LPC coefficients                        */\r
     const SKP_float                 s[],                /* I    Input signal                            */\r
@@ -110,7 +110,7 @@ void SKP_Silk_LPC_analysis_filter14_FLP(
 }\r
 \r
 /* 12th order LPC analysis filter, does not write first 12 samples */\r
-void SKP_Silk_LPC_analysis_filter12_FLP(\r
+void silk_LPC_analysis_filter12_FLP(\r
           SKP_float                 r_LPC[],            /* O    LPC residual signal                     */\r
     const SKP_float                 PredCoef[],         /* I    LPC coefficients                        */\r
     const SKP_float                 s[],                /* I    Input signal                            */\r
@@ -144,7 +144,7 @@ void SKP_Silk_LPC_analysis_filter12_FLP(
 }\r
 \r
 /* 10th order LPC analysis filter, does not write first 10 samples */\r
-void SKP_Silk_LPC_analysis_filter10_FLP(\r
+void silk_LPC_analysis_filter10_FLP(\r
           SKP_float                 r_LPC[],            /* O    LPC residual signal                     */\r
     const SKP_float                 PredCoef[],         /* I    LPC coefficients                        */\r
     const SKP_float                 s[],                /* I    Input signal                            */\r
@@ -176,7 +176,7 @@ void SKP_Silk_LPC_analysis_filter10_FLP(
 }\r
 \r
 /* 8th order LPC analysis filter, does not write first 8 samples */\r
-void SKP_Silk_LPC_analysis_filter8_FLP(\r
+void silk_LPC_analysis_filter8_FLP(\r
           SKP_float                 r_LPC[],            /* O    LPC residual signal                     */\r
     const SKP_float                 PredCoef[],         /* I    LPC coefficients                        */\r
     const SKP_float                 s[],                /* I    Input signal                            */\r
@@ -206,7 +206,7 @@ void SKP_Silk_LPC_analysis_filter8_FLP(
 }\r
 \r
 /* 6th order LPC analysis filter, does not write first 6 samples */\r
-void SKP_Silk_LPC_analysis_filter6_FLP(\r
+void silk_LPC_analysis_filter6_FLP(\r
           SKP_float                 r_LPC[],            /* O    LPC residual signal                     */\r
     const SKP_float                 PredCoef[],         /* I    LPC coefficients                        */\r
     const SKP_float                 s[],                /* I    Input signal                            */\r
@@ -240,7 +240,7 @@ void SKP_Silk_LPC_analysis_filter6_FLP(
 /* first Order output samples are not set  */\r
 /*******************************************/\r
 \r
-void SKP_Silk_LPC_analysis_filter_FLP(\r
+void silk_LPC_analysis_filter_FLP(\r
           SKP_float                 r_LPC[],            /* O    LPC residual signal                     */\r
     const SKP_float                 PredCoef[],         /* I    LPC coefficients                        */\r
     const SKP_float                 s[],                /* I    Input signal                            */\r
@@ -252,27 +252,27 @@ void SKP_Silk_LPC_analysis_filter_FLP(
 \r
     switch( Order ) {\r
         case 6:\r
-            SKP_Silk_LPC_analysis_filter6_FLP(  r_LPC, PredCoef, s, length );\r
+            silk_LPC_analysis_filter6_FLP(  r_LPC, PredCoef, s, length );\r
         break;\r
 \r
         case 8:\r
-            SKP_Silk_LPC_analysis_filter8_FLP(  r_LPC, PredCoef, s, length );\r
+            silk_LPC_analysis_filter8_FLP(  r_LPC, PredCoef, s, length );\r
         break;\r
 \r
         case 10:\r
-            SKP_Silk_LPC_analysis_filter10_FLP( r_LPC, PredCoef, s, length );\r
+            silk_LPC_analysis_filter10_FLP( r_LPC, PredCoef, s, length );\r
         break;\r
 \r
         case 12:\r
-            SKP_Silk_LPC_analysis_filter12_FLP( r_LPC, PredCoef, s, length );\r
+            silk_LPC_analysis_filter12_FLP( r_LPC, PredCoef, s, length );\r
         break;\r
 \r
         case 14:\r
-            SKP_Silk_LPC_analysis_filter14_FLP( r_LPC, PredCoef, s, length );\r
+            silk_LPC_analysis_filter14_FLP( r_LPC, PredCoef, s, length );\r
         break;\r
 \r
         case 16:\r
-            SKP_Silk_LPC_analysis_filter16_FLP( r_LPC, PredCoef, s, length );\r
+            silk_LPC_analysis_filter16_FLP( r_LPC, PredCoef, s, length );\r
         break;\r
 \r
         default:\r
similarity index 76%
rename from silk/float/SKP_Silk_LPC_inv_pred_gain_FLP.c
rename to silk/float/silk_LPC_inv_pred_gain_FLP.c
index 4b2f2f2..512ae5d 100644 (file)
@@ -25,23 +25,15 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-/*                                                                      *\r
- * SKP_Silk_LPC_inverse_pred_gain.c                                   *\r
- *                                                                      *\r
- * compute inverse of LPC prediction gain, and                          *\r
- * test if LPC coefficients are stable (all poles within unit circle)   *\r
- *                                                                      *\r
- * Copyright 2008 (c), Skype Limited                                    *\r
- *                                                                      */\r
-#include "SKP_Silk_SigProc_FIX.h"\r
-#include "SKP_Silk_SigProc_FLP.h"\r
+#include "silk_SigProc_FIX.h"\r
+#include "silk_SigProc_FLP.h"\r
 \r
 #define RC_THRESHOLD        0.9999f\r
 \r
 /* compute inverse of LPC prediction gain, and                          */\r
 /* test if LPC coefficients are stable (all poles within unit circle)   */\r
-/* this code is based on SKP_Silk_a2k_FLP()                               */\r
-SKP_int SKP_Silk_LPC_inverse_pred_gain_FLP(   /* O:   returns 1 if unstable, otherwise 0      */\r
+/* this code is based on silk_a2k_FLP()                               */\r
+SKP_int silk_LPC_inverse_pred_gain_FLP(   /* O:   returns 1 if unstable, otherwise 0      */\r
     SKP_float       *invGain,               /* O:   inverse prediction gain, energy domain  */\r
     const SKP_float *A,                     /* I:   prediction coefficients [order]         */\r
     SKP_int32       order                   /* I:   prediction order                        */\r
@@ -49,7 +41,7 @@ SKP_int SKP_Silk_LPC_inverse_pred_gain_FLP(   /* O:   returns 1 if unstable, oth
 {\r
     SKP_int   k, n;\r
     double    rc, rc_mult1, rc_mult2;\r
-    SKP_float Atmp[ 2 ][ SKP_Silk_MAX_ORDER_LPC ];\r
+    SKP_float Atmp[ 2 ][ SILK_MAX_ORDER_LPC ];\r
     SKP_float *Aold, *Anew;\r
 \r
     Anew = Atmp[ order & 1 ];\r
similarity index 96%
rename from silk/float/SKP_Silk_LTP_analysis_filter_FLP.c
rename to silk/float/silk_LTP_analysis_filter_FLP.c
index b27b08d..3bf6169 100644 (file)
@@ -25,9 +25,9 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FLP.h"\r
+#include "silk_main_FLP.h"\r
 \r
-void SKP_Silk_LTP_analysis_filter_FLP(\r
+void silk_LTP_analysis_filter_FLP(\r
           SKP_float         *LTP_res,                       /* O    LTP res MAX_NB_SUBFR*(pre_lgth+subfr_lngth) */\r
     const SKP_float         *x,                             /* I    Input signal, with preceeding samples       */\r
     const SKP_float         B[ LTP_ORDER * MAX_NB_SUBFR ],  /* I    LTP coefficients for each subframe          */\r
similarity index 83%
rename from silk/float/SKP_Silk_LTP_scale_ctrl_FLP.c
rename to silk/float/silk_LTP_scale_ctrl_FLP.c
index 4d9345d..437c524 100644 (file)
@@ -25,11 +25,11 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FLP.h"\r
+#include "silk_main_FLP.h"\r
 \r
-void SKP_Silk_LTP_scale_ctrl_FLP(\r
-    SKP_Silk_encoder_state_FLP      *psEnc,             /* I/O  Encoder state FLP                       */\r
-    SKP_Silk_encoder_control_FLP    *psEncCtrl          /* I/O  Encoder control FLP                     */\r
+void silk_LTP_scale_ctrl_FLP(\r
+    silk_encoder_state_FLP      *psEnc,             /* I/O  Encoder state FLP                       */\r
+    silk_encoder_control_FLP    *psEncCtrl          /* I/O  Encoder control FLP                     */\r
 )\r
 {\r
     SKP_int   round_loss;\r
@@ -41,12 +41,12 @@ void SKP_Silk_LTP_scale_ctrl_FLP(
     psEnc->prevLTPredCodGain = psEncCtrl->LTPredCodGain;\r
 \r
     /* Only scale if first frame in packet */\r
-    if( psEnc->sCmn.nFramesAnalyzed == 0 ) {\r
+    if( psEnc->sCmn.nFramesEncoded == 0 ) {\r
         round_loss = psEnc->sCmn.PacketLoss_perc + psEnc->sCmn.nFramesPerPacket;\r
         psEnc->sCmn.indices.LTP_scaleIndex = (SKP_int8)SKP_LIMIT( round_loss * psEnc->HPLTPredCodGain * 0.1f, 0.0f, 2.0f );\r
     } else {\r
         /* Default is minimum scaling */\r
         psEnc->sCmn.indices.LTP_scaleIndex = 0;\r
     }\r
-    psEncCtrl->LTP_scale = (SKP_float)SKP_Silk_LTPScales_table_Q14[ psEnc->sCmn.indices.LTP_scaleIndex ] / 16384.0f;\r
+    psEncCtrl->LTP_scale = (SKP_float)silk_LTPScales_table_Q14[ psEnc->sCmn.indices.LTP_scaleIndex ] / 16384.0f;\r
 }\r
similarity index 84%
rename from silk/float/SKP_Silk_SigProc_FLP.h
rename to silk/float/silk_SigProc_FLP.h
index 97067bd..b20bcfd 100644 (file)
@@ -25,12 +25,10 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
+#ifndef _SILK_SIGPROC_FLP_H_\r
+#define _SILK_SIGPROC_FLP_H_\r
 \r
-#ifndef _SKP_SILK_SIGPROC_FLP_H_\r
-#define _SKP_SILK_SIGPROC_FLP_H_\r
-\r
-#include "SKP_Silk_SigProc_FIX.h"\r
-#include "float_cast.h"\r
+#include "silk_SigProc_FIX.h"\r
 #include <math.h>\r
 \r
 #ifdef  __cplusplus\r
@@ -43,7 +41,7 @@ extern "C"
 /********************************************************************/\r
 \r
 /* Chirp (bw expand) LP AR filter */\r
-void SKP_Silk_bwexpander_FLP( \r
+void silk_bwexpander_FLP( \r
     SKP_float *ar,                     /* io   AR filter to be expanded (without leading 1)    */\r
     const SKP_int d,                   /* i    length of ar                                       */\r
     const SKP_float chirp              /* i    chirp factor (typically in range (0..1) )          */\r
@@ -51,34 +49,34 @@ void SKP_Silk_bwexpander_FLP(
 \r
 /* compute inverse of LPC prediction gain, and                                                 */\r
 /* test if LPC coefficients are stable (all poles within unit circle)  */\r
-/* this code is based on SKP_Silk_FLP_a2k()                                                            */\r
-SKP_int SKP_Silk_LPC_inverse_pred_gain_FLP( /* O:   returns 1 if unstable, otherwise 0    */\r
+/* this code is based on silk_FLP_a2k()                                                                    */\r
+SKP_int silk_LPC_inverse_pred_gain_FLP( /* O:   returns 1 if unstable, otherwise 0    */\r
     SKP_float            *invGain,      /* O:   inverse prediction gain, energy domain   */\r
     const SKP_float      *A,            /* I:   prediction coefficients [order]           */\r
     SKP_int32            order          /* I:   prediction order                          */\r
 );\r
 \r
-SKP_float SKP_Silk_schur_FLP(           /* O    returns residual energy                     */\r
+SKP_float silk_schur_FLP(               /* O    returns residual energy                     */\r
     SKP_float       refl_coef[],        /* O    reflection coefficients (length order)      */\r
     const SKP_float auto_corr[],        /* I    autocorrelation sequence (length order+1)   */\r
     SKP_int         order               /* I    order                                       */\r
 );\r
 \r
-void SKP_Silk_k2a_FLP(\r
+void silk_k2a_FLP(\r
     SKP_float           *A,             /* O:  prediction coefficients [order]           */\r
     const SKP_float     *rc,            /* I:  reflection coefficients [order]           */\r
     SKP_int32           order           /* I:  prediction order                          */\r
 );\r
 \r
 /* Solve the normal equations using the Levinson-Durbin recursion */\r
-SKP_float SKP_Silk_levinsondurbin_FLP( /* O    prediction error energy                                         */\r
+SKP_float silk_levinsondurbin_FLP(         /* O        prediction error energy                                         */\r
        SKP_float               A[],                            /* O    prediction coefficients [order]                         */\r
        const SKP_float corr[],                         /* I    input auto-correlations [order + 1]                     */\r
        const SKP_int   order                           /* I    prediction order                                                        */\r
 );\r
 \r
 /* compute autocorrelation */\r
-void SKP_Silk_autocorrelation_FLP( \r
+void silk_autocorrelation_FLP( \r
     SKP_float *results,                 /* o    result (length correlationCount)            */\r
     const SKP_float *inputData,         /* i    input data to correlate                     */\r
     SKP_int inputDataSize,              /* i    length of input                             */\r
@@ -90,7 +88,7 @@ void SKP_Silk_autocorrelation_FLP(
 #define SigProc_PE_MID_COMPLEX        1\r
 #define SigProc_PE_MAX_COMPLEX        2\r
 \r
-SKP_int SKP_Silk_pitch_analysis_core_FLP( /* O voicing estimate: 0 voiced, 1 unvoiced                       */\r
+SKP_int silk_pitch_analysis_core_FLP(   /* O voicing estimate: 0 voiced, 1 unvoiced                         */\r
     const SKP_float *signal,            /* I signal of length PE_FRAME_LENGTH_MS*Fs_kHz                     */\r
     SKP_int         *pitch_out,         /* O 4 pitch lag values                                             */\r
     SKP_int16       *lagIndex,          /* O lag Index                                                      */\r
@@ -106,15 +104,15 @@ SKP_int SKP_Silk_pitch_analysis_core_FLP( /* O voicing estimate: 0 voiced, 1 unv
 \r
 #define PI               (3.1415926536f)\r
 \r
-void SKP_Silk_insertion_sort_decreasing_FLP(\r
+void silk_insertion_sort_decreasing_FLP(\r
     SKP_float            *a,            /* I/O:  Unsorted / Sorted vector                */\r
-    SKP_int              *index,        /* O:    Index vector for the sorted elements    */\r
+    SKP_int              *idx,          /* O:    Index vector for the sorted elements    */\r
     const SKP_int        L,             /* I:    Vector length                           */\r
     const SKP_int        K              /* I:    Number of correctly sorted positions    */\r
 );\r
 \r
 /* Compute reflection coefficients from input signal */\r
-SKP_float SKP_Silk_burg_modified_FLP(       /* O    returns residual energy                                         */\r
+SKP_float silk_burg_modified_FLP(           /* O    returns residual energy                                         */\r
     SKP_float           A[],                /* O    prediction coefficients (length order)                          */\r
     const SKP_float     x[],                /* I    input signal, length: nb_subfr*(D+L_sub)                        */\r
     const SKP_int       subfr_length,       /* I    input signal subframe length (including D preceeding samples)   */\r
@@ -124,14 +122,14 @@ SKP_float SKP_Silk_burg_modified_FLP(       /* O    returns residual energy
 );\r
 \r
 /* multiply a vector by a constant */\r
-void SKP_Silk_scale_vector_FLP( \r
+void silk_scale_vector_FLP( \r
     SKP_float           *data1,\r
     SKP_float           gain, \r
     SKP_int             dataSize\r
 );\r
 \r
 /* copy and multiply a vector by a constant */\r
-void SKP_Silk_scale_copy_vector_FLP( \r
+void silk_scale_copy_vector_FLP( \r
     SKP_float           *data_out, \r
     const SKP_float     *data_in, \r
     SKP_float           gain, \r
@@ -139,14 +137,14 @@ void SKP_Silk_scale_copy_vector_FLP(
 );\r
 \r
 /* inner product of two SKP_float arrays, with result as double */\r
-double SKP_Silk_inner_product_FLP( \r
+double silk_inner_product_FLP( \r
     const SKP_float     *data1, \r
     const SKP_float     *data2, \r
     SKP_int             dataSize\r
 );\r
 \r
 /* sum of squares of a SKP_float array, with result as double */\r
-double SKP_Silk_energy_FLP( \r
+double silk_energy_FLP( \r
     const SKP_float     *data, \r
     SKP_int             dataSize\r
 );\r
@@ -169,16 +167,15 @@ SKP_INLINE SKP_float SKP_sigmoid(SKP_float x)
 }\r
 \r
 /* floating-point to integer conversion (rounding) */\r
-#if 1\r
-/* use implementation in float_cast.h */\r
-#define SKP_float2int(x)   float2int(x)\r
-#else\r
-SKP_INLINE SKP_int32 SKP_float2int(SKP_float x) \r
+SKP_INLINE SKP_int32 SKP_float2int(double x) \r
 {\r
-    double y = x;\r
-    return (SKP_int32)( ( y > 0 ) ? y + 0.5 : y - 0.5 );\r
-}\r
+#ifdef _WIN32\r
+       double t = x + 6755399441055744.0;\r
+       return *((SKP_int32 *)( &t ));\r
+#else\r
+       return (SKP_int32)( ( x > 0 ) ? x + 0.5 : x - 0.5 );\r
 #endif\r
+}\r
 \r
 /* floating-point to integer conversion (rounding) */\r
 SKP_INLINE void SKP_float2short_array(\r
@@ -189,7 +186,13 @@ SKP_INLINE void SKP_float2short_array(
 {\r
     SKP_int32 k;\r
     for (k = length-1; k >= 0; k--) {\r
-        out[k] = (SKP_int16)SKP_SAT16( float2int( in[k] ) );\r
+#ifdef _WIN32\r
+               double t = in[k] + 6755399441055744.0;\r
+               out[k] = (SKP_int16)SKP_SAT16(*(( SKP_int32 * )( &t )));\r
+#else\r
+               double x = in[k];\r
+               out[k] = (SKP_int16)SKP_SAT16( ( x > 0 ) ? x + 0.5 : x - 0.5 );\r
+#endif\r
     }\r
 }\r
 \r
@@ -206,7 +209,8 @@ SKP_INLINE void SKP_short2float_array(
     }\r
 }\r
 \r
-#define SKP_round(x)           (SKP_float)((x)>=0 ? (SKP_int64)((x)+0.5) : (SKP_int64)((x)-0.5))\r
+/* using log2() helps the fixed-point conversion */\r
+SKP_INLINE SKP_float silk_log2( double x ) { return ( SKP_float )( 3.32192809488736 * log10( x ) ); }\r
 \r
 #ifdef  __cplusplus\r
 }\r
similarity index 96%
rename from silk/float/SKP_Silk_apply_sine_window_FLP.c
rename to silk/float/silk_apply_sine_window_FLP.c
index 1db6b14..450be05 100644 (file)
@@ -25,13 +25,13 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FLP.h"\r
+#include "silk_main_FLP.h"\r
 \r
 /* Apply sine window to signal vector.                                                                  */\r
 /* Window types:                                                                                        */\r
 /*  1 -> sine window from 0 to pi/2                                                                     */\r
 /*  2 -> sine window from pi/2 to pi                                                                    */\r
-void SKP_Silk_apply_sine_window_FLP(\r
+void silk_apply_sine_window_FLP(\r
           SKP_float                 px_win[],           /* O    Pointer to windowed signal              */\r
     const SKP_float                 px[],               /* I    Pointer to input signal                 */\r
     const SKP_int                   win_type,           /* I    Selects a window type                   */\r
similarity index 90%
rename from silk/float/SKP_Silk_autocorrelation_FLP.c
rename to silk/float/silk_autocorrelation_FLP.c
index 2fa56b4..7cbf871 100644 (file)
@@ -25,11 +25,11 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_typedef.h"\r
-#include "SKP_Silk_SigProc_FLP.h"\r
+#include "silk_typedef.h"\r
+#include "silk_SigProc_FLP.h"\r
 \r
 /* compute autocorrelation */\r
-void SKP_Silk_autocorrelation_FLP( \r
+void silk_autocorrelation_FLP( \r
     SKP_float       *results,           /* O    result (length correlationCount)            */\r
     const SKP_float *inputData,         /* I    input data to correlate                     */\r
     SKP_int         inputDataSize,      /* I    length of input                             */\r
@@ -43,6 +43,6 @@ void SKP_Silk_autocorrelation_FLP(
     }\r
 \r
     for( i = 0; i < correlationCount; i++ ) {\r
-        results[ i ] =  (SKP_float)SKP_Silk_inner_product_FLP( inputData, inputData + i, inputDataSize - i );\r
+        results[ i ] =  (SKP_float)silk_inner_product_FLP( inputData, inputData + i, inputDataSize - i );\r
     }\r
 }\r
similarity index 80%
rename from silk/float/SKP_Silk_burg_modified_FLP.c
rename to silk/float/silk_burg_modified_FLP.c
index 5b44c72..563216a 100644 (file)
@@ -25,23 +25,13 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-/*                                                                      *\r
- * SKP_Silk_burg_modified.c                                           *\r
- *                                                                      *\r
- * Calculates the reflection coefficients from the input vector         *\r
- * Input vector contains nb_subfr sub vectors of length L_sub + D       *\r
- *                                                                      *\r
- * Copyright 2009 (c), Skype Limited                                    *\r
- * Date: 091130                                                         *\r
- */\r
-\r
-#include "SKP_Silk_SigProc_FLP.h"\r
+#include "silk_SigProc_FLP.h"\r
 \r
 #define MAX_FRAME_SIZE              384 // subfr_length * nb_subfr = ( 0.005 * 16000 + 16 ) * 4 = 384\r
 #define MAX_NB_SUBFR                4\r
 \r
 /* Compute reflection coefficients from input signal */\r
-SKP_float SKP_Silk_burg_modified_FLP(   /* O    returns residual energy                                         */\r
+SKP_float silk_burg_modified_FLP(   /* O    returns residual energy                                         */\r
     SKP_float       A[],                /* O    prediction coefficients (length order)                          */\r
     const SKP_float x[],                /* I    input signal, length: nb_subfr*(D+L_sub)                        */\r
     const SKP_int   subfr_length,       /* I    input signal subframe length (including D preceeding samples)   */\r
@@ -53,23 +43,23 @@ SKP_float SKP_Silk_burg_modified_FLP(   /* O    returns residual energy
     SKP_int         k, n, s;\r
     double          C0, num, nrg_f, nrg_b, rc, Atmp, tmp1, tmp2;\r
     const SKP_float *x_ptr;\r
-    double          C_first_row[ SKP_Silk_MAX_ORDER_LPC ], C_last_row[ SKP_Silk_MAX_ORDER_LPC ];\r
-    double          CAf[ SKP_Silk_MAX_ORDER_LPC + 1 ], CAb[ SKP_Silk_MAX_ORDER_LPC + 1 ];\r
-    double          Af[ SKP_Silk_MAX_ORDER_LPC ];\r
+    double          C_first_row[ SILK_MAX_ORDER_LPC ], C_last_row[ SILK_MAX_ORDER_LPC ];\r
+    double          CAf[ SILK_MAX_ORDER_LPC + 1 ], CAb[ SILK_MAX_ORDER_LPC + 1 ];\r
+    double          Af[ SILK_MAX_ORDER_LPC ];\r
 \r
     SKP_assert( subfr_length * nb_subfr <= MAX_FRAME_SIZE );\r
     SKP_assert( nb_subfr <= MAX_NB_SUBFR );\r
 \r
     /* Compute autocorrelations, added over subframes */\r
-    C0 = SKP_Silk_energy_FLP( x, nb_subfr * subfr_length );\r
-    SKP_memset( C_first_row, 0, SKP_Silk_MAX_ORDER_LPC * sizeof( double ) );\r
+    C0 = silk_energy_FLP( x, nb_subfr * subfr_length );\r
+    SKP_memset( C_first_row, 0, SILK_MAX_ORDER_LPC * sizeof( double ) );\r
     for( s = 0; s < nb_subfr; s++ ) {\r
         x_ptr = x + s * subfr_length;\r
         for( n = 1; n < D + 1; n++ ) {\r
-            C_first_row[ n - 1 ] += SKP_Silk_inner_product_FLP( x_ptr, x_ptr + n, subfr_length - n );\r
+            C_first_row[ n - 1 ] += silk_inner_product_FLP( x_ptr, x_ptr + n, subfr_length - n );\r
         }\r
     }\r
-    SKP_memcpy( C_last_row, C_first_row, SKP_Silk_MAX_ORDER_LPC * sizeof( double ) );\r
+    SKP_memcpy( C_last_row, C_first_row, SILK_MAX_ORDER_LPC * sizeof( double ) );\r
 \r
     /* Initialize */\r
     CAb[ 0 ] = CAf[ 0 ] = C0 + WhiteNoiseFrac * C0 + 1e-9f;\r
similarity index 95%
rename from silk/float/SKP_Silk_bwexpander_FLP.c
rename to silk/float/silk_bwexpander_FLP.c
index 3cf1809..d97328e 100644 (file)
@@ -26,11 +26,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 ***********************************************************************/\r
 \r
 \r
-#include "SKP_Silk_SigProc_FLP.h"\r
+#include "silk_SigProc_FLP.h"\r
 \r
 \r
 /* Chirp (bw expand) LP AR filter */\r
-void SKP_Silk_bwexpander_FLP( \r
+void silk_bwexpander_FLP( \r
     SKP_float           *ar,        /* I/O  AR filter to be expanded (without leading 1)    */\r
     const SKP_int       d,          /* I    length of ar                                    */\r
     const SKP_float     chirp       /* I    chirp factor (typically in range (0..1) )       */\r
similarity index 92%
rename from silk/float/SKP_Silk_corrMatrix_FLP.c
rename to silk/float/silk_corrMatrix_FLP.c
index 0fdaabd..4a25971 100644 (file)
@@ -29,10 +29,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * Correlation matrix computations for LS estimate. \r
  **********************************************************************/\r
 \r
-#include "SKP_Silk_main_FLP.h"\r
+#include "silk_main_FLP.h"\r
 \r
 /* Calculates correlation vector X'*t */\r
-void SKP_Silk_corrVector_FLP(\r
+void silk_corrVector_FLP(\r
     const SKP_float                 *x,                 /* I    x vector [L+order-1] used to create X   */\r
     const SKP_float                 *t,                 /* I    Target vector [L]                       */\r
     const SKP_int                   L,                  /* I    Length of vecors                        */\r
@@ -46,13 +46,13 @@ void SKP_Silk_corrVector_FLP(
     ptr1 = &x[ Order - 1 ];                     /* Points to first sample of column 0 of X: X[:,0] */\r
     for( lag = 0; lag < Order; lag++ ) {\r
         /* Calculate X[:,lag]'*t */\r
-        Xt[ lag ] = (SKP_float)SKP_Silk_inner_product_FLP( ptr1, t, L );\r
+        Xt[ lag ] = (SKP_float)silk_inner_product_FLP( ptr1, t, L );\r
         ptr1--;                                 /* Next column of X */\r
     }   \r
 }\r
 \r
 /* Calculates correlation matrix X'*X */\r
-void SKP_Silk_corrMatrix_FLP(\r
+void silk_corrMatrix_FLP(\r
     const SKP_float                 *x,                 /* I    x vector [ L+order-1 ] used to create X */\r
     const SKP_int                   L,                  /* I    Length of vectors                       */\r
     const SKP_int                   Order,              /* I    Max lag for correlation                 */\r
@@ -64,7 +64,7 @@ void SKP_Silk_corrMatrix_FLP(
     const SKP_float *ptr1, *ptr2;\r
 \r
     ptr1 = &x[ Order - 1 ];                     /* First sample of column 0 of X */\r
-    energy = SKP_Silk_energy_FLP( ptr1, L );  /* X[:,0]'*X[:,0] */\r
+    energy = silk_energy_FLP( ptr1, L );  /* X[:,0]'*X[:,0] */\r
     matrix_ptr( XX, 0, 0, Order ) = ( SKP_float )energy;\r
     for( j = 1; j < Order; j++ ) {\r
         /* Calculate X[:,j]'*X[:,j] */\r
@@ -75,7 +75,7 @@ void SKP_Silk_corrMatrix_FLP(
     ptr2 = &x[ Order - 2 ];                     /* First sample of column 1 of X */\r
     for( lag = 1; lag < Order; lag++ ) {\r
         /* Calculate X[:,0]'*X[:,lag] */\r
-        energy = SKP_Silk_inner_product_FLP( ptr1, ptr2, L );   \r
+        energy = silk_inner_product_FLP( ptr1, ptr2, L );   \r
         matrix_ptr( XX, lag, 0, Order ) = ( SKP_float )energy;\r
         matrix_ptr( XX, 0, lag, Order ) = ( SKP_float )energy;\r
         /* Calculate X[:,j]'*X[:,j + lag] */\r
similarity index 78%
rename from silk/float/SKP_Silk_encode_frame_FLP.c
rename to silk/float/silk_encode_frame_FLP.c
index 0a9fc0c..d18f22b 100644 (file)
@@ -25,22 +25,21 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FLP.h"\r
-#include "SKP_Silk_tuning_parameters.h"\r
+#include "silk_main_FLP.h"\r
+#include "silk_tuning_parameters.h"\r
 \r
 /****************/\r
 /* Encode frame */\r
 /****************/\r
-SKP_int SKP_Silk_encode_frame_FLP( \r
-    SKP_Silk_encoder_state_FLP      *psEnc,             /* I/O  Encoder state FLP                       */\r
+SKP_int silk_encode_frame_FLP( \r
+    silk_encoder_state_FLP          *psEnc,             /* I/O  Encoder state FLP                       */\r
     SKP_int32                       *pnBytesOut,        /*   O  Number of payload bytes                 */\r
     ec_enc                          *psRangeEnc         /* I/O  compressor data structure               */\r
 )\r
 {\r
-    SKP_Silk_encoder_control_FLP sEncCtrl;\r
+    silk_encoder_control_FLP sEncCtrl;\r
     SKP_int     i, ret = 0;\r
     SKP_float   *x_frame, *res_pitch_frame;\r
-    SKP_int16   pIn_HP[ MAX_FRAME_LENGTH ];\r
     SKP_float   xfw[ MAX_FRAME_LENGTH ];\r
     SKP_float   res_pitch[ 2 * MAX_FRAME_LENGTH + LA_PITCH_MAX ];\r
 \r
@@ -59,16 +58,16 @@ TIC(ENCODE_FRAME)
     /* Voice Activity Detection */\r
     /****************************/\r
 TIC(VAD)\r
-    ret = SKP_Silk_VAD_GetSA_Q8( &psEnc->sCmn, psEnc->sCmn.inputBuf );\r
+    ret = silk_VAD_GetSA_Q8( &psEnc->sCmn, psEnc->sCmn.inputBuf - 1 );\r
 TOC(VAD)\r
 \r
     /**************************************************/\r
     /* Convert speech activity into VAD and DTX flags */\r
     /**************************************************/\r
-    if( psEnc->sCmn.nFramesAnalyzed == 0 ) {\r
+    if( psEnc->sCmn.nFramesEncoded == 0 ) {\r
         psEnc->sCmn.inDTX = psEnc->sCmn.useDTX;\r
     }\r
-    if( psEnc->sCmn.speech_activity_Q8 < SKP_FIX_CONST( SPEECH_ACTIVITY_DTX_THRES, 8 ) ) {\r
+    if( psEnc->sCmn.speech_activity_Q8 < SILK_FIX_CONST( SPEECH_ACTIVITY_DTX_THRES, 8 ) ) {\r
         psEnc->sCmn.indices.signalType = TYPE_NO_VOICE_ACTIVITY;\r
         psEnc->sCmn.noSpeechCounter++;\r
         if( psEnc->sCmn.noSpeechCounter < NB_SPEECH_FRAMES_BEFORE_DTX ) {\r
@@ -77,28 +76,23 @@ TOC(VAD)
             psEnc->sCmn.noSpeechCounter = NB_SPEECH_FRAMES_BEFORE_DTX;\r
             psEnc->sCmn.inDTX           = 0;\r
         }\r
-        psEnc->sCmn.VAD_flags[ psEnc->sCmn.nFramesAnalyzed ] = 0;\r
+        psEnc->sCmn.VAD_flags[ psEnc->sCmn.nFramesEncoded ] = 0;\r
     } else {\r
         psEnc->sCmn.noSpeechCounter    = 0;\r
         psEnc->sCmn.inDTX              = 0;\r
         psEnc->sCmn.indices.signalType = TYPE_UNVOICED;\r
-        psEnc->sCmn.VAD_flags[ psEnc->sCmn.nFramesAnalyzed ] = 1;\r
+        psEnc->sCmn.VAD_flags[ psEnc->sCmn.nFramesEncoded ] = 1;\r
     }\r
 \r
-    /*******************************************/\r
-    /* High-pass filtering of the input signal */\r
-    /*******************************************/\r
-TIC(HP_IN)\r
-    SKP_Silk_HP_variable_cutoff( &psEnc->sCmn, pIn_HP, psEnc->sCmn.inputBuf, psEnc->sCmn.frame_length );\r
-TOC(HP_IN)\r
-\r
+    /***************************************/\r
     /* Ensure smooth bandwidth transitions */\r
-    SKP_Silk_LP_variable_cutoff( &psEnc->sCmn.sLP, pIn_HP, psEnc->sCmn.frame_length );\r
+    /***************************************/\r
+    silk_LP_variable_cutoff( &psEnc->sCmn.sLP, psEnc->sCmn.inputBuf - 1, psEnc->sCmn.frame_length );\r
 \r
     /*******************************************/\r
     /* Copy new frame to front of input buffer */\r
     /*******************************************/\r
-    SKP_short2float_array( x_frame + LA_SHAPE_MS * psEnc->sCmn.fs_kHz, pIn_HP, psEnc->sCmn.frame_length );\r
+    SKP_short2float_array( x_frame + LA_SHAPE_MS * psEnc->sCmn.fs_kHz, psEnc->sCmn.inputBuf - 1, psEnc->sCmn.frame_length );\r
 \r
     /* Add tiny signal to avoid high CPU load from denormalized floating point numbers */\r
     for( i = 0; i < 8; i++ ) {\r
@@ -109,49 +103,49 @@ TOC(HP_IN)
     /* Find pitch lags, initial LPC analysis */\r
     /*****************************************/\r
 TIC(FIND_PITCH)\r
-    SKP_Silk_find_pitch_lags_FLP( psEnc, &sEncCtrl, res_pitch, x_frame );\r
+    silk_find_pitch_lags_FLP( psEnc, &sEncCtrl, res_pitch, x_frame );\r
 TOC(FIND_PITCH)\r
 \r
     /************************/\r
     /* Noise shape analysis */\r
     /************************/\r
 TIC(NOISE_SHAPE_ANALYSIS)\r
-    SKP_Silk_noise_shape_analysis_FLP( psEnc, &sEncCtrl, res_pitch_frame, x_frame );\r
+    silk_noise_shape_analysis_FLP( psEnc, &sEncCtrl, res_pitch_frame, x_frame );\r
 TOC(NOISE_SHAPE_ANALYSIS)\r
 \r
     /***************************************************/\r
     /* Find linear prediction coefficients (LPC + LTP) */\r
     /***************************************************/\r
 TIC(FIND_PRED_COEF)\r
-    SKP_Silk_find_pred_coefs_FLP( psEnc, &sEncCtrl, res_pitch, x_frame );\r
+    silk_find_pred_coefs_FLP( psEnc, &sEncCtrl, res_pitch, x_frame );\r
 TOC(FIND_PRED_COEF)\r
 \r
     /****************************************/\r
     /* Process gains                        */\r
     /****************************************/\r
 TIC(PROCESS_GAINS)\r
-    SKP_Silk_process_gains_FLP( psEnc, &sEncCtrl );\r
+    silk_process_gains_FLP( psEnc, &sEncCtrl );\r
 TOC(PROCESS_GAINS)\r
 \r
-    /****************************************/\r
-    /* Low Bitrate Redundant Encoding       */\r
-    /****************************************/\r
-TIC(LBRR)\r
-    SKP_Silk_LBRR_encode_FLP( psEnc, &sEncCtrl, xfw );\r
-TOC(LBRR)\r
-\r
     /*****************************************/\r
     /* Prefiltering for noise shaper         */\r
     /*****************************************/\r
 TIC(PREFILTER)\r
-    SKP_Silk_prefilter_FLP( psEnc, &sEncCtrl, xfw, x_frame );\r
+    silk_prefilter_FLP( psEnc, &sEncCtrl, xfw, x_frame );\r
 TOC(PREFILTER)\r
 \r
+    /****************************************/\r
+    /* Low Bitrate Redundant Encoding       */\r
+    /****************************************/\r
+TIC(LBRR)\r
+    silk_LBRR_encode_FLP( psEnc, &sEncCtrl, xfw );\r
+TOC(LBRR)\r
+\r
     /*****************************************/\r
     /* Noise shaping quantization            */\r
     /*****************************************/\r
 TIC(NSQ)\r
-    SKP_Silk_NSQ_wrapper_FLP( psEnc, &sEncCtrl, &psEnc->sCmn.indices, &psEnc->sCmn.sNSQ, psEnc->sCmn.pulses, xfw );\r
+    silk_NSQ_wrapper_FLP( psEnc, &sEncCtrl, &psEnc->sCmn.indices, &psEnc->sCmn.sNSQ, psEnc->sCmn.pulses, xfw );\r
 TOC(NSQ)\r
 \r
     /* Update input buffer */\r
@@ -173,14 +167,14 @@ TOC(NSQ)
     /* Encode Parameters                    */\r
     /****************************************/\r
 TIC(ENCODE_PARAMS)\r
-    SKP_Silk_encode_indices( &psEnc->sCmn, psRangeEnc, psEnc->sCmn.nFramesAnalyzed, 0 );\r
+    silk_encode_indices( &psEnc->sCmn, psRangeEnc, psEnc->sCmn.nFramesEncoded, 0 );\r
 TOC(ENCODE_PARAMS)\r
 \r
     /****************************************/\r
     /* Encode Excitation Signal             */\r
     /****************************************/\r
 TIC(ENCODE_PULSES)\r
-    SKP_Silk_encode_pulses( psRangeEnc, psEnc->sCmn.indices.signalType, psEnc->sCmn.indices.quantOffsetType, \r
+    silk_encode_pulses( psRangeEnc, psEnc->sCmn.indices.signalType, psEnc->sCmn.indices.quantOffsetType, \r
         psEnc->sCmn.pulses, psEnc->sCmn.frame_length );\r
 TOC(ENCODE_PULSES)\r
 \r
@@ -188,12 +182,12 @@ TOC(ENCODE_PULSES)
     /* Finalize payload                     */\r
     /****************************************/\r
     psEnc->sCmn.first_frame_after_reset = 0;\r
-    if( ++psEnc->sCmn.nFramesAnalyzed >= psEnc->sCmn.nFramesPerPacket ) {\r
+    if( ++psEnc->sCmn.nFramesEncoded >= psEnc->sCmn.nFramesPerPacket ) {\r
         /* Payload size */\r
         *pnBytesOut = SKP_RSHIFT( ec_tell( psRangeEnc ) + 7, 3 );\r
 \r
         /* Reset the number of frames in payload buffer */\r
-        psEnc->sCmn.nFramesAnalyzed = 0;\r
+        psEnc->sCmn.nFramesEncoded = 0;\r
     } else {\r
         /* No payload this time */\r
         *pnBytesOut = 0;\r
@@ -222,32 +216,32 @@ TOC(ENCODE_FRAME)
 }\r
 \r
 /* Low-Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode excitation at lower bitrate  */\r
-void SKP_Silk_LBRR_encode_FLP(\r
-    SKP_Silk_encoder_state_FLP      *psEnc,             /* I/O  Encoder state FLP                       */\r
-    SKP_Silk_encoder_control_FLP    *psEncCtrl,         /* I/O  Encoder control FLP                     */\r
+void silk_LBRR_encode_FLP(\r
+    silk_encoder_state_FLP          *psEnc,             /* I/O  Encoder state FLP                       */\r
+    silk_encoder_control_FLP        *psEncCtrl,         /* I/O  Encoder control FLP                     */\r
     const SKP_float                 xfw[]               /* I    Input signal                            */\r
 )\r
 {\r
     SKP_int     k;\r
     SKP_int32   Gains_Q16[ MAX_NB_SUBFR ];\r
     SKP_float   TempGains[ MAX_NB_SUBFR ];\r
-    SideInfoIndices *psIndices_LBRR = &psEnc->sCmn.indices_LBRR[ psEnc->sCmn.nFramesAnalyzed ];\r
-    SKP_Silk_nsq_state sNSQ_LBRR;\r
+    SideInfoIndices *psIndices_LBRR = &psEnc->sCmn.indices_LBRR[ psEnc->sCmn.nFramesEncoded ];\r
+    silk_nsq_state sNSQ_LBRR;\r
 \r
     /*******************************************/\r
     /* Control use of inband LBRR              */\r
     /*******************************************/\r
-    if( psEnc->sCmn.LBRR_enabled && psEnc->sCmn.speech_activity_Q8 > SKP_FIX_CONST( LBRR_SPEECH_ACTIVITY_THRES, 8 ) ) {\r
-        psEnc->sCmn.LBRR_flags[ psEnc->sCmn.nFramesAnalyzed ] = 1;\r
+    if( psEnc->sCmn.LBRR_enabled && psEnc->sCmn.speech_activity_Q8 > SILK_FIX_CONST( LBRR_SPEECH_ACTIVITY_THRES, 8 ) ) {\r
+        psEnc->sCmn.LBRR_flags[ psEnc->sCmn.nFramesEncoded ] = 1;\r
 \r
         /* Copy noise shaping quantizer state and quantization indices from regular encoding */\r
-        SKP_memcpy( &sNSQ_LBRR, &psEnc->sCmn.sNSQ, sizeof( SKP_Silk_nsq_state ) );\r
+        SKP_memcpy( &sNSQ_LBRR, &psEnc->sCmn.sNSQ, sizeof( silk_nsq_state ) );\r
         SKP_memcpy( psIndices_LBRR, &psEnc->sCmn.indices, sizeof( SideInfoIndices ) );\r
 \r
         /* Save original gains */\r
         SKP_memcpy( TempGains, psEncCtrl->Gains, psEnc->sCmn.nb_subfr * sizeof( SKP_float ) );\r
 \r
-        if( psEnc->sCmn.nFramesAnalyzed == 0 || psEnc->sCmn.LBRR_flags[ psEnc->sCmn.nFramesAnalyzed - 1 ] == 0 ) {\r
+        if( psEnc->sCmn.nFramesEncoded == 0 || psEnc->sCmn.LBRR_flags[ psEnc->sCmn.nFramesEncoded - 1 ] == 0 ) {\r
             /* First frame in packet or previous frame not LBRR coded */\r
             psEnc->sCmn.LBRRprevLastGainIndex = psEnc->sShape.LastGainIndex;\r
 \r
@@ -257,19 +251,19 @@ void SKP_Silk_LBRR_encode_FLP(
         }\r
 \r
         /* Decode to get gains in sync with decoder */\r
-        SKP_Silk_gains_dequant( Gains_Q16, psIndices_LBRR->GainsIndices, \r
-            &psEnc->sCmn.LBRRprevLastGainIndex, psEnc->sCmn.nFramesAnalyzed, psEnc->sCmn.nb_subfr );\r
+        silk_gains_dequant( Gains_Q16, psIndices_LBRR->GainsIndices, \r
+            &psEnc->sCmn.LBRRprevLastGainIndex, psEnc->sCmn.nFramesEncoded, psEnc->sCmn.nb_subfr );\r
 \r
         /* Overwrite unquantized gains with quantized gains and convert back to Q0 from Q16 */\r
         for( k = 0; k <  psEnc->sCmn.nb_subfr; k++ ) {\r
-            psEncCtrl->Gains[ k ] = Gains_Q16[ k ] / 65536.0f;\r
+            psEncCtrl->Gains[ k ] = Gains_Q16[ k ] * ( 1.0f / 65536.0f );\r
         }\r
 \r
         /*****************************************/\r
         /* Noise shaping quantization            */\r
         /*****************************************/\r
-        SKP_Silk_NSQ_wrapper_FLP( psEnc, psEncCtrl, psIndices_LBRR, &sNSQ_LBRR, \r
-            psEnc->sCmn.pulses_LBRR[ psEnc->sCmn.nFramesAnalyzed ], xfw );\r
+        silk_NSQ_wrapper_FLP( psEnc, psEncCtrl, psIndices_LBRR, &sNSQ_LBRR, \r
+            psEnc->sCmn.pulses_LBRR[ psEnc->sCmn.nFramesEncoded ], xfw );\r
 \r
         /* Restore original gains */\r
         SKP_memcpy( psEncCtrl->Gains, TempGains, psEnc->sCmn.nb_subfr * sizeof( SKP_float ) );\r
similarity index 95%
rename from silk/float/SKP_Silk_energy_FLP.c
rename to silk/float/silk_energy_FLP.c
index 579364d..87cbb9e 100644 (file)
@@ -25,10 +25,10 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_SigProc_FLP.h"\r
+#include "silk_SigProc_FLP.h"\r
 \r
 /* sum of squares of a SKP_float array, with result as double */\r
-double SKP_Silk_energy_FLP( \r
+double silk_energy_FLP( \r
     const SKP_float     *data, \r
     SKP_int             dataSize\r
 )\r
similarity index 80%
rename from silk/float/SKP_Silk_find_LPC_FLP.c
rename to silk/float/silk_find_LPC_FLP.c
index 88392f3..d0f5295 100644 (file)
@@ -25,10 +25,10 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FLP.h"\r
-#include "SKP_Silk_tuning_parameters.h"\r
+#include "silk_main_FLP.h"\r
+#include "silk_tuning_parameters.h"\r
 \r
-void SKP_Silk_find_LPC_FLP(\r
+void silk_find_LPC_FLP(\r
           SKP_int16                 NLSF_Q15[],             /* O    NLSFs                                   */\r
           SKP_int8                  *interpIndex,           /* O    NLSF interp. index for NLSF interp.     */\r
     const SKP_int16                 prev_NLSFq_Q15[],       /* I    Previous NLSFs, for NLSF interpolation  */\r
@@ -53,39 +53,39 @@ void SKP_Silk_find_LPC_FLP(
     *interpIndex = 4;\r
 \r
     /* Burg AR analysis for the full frame */\r
-    res_nrg = SKP_Silk_burg_modified_FLP( a, x, subfr_length, nb_subfr, FIND_LPC_COND_FAC, LPC_order );\r
+    res_nrg = silk_burg_modified_FLP( a, x, subfr_length, nb_subfr, FIND_LPC_COND_FAC, LPC_order );\r
 \r
     if( firstFrameAfterReset ) {\r
-        SKP_Silk_bwexpander_FLP( a, LPC_order, FIND_LPC_CHIRP_FIRST_FRAME );\r
+        silk_bwexpander_FLP( a, LPC_order, FIND_LPC_CHIRP_FIRST_FRAME );\r
     } else {\r
-        SKP_Silk_bwexpander_FLP( a_tmp, LPC_order, FIND_LPC_CHIRP );\r
+        silk_bwexpander_FLP( a_tmp, LPC_order, FIND_LPC_CHIRP );\r
     }\r
 \r
     if( useInterpNLSFs && !firstFrameAfterReset && nb_subfr == MAX_NB_SUBFR ) {\r
         /* Optimal solution for last 10 ms; subtract residual energy here, as that's easier than        */\r
         /* adding it to the residual energy of the first 10 ms in each iteration of the search below    */\r
-        res_nrg -= SKP_Silk_burg_modified_FLP( a_tmp, x + ( MAX_NB_SUBFR / 2 ) * subfr_length, \r
+        res_nrg -= silk_burg_modified_FLP( a_tmp, x + ( MAX_NB_SUBFR / 2 ) * subfr_length, \r
             subfr_length, MAX_NB_SUBFR / 2, FIND_LPC_COND_FAC, LPC_order );\r
 \r
-        SKP_Silk_bwexpander_FLP( a_tmp, LPC_order, FIND_LPC_CHIRP );\r
+        silk_bwexpander_FLP( a_tmp, LPC_order, FIND_LPC_CHIRP );\r
 \r
         /* Convert to NLSFs */\r
-        SKP_Silk_A2NLSF_FLP( NLSF_Q15, a_tmp, LPC_order );\r
+        silk_A2NLSF_FLP( NLSF_Q15, a_tmp, LPC_order );\r
 \r
         /* Search over interpolation indices to find the one with lowest residual energy */\r
         res_nrg_2nd = SKP_float_MAX;\r
         for( k = 3; k >= 0; k-- ) {\r
             /* Interpolate NLSFs for first half */\r
-            SKP_Silk_interpolate( NLSF0_Q15, prev_NLSFq_Q15, NLSF_Q15, k, LPC_order );\r
+            silk_interpolate( NLSF0_Q15, prev_NLSFq_Q15, NLSF_Q15, k, LPC_order );\r
 \r
             /* Convert to LPC for residual energy evaluation */\r
-            SKP_Silk_NLSF2A_stable_FLP( a_tmp, NLSF0_Q15, LPC_order );\r
+            silk_NLSF2A_stable_FLP( a_tmp, NLSF0_Q15, LPC_order );\r
 \r
             /* Calculate residual energy with LSF interpolation */\r
-            SKP_Silk_LPC_analysis_filter_FLP( LPC_res, a_tmp, x, 2 * subfr_length, LPC_order );\r
+            silk_LPC_analysis_filter_FLP( LPC_res, a_tmp, x, 2 * subfr_length, LPC_order );\r
             res_nrg_interp = \r
-                SKP_Silk_energy_FLP( LPC_res + LPC_order,                subfr_length - LPC_order ) + \r
-                SKP_Silk_energy_FLP( LPC_res + LPC_order + subfr_length, subfr_length - LPC_order );\r
+                silk_energy_FLP( LPC_res + LPC_order,                subfr_length - LPC_order ) + \r
+                silk_energy_FLP( LPC_res + LPC_order + subfr_length, subfr_length - LPC_order );\r
 \r
             /* Determine whether current interpolated NLSFs are best so far */\r
             if( res_nrg_interp < res_nrg ) {\r
@@ -102,7 +102,7 @@ void SKP_Silk_find_LPC_FLP(
 \r
     if( *interpIndex == 4 ) {\r
         /* NLSF interpolation is currently inactive, calculate NLSFs from full frame AR coefficients */\r
-        SKP_Silk_A2NLSF_FLP( NLSF_Q15, a, LPC_order );\r
+        silk_A2NLSF_FLP( NLSF_Q15, a, LPC_order );\r
     }\r
 \r
     SKP_assert( *interpIndex == 4 || ( useInterpNLSFs && !firstFrameAfterReset && nb_subfr == MAX_NB_SUBFR ) );\r
similarity index 85%
rename from silk/float/SKP_Silk_find_LTP_FLP.c
rename to silk/float/silk_find_LTP_FLP.c
index 7daf5fb..e8fe1e7 100644 (file)
@@ -25,10 +25,10 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FLP.h"\r
-#include "SKP_Silk_tuning_parameters.h"\r
+#include "silk_main_FLP.h"\r
+#include "silk_tuning_parameters.h"\r
 \r
-void SKP_Silk_find_LTP_FLP(\r
+void silk_find_LTP_FLP(\r
           SKP_float b[ MAX_NB_SUBFR * LTP_ORDER ],          /* O    LTP coefs                               */\r
           SKP_float WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O    Weight for LTP quantization       */\r
           SKP_float *LTPredCodGain,                         /* O    LTP coding gain                         */\r
@@ -54,22 +54,22 @@ void SKP_Silk_find_LTP_FLP(
     for( k = 0; k < nb_subfr; k++ ) {\r
         lag_ptr = r_ptr - ( lag[ k ] + LTP_ORDER / 2 );\r
 \r
-        SKP_Silk_corrMatrix_FLP( lag_ptr, subfr_length, LTP_ORDER, WLTP_ptr );\r
-        SKP_Silk_corrVector_FLP( lag_ptr, r_ptr, subfr_length, LTP_ORDER, Rr );\r
+        silk_corrMatrix_FLP( lag_ptr, subfr_length, LTP_ORDER, WLTP_ptr );\r
+        silk_corrVector_FLP( lag_ptr, r_ptr, subfr_length, LTP_ORDER, Rr );\r
 \r
-        rr[ k ] = ( SKP_float )SKP_Silk_energy_FLP( r_ptr, subfr_length );\r
+        rr[ k ] = ( SKP_float )silk_energy_FLP( r_ptr, subfr_length );\r
         regu = 1.0f + rr[ k ] + \r
             matrix_ptr( WLTP_ptr, 0, 0, LTP_ORDER ) + \r
             matrix_ptr( WLTP_ptr, LTP_ORDER-1, LTP_ORDER-1, LTP_ORDER );\r
         regu *= LTP_DAMPING / 3;\r
-        SKP_Silk_regularize_correlations_FLP( WLTP_ptr, &rr[ k ], regu, LTP_ORDER );\r
-        SKP_Silk_solve_LDL_FLP( WLTP_ptr, LTP_ORDER, Rr, b_ptr );\r
+        silk_regularize_correlations_FLP( WLTP_ptr, &rr[ k ], regu, LTP_ORDER );\r
+        silk_solve_LDL_FLP( WLTP_ptr, LTP_ORDER, Rr, b_ptr );\r
 \r
         /* Calculate residual energy */\r
-        nrg[ k ] = SKP_Silk_residual_energy_covar_FLP( b_ptr, WLTP_ptr, Rr, rr[ k ], LTP_ORDER );\r
+        nrg[ k ] = silk_residual_energy_covar_FLP( b_ptr, WLTP_ptr, Rr, rr[ k ], LTP_ORDER );\r
 \r
         temp = Wght[ k ] / ( nrg[ k ] * Wght[ k ] + 0.01f * subfr_length );\r
-        SKP_Silk_scale_vector_FLP( WLTP_ptr, temp, LTP_ORDER * LTP_ORDER );\r
+        silk_scale_vector_FLP( WLTP_ptr, temp, LTP_ORDER * LTP_ORDER );\r
         w[ k ] = matrix_ptr( WLTP_ptr, LTP_ORDER / 2, LTP_ORDER / 2, LTP_ORDER );\r
     \r
         r_ptr    += subfr_length;\r
@@ -87,7 +87,7 @@ void SKP_Silk_find_LTP_FLP(
         }\r
         \r
         SKP_assert( LPC_LTP_res_nrg > 0 );\r
-        *LTPredCodGain = 3.0f * SKP_Silk_log2( LPC_res_nrg / LPC_LTP_res_nrg );\r
+        *LTPredCodGain = 3.0f * silk_log2( LPC_res_nrg / LPC_LTP_res_nrg );\r
     }\r
 \r
     /* Smoothing */\r
similarity index 82%
rename from silk/float/SKP_Silk_find_pitch_lags_FLP.c
rename to silk/float/silk_find_pitch_lags_FLP.c
index c8de0e2..8f213ca 100644 (file)
@@ -26,12 +26,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 ***********************************************************************/\r
 \r
 #include <stdlib.h>\r
-#include "SKP_Silk_main_FLP.h"\r
-#include "SKP_Silk_tuning_parameters.h"\r
+#include "silk_main_FLP.h"\r
+#include "silk_tuning_parameters.h"\r
 \r
-void SKP_Silk_find_pitch_lags_FLP(\r
-    SKP_Silk_encoder_state_FLP      *psEnc,             /* I/O  Encoder state FLP                       */\r
-    SKP_Silk_encoder_control_FLP    *psEncCtrl,         /* I/O  Encoder control FLP                     */\r
+void silk_find_pitch_lags_FLP(\r
+    silk_encoder_state_FLP          *psEnc,             /* I/O  Encoder state FLP                       */\r
+    silk_encoder_control_FLP        *psEncCtrl,         /* I/O  Encoder control FLP                     */\r
           SKP_float                 res[],              /* O    Residual                                */\r
     const SKP_float                 x[]                 /* I    Speech signal                           */\r
 )\r
@@ -64,7 +64,7 @@ void SKP_Silk_find_pitch_lags_FLP(
     /* First LA_LTP samples */\r
     x_buf_ptr = x_buf + buf_len - psEnc->sCmn.pitch_LPC_win_length;\r
     Wsig_ptr  = Wsig;\r
-    SKP_Silk_apply_sine_window_FLP( Wsig_ptr, x_buf_ptr, 1, psEnc->sCmn.la_pitch );\r
+    silk_apply_sine_window_FLP( Wsig_ptr, x_buf_ptr, 1, psEnc->sCmn.la_pitch );\r
 \r
     /* Middle non-windowed samples */\r
     Wsig_ptr  += psEnc->sCmn.la_pitch;\r
@@ -74,30 +74,30 @@ void SKP_Silk_find_pitch_lags_FLP(
     /* Last LA_LTP samples */\r
     Wsig_ptr  += psEnc->sCmn.pitch_LPC_win_length - ( psEnc->sCmn.la_pitch << 1 );\r
     x_buf_ptr += psEnc->sCmn.pitch_LPC_win_length - ( psEnc->sCmn.la_pitch << 1 );\r
-    SKP_Silk_apply_sine_window_FLP( Wsig_ptr, x_buf_ptr, 2, psEnc->sCmn.la_pitch );\r
+    silk_apply_sine_window_FLP( Wsig_ptr, x_buf_ptr, 2, psEnc->sCmn.la_pitch );\r
 \r
     /* Calculate autocorrelation sequence */\r
-    SKP_Silk_autocorrelation_FLP( auto_corr, Wsig, psEnc->sCmn.pitch_LPC_win_length, psEnc->sCmn.pitchEstimationLPCOrder + 1 );\r
+    silk_autocorrelation_FLP( auto_corr, Wsig, psEnc->sCmn.pitch_LPC_win_length, psEnc->sCmn.pitchEstimationLPCOrder + 1 );\r
 \r
     /* Add white noise, as a fraction of the energy */\r
     auto_corr[ 0 ] += auto_corr[ 0 ] * FIND_PITCH_WHITE_NOISE_FRACTION + 1;\r
 \r
     /* Calculate the reflection coefficients using Schur */\r
-    res_nrg = SKP_Silk_schur_FLP( refl_coef, auto_corr, psEnc->sCmn.pitchEstimationLPCOrder );\r
+    res_nrg = silk_schur_FLP( refl_coef, auto_corr, psEnc->sCmn.pitchEstimationLPCOrder );\r
 \r
     /* Prediction gain */\r
     psEncCtrl->predGain = auto_corr[ 0 ] / SKP_max_float( res_nrg, 1.0f );\r
 \r
     /* Convert reflection coefficients to prediction coefficients */\r
-    SKP_Silk_k2a_FLP( A, refl_coef, psEnc->sCmn.pitchEstimationLPCOrder );\r
+    silk_k2a_FLP( A, refl_coef, psEnc->sCmn.pitchEstimationLPCOrder );\r
 \r
     /* Bandwidth expansion */\r
-    SKP_Silk_bwexpander_FLP( A, psEnc->sCmn.pitchEstimationLPCOrder, FIND_PITCH_BANDWITH_EXPANSION );\r
+    silk_bwexpander_FLP( A, psEnc->sCmn.pitchEstimationLPCOrder, FIND_PITCH_BANDWITH_EXPANSION );\r
     \r
     /*****************************************/\r
     /* LPC analysis filtering                */\r
     /*****************************************/\r
-    SKP_Silk_LPC_analysis_filter_FLP( res, A, x_buf, buf_len, psEnc->sCmn.pitchEstimationLPCOrder );\r
+    silk_LPC_analysis_filter_FLP( res, A, x_buf, buf_len, psEnc->sCmn.pitchEstimationLPCOrder );\r
 \r
     if( psEnc->sCmn.indices.signalType != TYPE_NO_VOICE_ACTIVITY && psEnc->sCmn.first_frame_after_reset == 0 ) {\r
         /* Threshold for pitch estimator */\r
@@ -110,7 +110,7 @@ void SKP_Silk_find_pitch_lags_FLP(
         /*****************************************/\r
         /* Call Pitch estimator                  */\r
         /*****************************************/\r
-        if( SKP_Silk_pitch_analysis_core_FLP( res, psEncCtrl->pitchL, &psEnc->sCmn.indices.lagIndex, \r
+        if( silk_pitch_analysis_core_FLP( res, psEncCtrl->pitchL, &psEnc->sCmn.indices.lagIndex, \r
             &psEnc->sCmn.indices.contourIndex, &psEnc->LTPCorr, psEnc->sCmn.prevLag, psEnc->sCmn.pitchEstimationThreshold_Q16 / 65536.0f,\r
             thrhld, psEnc->sCmn.fs_kHz, psEnc->sCmn.pitchEstimationComplexity, psEnc->sCmn.nb_subfr ) == 0 ) \r
         {\r
similarity index 82%
rename from silk/float/SKP_Silk_find_pred_coefs_FLP.c
rename to silk/float/silk_find_pred_coefs_FLP.c
index 4224402..200c78c 100644 (file)
@@ -25,12 +25,12 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_main_FLP.h"\r
+#include "silk_main_FLP.h"\r
 \r
 \r
-void SKP_Silk_find_pred_coefs_FLP(\r
-    SKP_Silk_encoder_state_FLP      *psEnc,             /* I/O  Encoder state FLP                       */\r
-    SKP_Silk_encoder_control_FLP    *psEncCtrl,         /* I/O  Encoder control FLP                     */\r
+void silk_find_pred_coefs_FLP(\r
+    silk_encoder_state_FLP          *psEnc,             /* I/O  Encoder state FLP                       */\r
+    silk_encoder_control_FLP        *psEncCtrl,         /* I/O  Encoder control FLP                     */\r
     const SKP_float                 res_pitch[],        /* I    Residual from pitch analysis            */\r
     const SKP_float                 x[]                 /* I    Speech signal                           */\r
 )\r
@@ -56,7 +56,7 @@ void SKP_Silk_find_pred_coefs_FLP(
         SKP_assert( psEnc->sCmn.ltp_mem_length - psEnc->sCmn.predictLPCOrder >= psEncCtrl->pitchL[ 0 ] + LTP_ORDER / 2 );\r
 \r
         /* LTP analysis */\r
-        SKP_Silk_find_LTP_FLP( psEncCtrl->LTPCoef, WLTP, &psEncCtrl->LTPredCodGain, res_pitch, \r
+        silk_find_LTP_FLP( psEncCtrl->LTPCoef, WLTP, &psEncCtrl->LTPredCodGain, res_pitch, \r
             psEncCtrl->pitchL, Wght, psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr, psEnc->sCmn.ltp_mem_length );\r
 \r
 #ifdef SAVE_ALL_INTERNAL_DATA\r
@@ -65,14 +65,14 @@ void SKP_Silk_find_pred_coefs_FLP(
 #endif\r
 \r
         /* Quantize LTP gain parameters */\r
-        SKP_Silk_quant_LTP_gains_FLP( psEncCtrl->LTPCoef, psEnc->sCmn.indices.LTPIndex, &psEnc->sCmn.indices.PERIndex, \r
+        silk_quant_LTP_gains_FLP( psEncCtrl->LTPCoef, psEnc->sCmn.indices.LTPIndex, &psEnc->sCmn.indices.PERIndex, \r
             WLTP, psEnc->sCmn.mu_LTP_Q9, psEnc->sCmn.LTPQuantLowComplexity, psEnc->sCmn.nb_subfr );\r
 \r
         /* Control LTP scaling */\r
-        SKP_Silk_LTP_scale_ctrl_FLP( psEnc, psEncCtrl );\r
+        silk_LTP_scale_ctrl_FLP( psEnc, psEncCtrl );\r
 \r
         /* Create LTP residual */\r
-        SKP_Silk_LTP_analysis_filter_FLP( LPC_in_pre, x - psEnc->sCmn.predictLPCOrder, psEncCtrl->LTPCoef, \r
+        silk_LTP_analysis_filter_FLP( LPC_in_pre, x - psEnc->sCmn.predictLPCOrder, psEncCtrl->LTPCoef, \r
             psEncCtrl->pitchL, invGains, psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr, psEnc->sCmn.predictLPCOrder );\r
 \r
     } else {\r
@@ -83,7 +83,7 @@ void SKP_Silk_find_pred_coefs_FLP(
         x_ptr     = x - psEnc->sCmn.predictLPCOrder;\r
         x_pre_ptr = LPC_in_pre;\r
         for( i = 0; i < psEnc->sCmn.nb_subfr; i++ ) {\r
-            SKP_Silk_scale_copy_vector_FLP( x_pre_ptr, x_ptr, invGains[ i ], \r
+            silk_scale_copy_vector_FLP( x_pre_ptr, x_ptr, invGains[ i ], \r
                 psEnc->sCmn.subfr_length + psEnc->sCmn.predictLPCOrder );\r
             x_pre_ptr += psEnc->sCmn.subfr_length + psEnc->sCmn.predictLPCOrder;\r
             x_ptr     += psEnc->sCmn.subfr_length;\r
@@ -94,17 +94,17 @@ void SKP_Silk_find_pred_coefs_FLP(
     }\r
 \r
     /* LPC_in_pre contains the LTP-filtered input for voiced, and the unfiltered input for unvoiced */\r
-    SKP_Silk_find_LPC_FLP( NLSF_Q15, &psEnc->sCmn.indices.NLSFInterpCoef_Q2, psEnc->sCmn.prev_NLSFq_Q15, \r
+    silk_find_LPC_FLP( NLSF_Q15, &psEnc->sCmn.indices.NLSFInterpCoef_Q2, psEnc->sCmn.prev_NLSFq_Q15, \r
         psEnc->sCmn.useInterpolatedNLSFs, psEnc->sCmn.first_frame_after_reset, psEnc->sCmn.predictLPCOrder, \r
         LPC_in_pre, psEnc->sCmn.subfr_length + psEnc->sCmn.predictLPCOrder, psEnc->sCmn.nb_subfr );\r
 \r
     /* Quantize LSFs */\r
 TIC(LSF_quant);\r
-    SKP_Silk_process_NLSFs_FLP( &psEnc->sCmn, psEncCtrl->PredCoef, NLSF_Q15, psEnc->sCmn.prev_NLSFq_Q15 );\r
+    silk_process_NLSFs_FLP( &psEnc->sCmn, psEncCtrl->PredCoef, NLSF_Q15, psEnc->sCmn.prev_NLSFq_Q15 );\r
 TOC(LSF_quant);\r
 \r
     /* Calculate residual energy using quantized LPC coefficients */\r
-    SKP_Silk_residual_energy_FLP( psEncCtrl->ResNrg, LPC_in_pre, psEncCtrl->PredCoef, psEncCtrl->Gains,\r
+    silk_residual_energy_FLP( psEncCtrl->ResNrg, LPC_in_pre, psEncCtrl->PredCoef, psEncCtrl->Gains,\r
         psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr, psEnc->sCmn.predictLPCOrder );\r
 \r
     /* Copy to prediction struct for use in next frame for fluctuation reduction */\r
index 313ba68..8a6c986 100644 (file)
     <None Include="ReadMe.txt" />\r
   </ItemGroup>\r
   <ItemGroup>\r
-    <ClCompile Include="SKP_Silk_apply_sine_window_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_autocorrelation_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_burg_modified_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_bwexpander_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_corrMatrix_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_encode_frame_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_energy_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_find_LPC_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_find_LTP_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_find_pitch_lags_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_find_pred_coefs_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_inner_product_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_k2a_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_levinsondurbin_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_LPC_analysis_filter_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_LPC_inv_pred_gain_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_LTP_analysis_filter_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_LTP_scale_ctrl_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_noise_shape_analysis_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_pitch_analysis_core_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_prefilter_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_process_gains_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_regularize_correlations_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_residual_energy_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_scale_copy_vector_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_scale_vector_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_schur_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_solve_LS_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_sort_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_warped_autocorrelation_FLP.c" />\r
-    <ClCompile Include="SKP_Silk_wrappers_FLP.c" />\r
+    <ClCompile Include="silk_apply_sine_window_FLP.c" />\r
+    <ClCompile Include="silk_autocorrelation_FLP.c" />\r
+    <ClCompile Include="silk_burg_modified_FLP.c" />\r
+    <ClCompile Include="silk_bwexpander_FLP.c" />\r
+    <ClCompile Include="silk_corrMatrix_FLP.c" />\r
+    <ClCompile Include="silk_encode_frame_FLP.c" />\r
+    <ClCompile Include="silk_energy_FLP.c" />\r
+    <ClCompile Include="silk_find_LPC_FLP.c" />\r
+    <ClCompile Include="silk_find_LTP_FLP.c" />\r
+    <ClCompile Include="silk_find_pitch_lags_FLP.c" />\r
+    <ClCompile Include="silk_find_pred_coefs_FLP.c" />\r
+    <ClCompile Include="silk_inner_product_FLP.c" />\r
+    <ClCompile Include="silk_k2a_FLP.c" />\r
+    <ClCompile Include="silk_levinsondurbin_FLP.c" />\r
+    <ClCompile Include="silk_LPC_analysis_filter_FLP.c" />\r
+    <ClCompile Include="silk_LPC_inv_pred_gain_FLP.c" />\r
+    <ClCompile Include="silk_LTP_analysis_filter_FLP.c" />\r
+    <ClCompile Include="silk_LTP_scale_ctrl_FLP.c" />\r
+    <ClCompile Include="silk_noise_shape_analysis_FLP.c" />\r
+    <ClCompile Include="silk_pitch_analysis_core_FLP.c" />\r
+    <ClCompile Include="silk_prefilter_FLP.c" />\r
+    <ClCompile Include="silk_process_gains_FLP.c" />\r
+    <ClCompile Include="silk_regularize_correlations_FLP.c" />\r
+    <ClCompile Include="silk_residual_energy_FLP.c" />\r
+    <ClCompile Include="silk_scale_copy_vector_FLP.c" />\r
+    <ClCompile Include="silk_scale_vector_FLP.c" />\r
+    <ClCompile Include="silk_schur_FLP.c" />\r
+    <ClCompile Include="silk_solve_LS_FLP.c" />\r
+    <ClCompile Include="silk_sort_FLP.c" />\r
+    <ClCompile Include="silk_warped_autocorrelation_FLP.c" />\r
+    <ClCompile Include="silk_wrappers_FLP.c" />\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\..\win32\config.h" />\r
-    <ClInclude Include="SKP_Silk_main_FLP.h" />\r
-    <ClInclude Include="SKP_Silk_SigProc_FLP.h" />\r
-    <ClInclude Include="SKP_Silk_structs_FLP.h" />\r
+    <ClInclude Include="silk_main_FLP.h" />\r
+    <ClInclude Include="silk_SigProc_FLP.h" />\r
+    <ClInclude Include="silk_structs_FLP.h" />\r
   </ItemGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
   <ImportGroup Label="ExtensionTargets">\r
index 8c6efb0..debd97d 100644 (file)
     <None Include="ReadMe.txt" />\r
   </ItemGroup>\r
   <ItemGroup>\r
-    <ClCompile Include="SKP_Silk_LPC_analysis_filter_FLP.c">\r
+    <ClCompile Include="silk_apply_sine_window_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_LPC_inv_pred_gain_FLP.c">\r
+    <ClCompile Include="silk_autocorrelation_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_LTP_analysis_filter_FLP.c">\r
+    <ClCompile Include="silk_burg_modified_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_LTP_scale_ctrl_FLP.c">\r
+    <ClCompile Include="silk_bwexpander_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_noise_shape_analysis_FLP.c">\r
+    <ClCompile Include="silk_corrMatrix_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_pitch_analysis_core_FLP.c">\r
+    <ClCompile Include="silk_encode_frame_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_prefilter_FLP.c">\r
+    <ClCompile Include="silk_energy_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_process_gains_FLP.c">\r
+    <ClCompile Include="silk_find_LPC_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_regularize_correlations_FLP.c">\r
+    <ClCompile Include="silk_find_LTP_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_residual_energy_FLP.c">\r
+    <ClCompile Include="silk_find_pitch_lags_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_scale_copy_vector_FLP.c">\r
+    <ClCompile Include="silk_find_pred_coefs_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_scale_vector_FLP.c">\r
+    <ClCompile Include="silk_inner_product_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_schur_FLP.c">\r
+    <ClCompile Include="silk_k2a_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_solve_LS_FLP.c">\r
+    <ClCompile Include="silk_levinsondurbin_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_sort_FLP.c">\r
+    <ClCompile Include="silk_LPC_analysis_filter_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_warped_autocorrelation_FLP.c">\r
+    <ClCompile Include="silk_LPC_inv_pred_gain_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_wrappers_FLP.c">\r
+    <ClCompile Include="silk_LTP_analysis_filter_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_apply_sine_window_FLP.c">\r
+    <ClCompile Include="silk_LTP_scale_ctrl_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_autocorrelation_FLP.c">\r
+    <ClCompile Include="silk_noise_shape_analysis_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_burg_modified_FLP.c">\r
+    <ClCompile Include="silk_pitch_analysis_core_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_bwexpander_FLP.c">\r
+    <ClCompile Include="silk_prefilter_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_corrMatrix_FLP.c">\r
+    <ClCompile Include="silk_process_gains_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_encode_frame_FLP.c">\r
+    <ClCompile Include="silk_regularize_correlations_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_energy_FLP.c">\r
+    <ClCompile Include="silk_residual_energy_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_find_LPC_FLP.c">\r
+    <ClCompile Include="silk_scale_copy_vector_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_find_LTP_FLP.c">\r
+    <ClCompile Include="silk_scale_vector_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_find_pitch_lags_FLP.c">\r
+    <ClCompile Include="silk_schur_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_find_pred_coefs_FLP.c">\r
+    <ClCompile Include="silk_solve_LS_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_inner_product_FLP.c">\r
+    <ClCompile Include="silk_sort_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_k2a_FLP.c">\r
+    <ClCompile Include="silk_warped_autocorrelation_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="SKP_Silk_levinsondurbin_FLP.c">\r
+    <ClCompile Include="silk_wrappers_FLP.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
-    <ClInclude Include="SKP_Silk_main_FLP.h">\r
+    <ClInclude Include="..\..\win32\config.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="SKP_Silk_SigProc_FLP.h">\r
+    <ClInclude Include="silk_main_FLP.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="SKP_Silk_structs_FLP.h">\r
+    <ClInclude Include="silk_SigProc_FLP.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\..\win32\config.h">\r
+    <ClInclude Include="silk_structs_FLP.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
   </ItemGroup>\r
similarity index 94%
rename from silk/float/SKP_Silk_inner_product_FLP.c
rename to silk/float/silk_inner_product_FLP.c
index d901294..80ad1f5 100644 (file)
@@ -25,10 +25,10 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_SigProc_FLP.h"\r
+#include "silk_SigProc_FLP.h"\r
 \r
 /* inner product of two SKP_float arrays, with result as double     */\r
-double SKP_Silk_inner_product_FLP(      /* O    result              */\r
+double silk_inner_product_FLP(      /* O    result              */\r
     const SKP_float     *data1,         /* I    vector 1            */\r
     const SKP_float     *data2,         /* I    vector 2            */\r
     SKP_int             dataSize        /* I    length of vectors   */\r
similarity index 74%
rename from silk/float/SKP_Silk_k2a_FLP.c
rename to silk/float/silk_k2a_FLP.c
index d6d4b16..8aec7da 100644 (file)
@@ -25,26 +25,17 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-/*                                                                      *\r
- * SKP_Silk_k2a.c                                                     *\r
- *                                                                      *\r
- * step up function, converts reflection coefficients to prediction     *\r
- * coefficients                                                         *\r
- *                                                                      *\r
- * Copyright 2008 (c), Skype Limited                                    *\r
- * Date: 080103                                                         *\r
- *                                                                      */\r
-#include "SKP_Silk_SigProc_FLP.h"\r
+#include "silk_SigProc_FLP.h"\r
 \r
 /* step up function, converts reflection coefficients to prediction coefficients */\r
-void SKP_Silk_k2a_FLP(\r
+void silk_k2a_FLP(\r
     SKP_float       *A,                 /* O:   prediction coefficients [order]             */\r
     const SKP_float *rc,                /* I:   reflection coefficients [order]             */\r
     SKP_int32       order               /* I:   prediction order                            */\r
 )\r
 {\r
     SKP_int   k, n;\r
-    SKP_float Atmp[ SKP_Silk_MAX_ORDER_LPC ];\r
+    SKP_float Atmp[ SILK_MAX_ORDER_LPC ];\r
 \r
     for( k = 0; k < order; k++ ){\r
         for( n = 0; n < k; n++ ){\r
similarity index 93%
rename from silk/float/SKP_Silk_levinsondurbin_FLP.c
rename to silk/float/silk_levinsondurbin_FLP.c
index 6b09f02..b58a48a 100644 (file)
@@ -25,10 +25,10 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#include "SKP_Silk_SigProc_FLP.h"\r
+#include "silk_SigProc_FLP.h"\r
 \r
 /* Solve the normal equations using the Levinson-Durbin recursion */\r
-SKP_float SKP_Silk_levinsondurbin_FLP(    /* O    prediction error energy                     */\r
+SKP_float silk_levinsondurbin_FLP(    /* O    prediction error energy                     */\r
     SKP_float       A[],                /* O    prediction coefficients [order]             */\r
     const SKP_float corr[],             /* I    input auto-correlations [order + 1]         */\r
     const SKP_int   order               /* I    prediction order                            */\r
similarity index 83%
rename from silk/float/SKP_Silk_main_FLP.h
rename to silk/float/silk_main_FLP.h
index faa20c8..5d03f0c 100644 (file)
@@ -25,15 +25,15 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
-#ifndef SKP_SILK_MAIN_FLP_H\r
-#define SKP_SILK_MAIN_FLP_H\r
-\r
-#include "SKP_Silk_SigProc_FLP.h"\r
-#include "SKP_Silk_SigProc_FIX.h"\r
-#include "SKP_Silk_structs_FLP.h"\r
-#include "SKP_Silk_main.h"\r
-#include "SKP_Silk_define.h"\r
-#include "SKP_debug.h"\r
+#ifndef SILK_MAIN_FLP_H\r
+#define SILK_MAIN_FLP_H\r
+\r
+#include "silk_SigProc_FLP.h"\r
+#include "silk_SigProc_FIX.h"\r
+#include "silk_structs_FLP.h"\r
+#include "silk_main.h"\r
+#include "silk_define.h"\r
+#include "silk_debug.h"\r
 #include "entenc.h"\r
 \r
 #ifdef __cplusplus\r
@@ -41,33 +41,42 @@ extern "C"
 {\r
 #endif\r
 \r
+#define silk_encoder_state_Fxx      silk_encoder_state_FLP\r
+#define silk_encode_frame_Fxx       silk_encode_frame_FLP\r
+\r
 /*********************/\r
 /* Encoder Functions */\r
 /*********************/\r
 \r
+/* High-pass filter with cutoff frequency adaptation based on pitch lag statistics */\r
+void silk_HP_variable_cutoff(\r
+    silk_encoder_state_Fxx          state_Fxx[],        /* I/O  Encoder states                          */\r
+    const SKP_int                   nChannels           /* I    Number of channels                      */\r
+);\r
+\r
 /* Encoder main function */\r
-SKP_int SKP_Silk_encode_frame_FLP( \r
-    SKP_Silk_encoder_state_FLP      *psEnc,             /* I/O  Encoder state FLP                       */\r
+SKP_int silk_encode_frame_FLP( \r
+    silk_encoder_state_FLP          *psEnc,             /* I/O  Encoder state FLP                       */\r
     SKP_int32                       *pnBytesOut,        /*   O  Number of payload bytes;                */\r
-    ec_enc                          *psRangeEnc         /* I/O  compressor data structure                */\r
+    ec_enc                          *psRangeEnc         /* I/O  compressor data structure               */\r
 );\r
 \r
 /* Low Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode with lower bitrate           */\r
-void SKP_Silk_LBRR_encode_FLP(\r
-    SKP_Silk_encoder_state_FLP      *psEnc,             /* I/O  Encoder state FLP                       */\r
-    SKP_Silk_encoder_control_FLP    *psEncCtrl,         /* I/O  Encoder control FLP                     */\r
+void silk_LBRR_encode_FLP(\r
+    silk_encoder_state_FLP          *psEnc,             /* I/O  Encoder state FLP                       */\r
+    silk_encoder_control_FLP        *psEncCtrl,         /* I/O  Encoder control FLP                     */\r
     const SKP_float                 xfw[]               /* I    Input signal                            */\r
 );\r
 \r
 /* Initializes the Silk encoder state */\r
-SKP_int SKP_Silk_init_encoder(\r
-    SKP_Silk_encoder_state_FLP      *psEnc              /* I/O  Encoder state FLP                       */\r
+SKP_int silk_init_encoder(\r
+    silk_encoder_state_FLP          *psEnc              /* I/O  Encoder state FLP                       */\r
 );\r
 \r
 /* Control the Silk encoder */\r
-SKP_int SKP_Silk_control_encoder( \r
-    SKP_Silk_encoder_state_FLP      *psEnc,             /* I/O  Pointer to Silk encoder state FLP       */\r
-    SKP_SILK_SDK_EncControlStruct   *encControl,        /* I:   Control structure                       */\r
+SKP_int silk_control_encoder( \r
+    silk_encoder_state_FLP          *psEnc,             /* I/O  Pointer to Silk encoder state FLP       */\r
+    silk_EncControlStruct           *encControl,        /* I:   Control structure                       */\r
     const SKP_int32                 TargetRate_bps,     /* I    Target max bitrate (bps)                */\r
     const SKP_int                   allow_bw_switch,    /* I    Flag to allow switching audio bandwidth */\r
     const SKP_int                   channelNb          &