The response has been limited to 50k tokens of the smallest files in the repo. You can remove this limitation by removing the max tokens filter.
├── LICENSE
├── README.md
├── converter.sh
├── converter_beta.sh
├── silk
    ├── Makefile
    ├── interface
    │   ├── SKP_Silk_SDK_API.h
    │   ├── SKP_Silk_control.h
    │   ├── SKP_Silk_errors.h
    │   └── SKP_Silk_typedef.h
    ├── src
    │   ├── SKP_Silk_A2NLSF.c
    │   ├── SKP_Silk_A2NLSF_arm.S
    │   ├── SKP_Silk_AsmHelper.h
    │   ├── SKP_Silk_AsmPreproc.h
    │   ├── SKP_Silk_CNG.c
    │   ├── SKP_Silk_HP_variable_cutoff_FIX.c
    │   ├── SKP_Silk_Inlines.h
    │   ├── SKP_Silk_LBRR_reset.c
    │   ├── SKP_Silk_LPC_inv_pred_gain.c
    │   ├── SKP_Silk_LPC_synthesis_filter.c
    │   ├── SKP_Silk_LPC_synthesis_order16.c
    │   ├── SKP_Silk_LP_variable_cutoff.c
    │   ├── SKP_Silk_LSF_cos_table.c
    │   ├── SKP_Silk_LTP_analysis_filter_FIX.c
    │   ├── SKP_Silk_LTP_scale_ctrl_FIX.c
    │   ├── SKP_Silk_MA.c
    │   ├── SKP_Silk_MA_arm.S
    │   ├── SKP_Silk_NLSF2A.c
    │   ├── SKP_Silk_NLSF2A_stable.c
    │   ├── SKP_Silk_NLSF_MSVQ_decode.c
    │   ├── SKP_Silk_NLSF_MSVQ_encode_FIX.c
    │   ├── SKP_Silk_NLSF_VQ_rate_distortion_FIX.c
    │   ├── SKP_Silk_NLSF_VQ_sum_error_FIX.c
    │   ├── SKP_Silk_NLSF_VQ_sum_error_FIX_arm.S
    │   ├── SKP_Silk_NLSF_VQ_weights_laroia.c
    │   ├── SKP_Silk_NLSF_stabilize.c
    │   ├── SKP_Silk_NSQ.c
    │   ├── SKP_Silk_NSQ_del_dec.c
    │   ├── SKP_Silk_PLC.c
    │   ├── SKP_Silk_PLC.h
    │   ├── SKP_Silk_SigProc_FIX.h
    │   ├── SKP_Silk_VAD.c
    │   ├── SKP_Silk_VQ_nearest_neighbor_FIX.c
    │   ├── SKP_Silk_allpass_int_arm.S
    │   ├── SKP_Silk_ana_filt_bank_1.c
    │   ├── SKP_Silk_ana_filt_bank_1_arm.S
    │   ├── SKP_Silk_apply_sine_window.c
    │   ├── SKP_Silk_array_maxabs.c
    │   ├── SKP_Silk_array_maxabs_arm.S
    │   ├── SKP_Silk_autocorr.c
    │   ├── SKP_Silk_biquad.c
    │   ├── SKP_Silk_biquad_alt.c
    │   ├── SKP_Silk_burg_modified.c
    │   ├── SKP_Silk_bwexpander.c
    │   ├── SKP_Silk_bwexpander_32.c
    │   ├── SKP_Silk_clz_arm.S
    │   ├── SKP_Silk_code_signs.c
    │   ├── SKP_Silk_common_pitch_est_defines.h
    │   ├── SKP_Silk_control_audio_bandwidth.c
    │   ├── SKP_Silk_control_codec_FIX.c
    │   ├── SKP_Silk_corrMatrix_FIX.c
    │   ├── SKP_Silk_create_init_destroy.c
    │   ├── SKP_Silk_dec_API.c
    │   ├── SKP_Silk_decode_core.c
    │   ├── SKP_Silk_decode_core_arm.S
    │   ├── SKP_Silk_decode_frame.c
    │   ├── SKP_Silk_decode_parameters.c
    │   ├── SKP_Silk_decode_pitch.c
    │   ├── SKP_Silk_decode_pulses.c
    │   ├── SKP_Silk_decoder_set_fs.c
    │   ├── SKP_Silk_define.h
    │   ├── SKP_Silk_detect_SWB_input.c
    │   ├── SKP_Silk_div_oabi.c
    │   ├── SKP_Silk_enc_API.c
    │   ├── SKP_Silk_encode_frame_FIX.c
    │   ├── SKP_Silk_encode_parameters.c
    │   ├── SKP_Silk_encode_pulses.c
    │   ├── SKP_Silk_find_LPC_FIX.c
    │   ├── SKP_Silk_find_LTP_FIX.c
    │   ├── SKP_Silk_find_pitch_lags_FIX.c
    │   ├── SKP_Silk_find_pred_coefs_FIX.c
    │   ├── SKP_Silk_gain_quant.c
    │   ├── SKP_Silk_init_encoder_FIX.c
    │   ├── SKP_Silk_inner_prod_aligned.c
    │   ├── SKP_Silk_inner_prod_aligned_arm.S
    │   ├── SKP_Silk_interpolate.c
    │   ├── SKP_Silk_k2a.c
    │   ├── SKP_Silk_k2a_Q16.c
    │   ├── SKP_Silk_lin2log.c
    │   ├── SKP_Silk_lin2log_arm.S
    │   ├── SKP_Silk_log2lin.c
    │   ├── SKP_Silk_macros.h
    │   ├── SKP_Silk_macros_arm.h
    │   ├── SKP_Silk_main.h
    │   ├── SKP_Silk_main_FIX.h
    │   ├── SKP_Silk_noise_shape_analysis_FIX.c
    │   ├── SKP_Silk_pitch_analysis_core.c
    │   ├── SKP_Silk_pitch_est_defines.h
    │   ├── SKP_Silk_pitch_est_tables.c
    │   ├── SKP_Silk_prefilter_FIX.c
    │   ├── SKP_Silk_prefilter_FIX_arm.S
    │   ├── SKP_Silk_process_NLSFs_FIX.c
    │   ├── SKP_Silk_process_gains_FIX.c
    │   ├── SKP_Silk_quant_LTP_gains_FIX.c
    │   ├── SKP_Silk_range_coder.c
    │   ├── SKP_Silk_regularize_correlations_FIX.c
    │   ├── SKP_Silk_resampler.c
    │   ├── SKP_Silk_resampler_down2.c
    │   ├── SKP_Silk_resampler_down2_3.c
    │   ├── SKP_Silk_resampler_down2_arm.S
    │   ├── SKP_Silk_resampler_down3.c
    │   ├── SKP_Silk_resampler_private.h
    │   ├── SKP_Silk_resampler_private_AR2.c
    │   ├── SKP_Silk_resampler_private_AR2_arm.S
    │   ├── SKP_Silk_resampler_private_ARMA4.c
    │   ├── SKP_Silk_resampler_private_ARMA4_arm.S
    │   ├── SKP_Silk_resampler_private_IIR_FIR.c
    │   ├── SKP_Silk_resampler_private_IIR_FIR_arm.S
    │   ├── SKP_Silk_resampler_private_copy.c
    │   ├── SKP_Silk_resampler_private_down4.c
    │   ├── SKP_Silk_resampler_private_down_FIR.c
    │   ├── SKP_Silk_resampler_private_down_FIR_arm.S
    │   ├── SKP_Silk_resampler_private_up2_HQ.c
    │   ├── SKP_Silk_resampler_private_up2_HQ_arm.S
    │   ├── SKP_Silk_resampler_private_up4.c
    │   ├── SKP_Silk_resampler_rom.c
    │   ├── SKP_Silk_resampler_rom.h
    │   ├── SKP_Silk_resampler_rom_arm.S
    │   ├── SKP_Silk_resampler_structs.h
    │   ├── SKP_Silk_resampler_up2.c
    │   ├── SKP_Silk_resampler_up2_arm.S
    │   ├── SKP_Silk_residual_energy16_FIX.c
    │   ├── SKP_Silk_residual_energy_FIX.c
    │   ├── SKP_Silk_scale_copy_vector16.c
    │   ├── SKP_Silk_scale_vector.c
    │   ├── SKP_Silk_schur.c
    │   ├── SKP_Silk_schur64.c
    │   ├── SKP_Silk_schur64_arm.S
    │   ├── SKP_Silk_setup_complexity.h
    │   ├── SKP_Silk_shell_coder.c
    │   ├── SKP_Silk_sigm_Q15.c
    │   ├── SKP_Silk_sigm_Q15_arm.S
    │   ├── SKP_Silk_solve_LS_FIX.c
    │   ├── SKP_Silk_sort.c
    │   ├── SKP_Silk_structs.h
    │   ├── SKP_Silk_structs_FIX.h
    │   ├── SKP_Silk_sum_sqr_shift.c
    │   ├── SKP_Silk_sum_sqr_shift_arm.S
    │   ├── SKP_Silk_tables.h
    │   ├── SKP_Silk_tables_LTP.c
    │   ├── SKP_Silk_tables_NLSF_CB0_10.c
    │   ├── SKP_Silk_tables_NLSF_CB0_10.h
    │   ├── SKP_Silk_tables_NLSF_CB0_16.c
    │   ├── SKP_Silk_tables_NLSF_CB0_16.h
    │   ├── SKP_Silk_tables_NLSF_CB1_10.c
    │   ├── SKP_Silk_tables_NLSF_CB1_10.h
    │   ├── SKP_Silk_tables_NLSF_CB1_16.c
    │   ├── SKP_Silk_tables_NLSF_CB1_16.h
    │   ├── SKP_Silk_tables_gain.c
    │   ├── SKP_Silk_tables_other.c
    │   ├── SKP_Silk_tables_pitch_lag.c
    │   ├── SKP_Silk_tables_pulses_per_block.c
    │   ├── SKP_Silk_tables_sign.c
    │   ├── SKP_Silk_tables_type_offset.c
    │   ├── SKP_Silk_tuning_parameters.h
    │   ├── SKP_Silk_warped_autocorrelation_FIX.c
    │   └── SKP_Silk_warped_autocorrelation_FIX_arm.S
    └── test
    │   ├── Decoder.c
    │   ├── Encoder.c
    │   └── signalCompare.c
└── windows
    ├── CHANGELOG.md
    ├── README.md
    ├── ffmpeg compatible with XP.zip
    ├── ffmpeg.zip
    ├── lame.exe
    ├── screenshots
        ├── 20160413145612.png
        ├── 20160413145643.png
        ├── 20160413171427.png
        ├── 20160413171521.png
        ├── 20160601170900.png
        ├── 20160601170959.png
        ├── 20160928221726.png
        ├── 20160928221818.png
        ├── 20170528161523.png
        └── 20170528161558.png
    ├── silk2mp3.exe
    ├── silk_v3_decoder.exe
    └── silk_v3_encoder.exe


/LICENSE:
--------------------------------------------------------------------------------
 1 | The MIT License (MIT)
 2 | 
 3 | Copyright (c) 2020 Karl Chen
 4 | 
 5 | Permission is hereby granted, free of charge, to any person obtaining a copy
 6 | of this software and associated documentation files (the "Software"), to deal
 7 | in the Software without restriction, including without limitation the rights
 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 | 
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 | 
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 | 


--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
  1 | ## Description
  2 | Decode silk v3 audio files (like wechat amr, aud files, qq slk files) and convert to other format (like mp3).
  3 | Batch conversion support.
  4 | 
  5 | <a href="https://github.com/kn007/silk-v3-decoder/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg?style=flat"></a>
  6 | 
  7 | ```
  8 | silk-v3-decoder            (Decode Silk V3 Audio Files)
  9 |   |
 10 |   |---  silk               (Skype Silk Codec)
 11 |   |
 12 |   |---  windows            (For Windows Platform Users Program)
 13 |   |
 14 |   |---  LICENSE            (License)
 15 |   |
 16 |   |---  README.md          (Readme)
 17 |   |
 18 |   |---  converter.sh       (Converter Shell Script)
 19 |   |
 20 |   |---  converter_beta.sh  (Converter Shell Script(Beta))
 21 | ```
 22 | 
 23 | ## Requirement
 24 | 
 25 | * gcc
 26 | * ffmpeg
 27 | 
 28 | ## How To Use
 29 | 
 30 | ```
 31 | sh converter.sh silk_v3_file/input_folder output_format/output_folder flag(format)
 32 | ```
 33 | E.g., convert a file:
 34 | ```
 35 | sh converter.sh 33921FF3774A773BB193B6FD4AD7C33E.slk mp3
 36 | ```
 37 | Notice: the `33921FF3774A773BB193B6FD4AD7C33E.slk` is an audio file you need to convert, the `mp3` is a format you need to output.
 38 | 
 39 | If you need to convert all audio files in one folder, now batch conversion support, using like this:
 40 | ```
 41 | sh converter.sh input ouput mp3
 42 | ```
 43 | Notice: the `input` folder is content the audio files you need to convert, the `output` folder is content the audio files after conversion finished, the `mp3` is a format you need to output.
 44 | 
 45 | If you need to convert files on the `Windows` platfrom, [click here](https://dl.kn007.net/directlink/silk2mp3.zip "silk2mp3.zip") to download zip package for `silk2mp3.exe` to convert, also can <a href='/windows' target="_blank">click here</a> to get more information.
 46 | 
 47 | ## Other
 48 | 
 49 | Also provide silk v3 encode codec, compatible with Wechat/QQ.
 50 | 
 51 | ## About
 52 | 
 53 | [kn007's blog](https://kn007.net) 
 54 | 
 55 | ***
 56 | 
 57 | ## 中文说明
 58 | 解码silk v3音频文件(类似微信的amr和aud文件、QQ的slk文件)并转换为其它格式(如MP3)。
 59 | 支持批量转换。
 60 | 
 61 | <a href="https://github.com/kn007/silk-v3-decoder/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg?style=flat"></a>
 62 | 
 63 | ```
 64 | silk-v3-decoder            (解码silk v3音频文件)
 65 |   |
 66 |   |---  silk               (Skype Silk源码)
 67 |   |
 68 |   |---  windows            (可用于Windows平台的应用程序)
 69 |   |
 70 |   |---  LICENSE            (软件使用范围许可)
 71 |   |
 72 |   |---  README.md          (说明)
 73 |   |
 74 |   |---  converter.sh       (转换脚本)
 75 |   |
 76 |   |---  converter_beta.sh  (转换脚本(测试版))
 77 | ```
 78 | 
 79 | ## 依赖组件
 80 | 
 81 | * gcc
 82 | * ffmpeg
 83 | 
 84 | ## 如何使用
 85 | 
 86 | ```
 87 | sh converter.sh silk_v3_file/input_folder output_format/output_folder flag(format)
 88 | ```
 89 | 比如转换一个文件,使用:
 90 | ```
 91 | sh converter.sh 33921FF3774A773BB193B6FD4AD7C33E.slk mp3
 92 | ```
 93 | 注意:其中`33921FF3774A773BB193B6FD4AD7C33E.slk`是要转换的文件,而`mp3`是最终转换后输出的格式。
 94 | 
 95 | 如果你需要批量转换,比如转换某个目录,那么使用:
 96 | ```
 97 | sh converter.sh input ouput mp3
 98 | ```
 99 | 注意:其中`input`是要转换的目录,而`output`是最终转换后音频输出的目录,最后的`mp3`参数是最终转换后输出的格式。
100 | 
101 | 如果你需要在`Windows`下使用该程序,请下载[silk2mp3.exe](https://dl.kn007.net/directlink/silk2mp3.zip "silk2mp3.zip")应用程序来完成转换,你可<a href='/windows' target="_blank">点击这里</a>来查看更多Windows下如何使用的相关说明。
102 | 
103 | ## 其他说明
104 | 
105 | 如果你需要对音频文件进行silk v3编码,源码也已经提供,并且对微信、QQ进行了兼容,详见参数。
106 | 
107 | ## 关于作者
108 | 
109 | [kn007的个人博客](https://kn007.net) 
110 | 


--------------------------------------------------------------------------------
/converter.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/bash
 2 | # File: converter.sh
 3 | # Date: August 19th, 2016
 4 | # Time: 18:56:52 +0800
 5 | # Author: kn007 <kn007@126.com>
 6 | # Blog: https://kn007.net
 7 | # Link: https://github.com/kn007/silk-v3-decoder
 8 | # Usage: sh converter.sh silk_v3_file/input_folder output_format/output_folder flag(format)
 9 | # Flag: not define   ----  not define, convert a file
10 | #       other value  ----  format, convert a folder, batch conversion support
11 | # Requirement: gcc ffmpeg
12 | 
13 | # Colors
14 | RED="$(tput setaf 1 2>/dev/null || echo '\e[0;31m')"
15 | GREEN="$(tput setaf 2 2>/dev/null || echo '\e[0;32m')"
16 | YELLOW="$(tput setaf 3 2>/dev/null || echo '\e[0;33m')"
17 | WHITE="$(tput setaf 7 2>/dev/null || echo '\e[0;37m')"
18 | RESET="$(tput sgr 0 2>/dev/null || echo '\e[0m')"
19 | 
20 | # Main
21 | cur_dir=$(cd `dirname $0`; pwd)
22 | 
23 | if [ ! -r "$cur_dir/silk/decoder" ]; then
24 | 	echo -e "${WHITE}[Notice]${RESET} Silk v3 Decoder is not found, compile it."
25 | 	cd $cur_dir/silk
26 | 	make && make decoder
27 | 	[ ! -r "$cur_dir/silk/decoder" ]&&echo -e "${RED}[Error]${RESET} Silk v3 Decoder Compile False, Please Check Your System For GCC."&&exit
28 | 	echo -e "${WHITE}========= Silk v3 Decoder Compile Finish =========${RESET}"
29 | fi
30 | 
31 | cd $cur_dir
32 | 
33 | while [ $3 ]; do
34 | 	[[ ! -z "$(pidof ffmpeg)" ]]&&echo -e "${RED}[Error]${RESET} ffmpeg is occupied by another application, please check it."&&exit
35 | 	[ ! -d "$1" ]&&echo -e "${RED}[Error]${RESET} Input folder not found, please check it."&&exit
36 | 	TOTAL=$(ls $1|wc -l)
37 | 	[ ! -d "$2" ]&&mkdir "$2"&&echo -e "${WHITE}[Notice]${RESET} Output folder not found, create it."
38 | 	[ ! -d "$2" ]&&echo -e "${RED}[Error]${RESET} Output folder could not be created, please check it."&&exit
39 | 	CURRENT=0
40 | 	echo -e "${WHITE}========= Batch Conversion Start ==========${RESET}"
41 | 	ls $1 | while read line; do
42 | 		let CURRENT+=1
43 | 		$cur_dir/silk/decoder "$1/$line" "$2/$line.pcm" > /dev/null 2>&1
44 | 		if [ ! -f "$2/$line.pcm" ]; then
45 | 			ffmpeg -y -i "$1/$line" "$2/${line%.*}.$3" > /dev/null 2>&1 &
46 | 			ffmpeg_pid=$!
47 | 			while kill -0 "$ffmpeg_pid"; do sleep 1; done > /dev/null 2>&1
48 | 			[ -f "$2/${line%.*}.$3" ]&&echo -e "[$CURRENT/$TOTAL]${GREEN}[OK]${RESET} Convert $line to ${line%.*}.$3 success, ${YELLOW}but not a silk v3 encoded file.${RESET}"&&continue
49 | 			echo -e "[$CURRENT/$TOTAL]${YELLOW}[Warning]${RESET} Convert $line false, maybe not a silk v3 encoded file."&&continue
50 | 		fi
51 | 		ffmpeg -y -f s16le -ar 24000 -ac 1 -i "$2/$line.pcm" "$2/${line%.*}.$3" > /dev/null 2>&1 &
52 | 		ffmpeg_pid=$!
53 | 		while kill -0 "$ffmpeg_pid"; do sleep 1; done > /dev/null 2>&1
54 | 		rm "$2/$line.pcm"
55 | 		[ ! -f "$2/${line%.*}.$3" ]&&echo -e "[$CURRENT/$TOTAL]${YELLOW}[Warning]${RESET} Convert $line false, maybe ffmpeg no format handler for $3."&&continue
56 | 		echo -e "[$CURRENT/$TOTAL]${GREEN}[OK]${RESET} Convert $line To ${line%.*}.$3 Finish."
57 | 	done
58 | 	echo -e "${WHITE}========= Batch Conversion Finish =========${RESET}"
59 | 	exit
60 | done
61 | 
62 | $cur_dir/silk/decoder "$1" "$1.pcm" > /dev/null 2>&1
63 | if [ ! -f "$1.pcm" ]; then
64 | 	ffmpeg -y -i "$1" "${1%.*}.$2" > /dev/null 2>&1 &
65 | 	ffmpeg_pid=$!
66 | 	while kill -0 "$ffmpeg_pid"; do sleep 1; done > /dev/null 2>&1
67 | 	[ -f "${1%.*}.$2" ]&&echo -e "${GREEN}[OK]${RESET} Convert $1 to ${1%.*}.$2 success, ${YELLOW}but not a silk v3 encoded file.${RESET}"&&exit
68 | 	echo -e "${YELLOW}[Warning]${RESET} Convert $1 false, maybe not a silk v3 encoded file."&&exit
69 | fi
70 | ffmpeg -y -f s16le -ar 24000 -ac 1 -i "$1.pcm" "${1%.*}.$2" > /dev/null 2>&1
71 | ffmpeg_pid=$!
72 | while kill -0 "$ffmpeg_pid"; do sleep 1; done > /dev/null 2>&1
73 | rm "$1.pcm"
74 | [ ! -f "${1%.*}.$2" ]&&echo -e "${YELLOW}[Warning]${RESET} Convert $1 false, maybe ffmpeg no format handler for $2."&&exit
75 | echo -e "${GREEN}[OK]${RESET} Convert $1 To ${1%.*}.$2 Finish."
76 | exit
77 | 


--------------------------------------------------------------------------------
/converter_beta.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/bash
 2 | # File: converter_beta.sh
 3 | # Date: March 20th, 2017
 4 | # Time: 22:05:12 +0800
 5 | # Author: kn007 <kn007@126.com>
 6 | # Blog: https://kn007.net
 7 | # Link: https://github.com/kn007/silk-v3-decoder
 8 | # Usage: sh converter.sh silk_v3_file/input_folder output_format/output_folder flag(format)
 9 | # Flag: not define   ----  not define, convert a file
10 | #       other value  ----  format, convert a folder, batch conversion support
11 | # Requirement: gcc ffmpeg
12 | 
13 | # Colors
14 | RED="\e[31;1m"
15 | GREEN="\e[32;1m"
16 | YELLOW="\e[33;1m"
17 | WHITE="\e[37;1m"
18 | RESET="\e[0m"
19 | 
20 | # Main
21 | cur_dir=$(cd `dirname $0`; pwd)
22 | 
23 | if [ ! -r "$cur_dir/silk/decoder" ]; then
24 | 	echo -e "${WHITE}[Notice]${RESET} Silk v3 Decoder is not found, compile it."
25 | 	cd $cur_dir/silk
26 | 	make && make decoder
27 | 	[ ! -r "$cur_dir/silk/decoder" ]&&echo -e "${RED}[Error]${RESET} Silk v3 Decoder Compile False, Please Check Your System For GCC."&&exit
28 | 	echo -e "${WHITE}========= Silk v3 Decoder Compile Finish =========${RESET}"
29 | fi
30 | 
31 | cd $cur_dir
32 | 
33 | while [ $3 ]; do
34 | 	pidof /usr/bin/ffmpeg&&echo -e "${RED}[Error]${RESET} ffmpeg is occupied by another application, please check it."&&exit
35 | 	[ ! -d "$1" ]&&echo -e "${RED}[Error]${RESET} Input folder not found, please check it."&&exit
36 | 	TOTAL=$(ls $1|wc -l)
37 | 	[ ! -d "$2" ]&&mkdir "$2"&&echo -e "${WHITE}[Notice]${RESET} Output folder not found, create it."
38 | 	[ ! -d "$2" ]&&echo -e "${RED}[Error]${RESET} Output folder could not be created, please check it."&&exit
39 | 	CURRENT=0
40 | 	echo -e "${WHITE}========= Batch Conversion Start ==========${RESET}"
41 | 	ls $1 | while read line; do
42 | 		let CURRENT+=1
43 | 		$cur_dir/silk/decoder "$1/$line" "$2/$line.pcm" > /dev/null 2>&1
44 | 		if [ ! -f "$2/$line.pcm" ]; then
45 | 			ffmpeg -y -i "$1/$line" "$2/${line%.*}.$3" > /dev/null 2>&1 &
46 | 			ffmpeg_pid=$!
47 | 			while kill -0 "$ffmpeg_pid"; do sleep 1; done > /dev/null 2>&1
48 | 			[ -f "$2/${line%.*}.$3" ]&&echo -e "[$CURRENT/$TOTAL]${GREEN}[OK]${RESET} Convert $line to ${line%.*}.$3 success, ${YELLOW}but not a silk v3 encoded file.${RESET}"&&continue
49 | 			sed -i '1i\\#\!AMR' "$1/$line"
50 | 			ffmpeg -y -i "$1/$line" "$2/${line%.*}.$3" > /dev/null 2>&1 &
51 | 			ffmpeg_pid=$!
52 | 			while kill -0 "$ffmpeg_pid"; do sleep 1; done > /dev/null 2>&1
53 | 			[ -f "$2/${line%.*}.$3" ]&&echo -e "[$CURRENT/$TOTAL]${YELLOW}[Warning]${RESET} Could not recognize this file, force using ffmpeg convert $line to ${line%.*}.$3 success, maybe have error.${RESET}"&&continue
54 | 			echo -e "[$CURRENT/$TOTAL]${RED}[Error]${RESET} Convert $line false, maybe not a audio file."&&continue
55 | 		fi
56 | 		ffmpeg -y -f s16le -ar 24000 -ac 1 -i "$2/$line.pcm" "$2/${line%.*}.$3" > /dev/null 2>&1 &
57 | 		ffmpeg_pid=$!
58 | 		while kill -0 "$ffmpeg_pid"; do sleep 1; done > /dev/null 2>&1
59 | 		rm "$2/$line.pcm"
60 | 		[ ! -f "$2/${line%.*}.$3" ]&&echo -e "[$CURRENT/$TOTAL]${RED}[Error]${RESET} Convert $line false, maybe ffmpeg no format handler for $3."&&continue
61 | 		echo -e "[$CURRENT/$TOTAL]${GREEN}[OK]${RESET} Convert $line To ${line%.*}.$3 Finish."
62 | 	done
63 | 	echo -e "${WHITE}========= Batch Conversion Finish =========${RESET}"
64 | 	exit
65 | done
66 | 
67 | $cur_dir/silk/decoder "$1" "$1.pcm" > /dev/null 2>&1
68 | if [ ! -f "$1.pcm" ]; then
69 | 	ffmpeg -y -i "$1" "${1%.*}.$2" > /dev/null 2>&1 &
70 | 	ffmpeg_pid=$!
71 | 	while kill -0 "$ffmpeg_pid"; do sleep 1; done > /dev/null 2>&1
72 | 	[ -f "${1%.*}.$2" ]&&echo -e "${GREEN}[OK]${RESET} Convert $1 to ${1%.*}.$2 success, ${YELLOW}but not a silk v3 encoded file.${RESET}"&&exit
73 | 	sed -i '1i\\#\!AMR' "$1"
74 | 	ffmpeg -y -i "$1" "${1%.*}.$2" > /dev/null 2>&1 &
75 | 	ffmpeg_pid=$!
76 | 	while kill -0 "$ffmpeg_pid"; do sleep 1; done > /dev/null 2>&1
77 | 	[ -f "${1%.*}.$2" ]&&echo -e "${YELLOW}[Warning]${RESET} Could not recognize this file, force using ffmpeg convert $1 to ${1%.*}.$2 success, maybe have error.${RESET}"&&exit
78 | 	echo -e "${RED}[Error]${RESET} Convert $1 false, maybe not a audio file."&&exit
79 | fi
80 | ffmpeg -y -f s16le -ar 24000 -ac 1 -i "$1.pcm" "${1%.*}.$2" > /dev/null 2>&1
81 | ffmpeg_pid=$!
82 | while kill -0 "$ffmpeg_pid"; do sleep 1; done > /dev/null 2>&1
83 | rm "$1.pcm"
84 | [ ! -f "${1%.*}.$2" ]&&echo -e "${RED}[Error]${RESET} Convert $1 false, maybe ffmpeg no format handler for $2."&&exit
85 | echo -e "${GREEN}[OK]${RESET} Convert $1 To ${1%.*}.$2 Finish."
86 | exit
87 | 


--------------------------------------------------------------------------------
/silk/Makefile:
--------------------------------------------------------------------------------
  1 | #
  2 | # Makefile for Silk SDK
  3 | #
  4 | # Copyright (c) 2012, Skype Limited
  5 | # All rights reserved.
  6 | #
  7 | 
  8 | #Platform detection and settings
  9 | 
 10 | BUILD_OS := $(shell uname | sed -e 's/^.*Darwin.*/MacOS-X/ ; s/^.*CYGWIN.*/Windows/')
 11 | 
 12 | BUILD_ARCHITECTURE := $(shell uname -m | sed -e 's/i686/i386/')
 13 | 
 14 | EXESUFFIX =
 15 | LIBPREFIX = lib
 16 | LIBSUFFIX = .a
 17 | OBJSUFFIX = .o
 18 | 
 19 | CC     = $(TOOLCHAIN_PREFIX)gcc$(TOOLCHAIN_SUFFIX)
 20 | CXX    = $(TOOLCHAIN_PREFIX)g++$(TOOLCHAIN_SUFFIX)
 21 | AR     = $(TOOLCHAIN_PREFIX)ar
 22 | RANLIB = $(TOOLCHAIN_PREFIX)ranlib
 23 | CP     = $(TOOLCHAIN_PREFIX)cp
 24 | 
 25 | cppflags-from-defines 	= $(addprefix -D,$(1))
 26 | cppflags-from-includes 	= $(addprefix -I,$(1))
 27 | ldflags-from-ldlibdirs 	= $(addprefix -L,$(1))
 28 | ldlibs-from-libs        = $(addprefix -l,$(1))
 29 | 
 30 | ifneq (,$(TARGET_CPU))
 31 | 	CFLAGS	+= -mcpu=$(TARGET_CPU)
 32 | 	ifneq (,$(TARGET_TUNE))
 33 | 		CFLAGS	+= -mtune=$(TARGET_TUNE)
 34 | 	else
 35 | 		CFLAGS	+= -mtune=$(TARGET_CPU)
 36 | 	endif
 37 | endif
 38 | ifneq (,$(TARGET_FPU))
 39 | 	CFLAGS += -mfpu=$(TARGET_FPU)
 40 | endif
 41 | ifneq (,$(TARGET_ARCH))
 42 | 	CFLAGS	+= -march=$(TARGET_ARCH)
 43 | endif
 44 | # Helper to make NEON testing easier, when using USE_NEON=yes do not set TARGET_CPU or TARGET_FPU
 45 | ifeq (yes,$(USE_NEON))
 46 | 	CFLAGS += -mcpu=cortex-a8 -mfloat-abi=softfp -mfpu=neon
 47 | endif
 48 | 
 49 | ifeq ($(BUILD_OS), MacOS-X)
 50 |     #$(info Detected macOS, skipping -enable-threads in CFLAGS)
 51 |     CFLAGS      += -Wall
 52 | else
 53 |     CFLAGS      += -Wall -enable-threads -O3
 54 | endif
 55 | 
 56 | CFLAGS  += $(call cppflags-from-defines,$(CDEFINES))
 57 | CFLAGS  += $(call cppflags-from-defines,$(ADDED_DEFINES))
 58 | CFLAGS  += $(call cppflags-from-includes,$(CINCLUDES))
 59 | LDFLAGS += $(call ldflags-from-ldlibdirs,$(LDLIBDIRS))
 60 | LDLIBS  += $(call ldlibs-from-libs,$(LIBS))
 61 | 
 62 | COMPILE.c.cmdline   = $(CC) -c $(CFLAGS) $(ADDED_CFLAGS) -o $@ 
lt;
 63 | COMPILE.S.cmdline   = $(CC) -c $(CFLAGS) $(ADDED_CFLAGS) -o $@ 
lt;
 64 | COMPILE.cpp.cmdline = $(CXX) -c $(CFLAGS) $(ADDED_CFLAGS) -o $@ 
lt;
 65 | LINK.o              = $(CXX) $(LDPREFLAGS) $(LDFLAGS)
 66 | LINK.o.cmdline      = $(LINK.o) $^ $(LDLIBS) -o $@$(EXESUFFIX)
 67 | ARCHIVE.cmdline     = $(AR) $(ARFLAGS) $@ $^ && $(RANLIB) $@
 68 | 
 69 | %$(OBJSUFFIX):%.c
 70 | 	$(COMPILE.c.cmdline)
 71 | 
 72 | %$(OBJSUFFIX):%.cpp
 73 | 	$(COMPILE.cpp.cmdline)
 74 | 
 75 | %$(OBJSUFFIX):%.S
 76 | 	$(COMPILE.S.cmdline)
 77 | 
 78 | # Directives
 79 | 
 80 | CINCLUDES += interface src test
 81 | 
 82 | # VPATH e.g. VPATH = src:../headers
 83 | VPATH = ./ \
 84 |         interface \
 85 |         src \
 86 |         test
 87 | 
 88 | # Variable definitions
 89 | LIB_NAME = SKP_SILK_SDK
 90 | TARGET = $(LIBPREFIX)$(LIB_NAME)$(LIBSUFFIX)
 91 | 
 92 | SRCS_C = $(wildcard src/*.c)
 93 | ifneq (,$(TOOLCHAIN_PREFIX))
 94 | 	SRCS_S = $(wildcard src/*.S)
 95 | 	OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(SRCS_C)) $(patsubst %.S,%$(OBJSUFFIX),$(SRCS_S))
 96 | else
 97 | 	OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(SRCS_C))
 98 | endif
 99 | 
100 | ENCODER_SRCS_C = test/Encoder.c
101 | ENCODER_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(ENCODER_SRCS_C))
102 | 
103 | DECODER_SRCS_C = test/Decoder.c
104 | DECODER_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(DECODER_SRCS_C))
105 | 
106 | SIGNALCMP_SRCS_C = test/signalCompare.c
107 | SIGNALCMP_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(SIGNALCMP_SRCS_C))
108 | 
109 | LIBS = \
110 | 	$(LIB_NAME)
111 | 
112 | LDLIBDIRS = ./
113 | 
114 | # Rules
115 | default: all
116 | 
117 | all: $(TARGET) decoder
118 | 
119 | lib: $(TARGET)
120 | 
121 | $(TARGET): $(OBJS)
122 | 	$(ARCHIVE.cmdline)
123 | 
124 | encoder$(EXESUFFIX): $(ENCODER_OBJS)
125 | 	$(LINK.o.cmdline)
126 | 
127 | decoder$(EXESUFFIX): $(DECODER_OBJS)
128 | 	$(LINK.o.cmdline)
129 | 
130 | signalcompare$(EXESUFFIX): $(SIGNALCMP_OBJS)
131 | 	$(LINK.o.cmdline)
132 | 
133 | clean:
134 | 	$(RM) $(TARGET)* $(OBJS) $(ENCODER_OBJS) $(DECODER_OBJS) \
135 | 		  $(SIGNALCMP_OBJS) $(TEST_OBJS) \
136 | 		  encoder$(EXESUFFIX) decoder$(EXESUFFIX) signalcompare$(EXESUFFIX)
137 | 
138 | 


--------------------------------------------------------------------------------
/silk/interface/SKP_Silk_control.h:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #ifndef SKP_SILK_CONTROL_H
29 | #define SKP_SILK_CONTROL_H
30 | 
31 | #include "SKP_Silk_typedef.h"
32 | 
33 | #ifdef __cplusplus
34 | extern "C"
35 | {
36 | #endif
37 | 
38 | /***********************************************/
39 | /* Structure for controlling encoder operation */
40 | /***********************************************/
41 | typedef struct {
42 |     /* I:   Input signal sampling rate in Hertz; 8000/12000/16000/24000                     */
43 |     SKP_int32 API_sampleRate;
44 | 
45 |     /* I:   Maximum internal sampling rate in Hertz; 8000/12000/16000/24000                 */
46 |     SKP_int32 maxInternalSampleRate;
47 | 
48 |     /* I:   Number of samples per packet; must be equivalent of 20, 40, 60, 80 or 100 ms    */
49 |     SKP_int packetSize;
50 | 
51 |     /* I:   Bitrate during active speech in bits/second; internally limited                 */
52 |     SKP_int32 bitRate;                        
53 | 
54 |     /* I:   Uplink packet loss in percent (0-100)                                           */
55 |     SKP_int packetLossPercentage;
56 |     
57 |     /* I:   Complexity mode; 0 is lowest; 1 is medium and 2 is highest complexity           */
58 |     SKP_int complexity;
59 | 
60 |     /* I:   Flag to enable in-band Forward Error Correction (FEC); 0/1                      */
61 |     SKP_int useInBandFEC;
62 | 
63 |     /* I:   Flag to enable discontinuous transmission (DTX); 0/1                            */
64 |     SKP_int useDTX;
65 | } SKP_SILK_SDK_EncControlStruct;
66 | 
67 | /**************************************************************************/
68 | /* Structure for controlling decoder operation and reading decoder status */
69 | /**************************************************************************/
70 | typedef struct {
71 |     /* I:   Output signal sampling rate in Hertz; 8000/12000/16000/24000                    */
72 |     SKP_int32 API_sampleRate;
73 | 
74 |     /* O:   Number of samples per frame                                                     */
75 |     SKP_int frameSize;
76 | 
77 |     /* O:   Frames per packet 1, 2, 3, 4, 5                                                 */
78 |     SKP_int framesPerPacket;
79 | 
80 |     /* O:   Flag to indicate that the decoder has remaining payloads internally             */
81 |     SKP_int moreInternalDecoderFrames;
82 | 
83 |     /* O:   Distance between main payload and redundant payload in packets                  */
84 |     SKP_int inBandFECOffset;
85 | } SKP_SILK_SDK_DecControlStruct;
86 | 
87 | #ifdef __cplusplus
88 | }
89 | #endif
90 | 
91 | #endif
92 | 


--------------------------------------------------------------------------------
/silk/interface/SKP_Silk_errors.h:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #ifndef SKP_SILK_ERRORS_H
29 | #define SKP_SILK_ERRORS_H
30 | 
31 | #ifdef __cplusplus
32 | extern "C"
33 | {
34 | #endif
35 | 
36 | /******************/
37 | /* Error messages */
38 | /******************/
39 | #define SKP_SILK_NO_ERROR                               0
40 | 
41 | /**************************/
42 | /* Encoder error messages */
43 | /**************************/
44 | 
45 | /* Input length is not a multiplum of 10 ms, or length is longer than the packet length */
46 | #define SKP_SILK_ENC_INPUT_INVALID_NO_OF_SAMPLES        -1
47 | 
48 | /* Sampling frequency not 8000, 12000, 16000 or 24000 Hertz */
49 | #define SKP_SILK_ENC_FS_NOT_SUPPORTED                   -2
50 | 
51 | /* Packet size not 20, 40, 60, 80 or 100 ms */
52 | #define SKP_SILK_ENC_PACKET_SIZE_NOT_SUPPORTED          -3
53 | 
54 | /* Allocated payload buffer too short */
55 | #define SKP_SILK_ENC_PAYLOAD_BUF_TOO_SHORT              -4
56 | 
57 | /* Loss rate not between 0 and 100 percent */
58 | #define SKP_SILK_ENC_INVALID_LOSS_RATE                  -5
59 | 
60 | /* Complexity setting not valid, use 0, 1 or 2 */
61 | #define SKP_SILK_ENC_INVALID_COMPLEXITY_SETTING         -6
62 | 
63 | /* Inband FEC setting not valid, use 0 or 1 */
64 | #define SKP_SILK_ENC_INVALID_INBAND_FEC_SETTING         -7
65 | 
66 | /* DTX setting not valid, use 0 or 1 */
67 | #define SKP_SILK_ENC_INVALID_DTX_SETTING                -8
68 | 
69 | /* Internal encoder error */
70 | #define SKP_SILK_ENC_INTERNAL_ERROR                     -9
71 | 
72 | /**************************/
73 | /* Decoder error messages */
74 | /**************************/
75 | 
76 | /* Output sampling frequency lower than internal decoded sampling frequency */
77 | #define SKP_SILK_DEC_INVALID_SAMPLING_FREQUENCY         -10
78 | 
79 | /* Payload size exceeded the maximum allowed 1024 bytes */
80 | #define SKP_SILK_DEC_PAYLOAD_TOO_LARGE                  -11
81 | 
82 | /* Payload has bit errors */
83 | #define SKP_SILK_DEC_PAYLOAD_ERROR                      -12
84 | 
85 | #ifdef __cplusplus
86 | }
87 | #endif
88 | 
89 | #endif
90 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_A2NLSF_arm.S:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #if defined(__arm__)
29 | 
30 | #include "SKP_Silk_AsmPreproc.h"
31 | #if EMBEDDED_ARM>=6
32 | 
33 | 	VARDEF y32, r3
34 | 	VARDEF pn1, r4
35 | 	VARDEF pn2, r5
36 | 	VARDEF lo, r6
37 | 	VARDEF hi, r8
38 | .globl	SYM(SKP_Silk_A2NLSF_eval_poly)
39 | SYM(SKP_Silk_A2NLSF_eval_poly):
40 | 	stmdb	sp!,  {r4-r8, fp, ip, lr}
41 | 	add		fp, sp, #28
42 | 	add		r0, r0, r2, lsl #2
43 | 	ldr		y32, [r0], #-4
44 | 	tst		r2, #1
45 | 	beq		LR(1, f)
46 | 	ldr		pn1, [r0], #-4
47 | 	sub		r2, r2, #1
48 | 	mov		r1, r1, lsl #4
49 | L(0)
50 | 	smull	lo, hi, y32, r1
51 | 	subs	r2, r2, #1
52 | 	add		y32, pn1, hi, lsl #16
53 | 	ldr		pn1, [r0], #-4
54 | 	add		y32, y32, lo, lsr #16
55 | 	bgt		LR(0, b)
56 | 	smull	lo, hi, y32, r1
57 | 	add		y32, pn1, hi, lsl #16
58 | 	add		r0, y32, lo, lsr #16
59 | 	ldmia	sp!,  {r4-r8, fp, ip, pc}
60 | 
61 | L(1)/*EVEN:*/
62 | 	add		r0, r0, #4
63 | 	ldmdb	r0!, {pn1, pn2}
64 | 	sub		r2, r2, #2
65 | 	mov		r1, r1, lsl #4
66 | L(0)
67 | 	smull	lo, hi, y32, r1
68 | 	subs	r2, r2, #2
69 | 	add		y32, pn2, hi, lsl #16
70 | 	add		y32, y32, lo, lsr #16
71 | 	smull	lo, hi, y32, r1
72 | 	add		y32, pn1, hi, lsl #16
73 | 	ldmdb	r0!, {pn1, pn2}
74 | 	add		y32, y32, lo, lsr #16
75 | 	bgt		LR(0, b)
76 | 	smull	lo, hi, y32, r1
77 | 	add		y32, pn2, hi, lsl #16
78 | 	add		y32, y32, lo, lsr #16
79 | 	smull	lo, hi, y32, r1
80 | 	add		y32, pn1, hi, lsl #16
81 | 	add		r0, y32, lo, lsr #16
82 | 	ldmia	sp!,  {r4-r8, fp, ip, pc}
83 | 	END
84 | #endif
85 | #endif
86 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_LBRR_reset.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #include "SKP_Silk_main.h"
29 | 
30 | /* Resets LBRR buffer, used if packet size changes */
31 | void SKP_Silk_LBRR_reset( 
32 |     SKP_Silk_encoder_state      *psEncC             /* I/O  state                                       */
33 | )
34 | {
35 |     SKP_int i;
36 | 
37 |     for( i = 0; i < MAX_LBRR_DELAY; i++ ) {
38 |         psEncC->LBRR_buffer[ i ].usage = SKP_SILK_NO_LBRR;
39 |     }
40 | }
41 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_LTP_analysis_filter_FIX.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #include "SKP_Silk_main_FIX.h"
29 | 
30 | void SKP_Silk_LTP_analysis_filter_FIX(
31 |     SKP_int16       *LTP_res,                           /* O:   LTP residual signal of length NB_SUBFR * ( pre_length + subfr_length )  */
32 |     const SKP_int16 *x,                                 /* I:   Pointer to input signal with at least max( pitchL ) preceeding samples  */
33 |     const SKP_int16 LTPCoef_Q14[ LTP_ORDER * NB_SUBFR ],/* I:   LTP_ORDER LTP coefficients for each NB_SUBFR subframe                   */
34 |     const SKP_int   pitchL[ NB_SUBFR ],                 /* I:   Pitch lag, one for each subframe                                        */
35 |     const SKP_int32 invGains_Q16[ NB_SUBFR ],           /* I:   Inverse quantization gains, one for each subframe                       */
36 |     const SKP_int   subfr_length,                       /* I:   Length of each subframe                                                 */
37 |     const SKP_int   pre_length                          /* I:   Length of the preceeding samples starting at &x[0] for each subframe    */
38 | )
39 | {
40 |     const SKP_int16 *x_ptr, *x_lag_ptr;
41 |     SKP_int16   Btmp_Q14[ LTP_ORDER ];
42 |     SKP_int16   *LTP_res_ptr;
43 |     SKP_int     k, i, j;
44 |     SKP_int32   LTP_est;
45 | 
46 |     x_ptr = x;
47 |     LTP_res_ptr = LTP_res;
48 |     for( k = 0; k < NB_SUBFR; k++ ) {
49 | 
50 |         x_lag_ptr = x_ptr - pitchL[ k ];
51 |         for( i = 0; i < LTP_ORDER; i++ ) {
52 |             Btmp_Q14[ i ] = LTPCoef_Q14[ k * LTP_ORDER + i ];
53 |         }
54 | 
55 |         /* LTP analysis FIR filter */
56 |         for( i = 0; i < subfr_length + pre_length; i++ ) {
57 |             LTP_res_ptr[ i ] = x_ptr[ i ];
58 |             
59 |             /* Long-term prediction */
60 |             LTP_est = SKP_SMULBB( x_lag_ptr[ LTP_ORDER / 2 ], Btmp_Q14[ 0 ] );
61 |             for( j = 1; j < LTP_ORDER; j++ ) {
62 |                 LTP_est = SKP_SMLABB_ovflw( LTP_est, x_lag_ptr[ LTP_ORDER / 2 - j ], Btmp_Q14[ j ] );
63 | 			}
64 |             LTP_est = SKP_RSHIFT_ROUND( LTP_est, 14 ); // round and -> Q0
65 | 
66 |             /* Subtract long-term prediction */
67 |             LTP_res_ptr[ i ] = ( SKP_int16 )SKP_SAT16( ( SKP_int32 )x_ptr[ i ] - LTP_est );
68 | 
69 |             /* Scale residual */
70 |             LTP_res_ptr[ i ] = SKP_SMULWB( invGains_Q16[ k ], LTP_res_ptr[ i ] );
71 | 
72 |             x_lag_ptr++;
73 |         }
74 | 
75 |         /* Update pointers */
76 |         LTP_res_ptr += subfr_length + pre_length; 
77 |         x_ptr       += subfr_length;
78 |     }
79 | }
80 | 
81 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_LTP_scale_ctrl_FIX.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #include "SKP_Silk_main_FIX.h"
29 | 
30 | #define NB_THRESHOLDS           11
31 | 
32 | /* Table containing trained thresholds for LTP scaling */
33 | static const SKP_int16 LTPScaleThresholds_Q15[ NB_THRESHOLDS ] = 
34 | {
35 |     31129, 26214, 16384, 13107, 9830, 6554,
36 |      4915,  3276,  2621,  2458,    0
37 | };
38 | 
39 | void SKP_Silk_LTP_scale_ctrl_FIX(
40 |     SKP_Silk_encoder_state_FIX      *psEnc,     /* I/O  encoder state FIX                           */
41 |     SKP_Silk_encoder_control_FIX    *psEncCtrl  /* I/O  encoder control FIX                         */
42 | )
43 | {
44 |     SKP_int round_loss, frames_per_packet;
45 |     SKP_int g_out_Q5, g_limit_Q15, thrld1_Q15, thrld2_Q15;
46 | 
47 |     /* 1st order high-pass filter */
48 |     psEnc->HPLTPredCodGain_Q7 = SKP_max_int( psEncCtrl->LTPredCodGain_Q7 - psEnc->prevLTPredCodGain_Q7, 0 ) 
49 |         + SKP_RSHIFT_ROUND( psEnc->HPLTPredCodGain_Q7, 1 );
50 |     
51 |     psEnc->prevLTPredCodGain_Q7 = psEncCtrl->LTPredCodGain_Q7;
52 | 
53 |     /* combine input and filtered input */
54 |     g_out_Q5    = SKP_RSHIFT_ROUND( SKP_RSHIFT( psEncCtrl->LTPredCodGain_Q7, 1 ) + SKP_RSHIFT( psEnc->HPLTPredCodGain_Q7, 1 ), 3 );
55 |     g_limit_Q15 = SKP_Silk_sigm_Q15( g_out_Q5 - ( 3 << 5 ) );
56 |             
57 |     /* Default is minimum scaling */
58 |     psEncCtrl->sCmn.LTP_scaleIndex = 0;
59 | 
60 |     /* Round the loss measure to whole pct */
61 |     round_loss = ( SKP_int )psEnc->sCmn.PacketLoss_perc;
62 | 
63 |     /* Only scale if first frame in packet 0% */
64 |     if( psEnc->sCmn.nFramesInPayloadBuf == 0 ) {
65 |         
66 |         frames_per_packet = SKP_DIV32_16( psEnc->sCmn.PacketSize_ms, FRAME_LENGTH_MS );
67 | 
68 |         round_loss += frames_per_packet - 1;
69 |         thrld1_Q15 = LTPScaleThresholds_Q15[ SKP_min_int( round_loss,     NB_THRESHOLDS - 1 ) ];
70 |         thrld2_Q15 = LTPScaleThresholds_Q15[ SKP_min_int( round_loss + 1, NB_THRESHOLDS - 1 ) ];
71 |     
72 |         if( g_limit_Q15 > thrld1_Q15 ) {
73 |             /* Maximum scaling */
74 |             psEncCtrl->sCmn.LTP_scaleIndex = 2;
75 |         } else if( g_limit_Q15 > thrld2_Q15 ) {
76 |             /* Medium scaling */
77 |             psEncCtrl->sCmn.LTP_scaleIndex = 1;
78 |         }
79 |     }
80 |     psEncCtrl->LTP_scale_Q14 = SKP_Silk_LTPScales_table_Q14[ psEncCtrl->sCmn.LTP_scaleIndex ];
81 | }
82 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_NLSF2A_stable.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #include "SKP_Silk_main.h"
29 | 
30 | /* Convert NLSF parameters to stable AR prediction filter coefficients */
31 | void SKP_Silk_NLSF2A_stable(
32 |     SKP_int16                       pAR_Q12[ MAX_LPC_ORDER ],   /* O    Stabilized AR coefs [LPC_order]     */ 
33 |     const SKP_int                   pNLSF[ MAX_LPC_ORDER ],     /* I    NLSF vector         [LPC_order]     */
34 |     const SKP_int                   LPC_order                   /* I    LPC/LSF order                       */
35 | )
36 | {
37 |     SKP_int   i;
38 |     SKP_int32 invGain_Q30;
39 | 
40 |     SKP_Silk_NLSF2A( pAR_Q12, pNLSF, LPC_order );
41 | 
42 |     /* Ensure stable LPCs */
43 |     for( i = 0; i < MAX_LPC_STABILIZE_ITERATIONS; i++ ) {
44 |         if( SKP_Silk_LPC_inverse_pred_gain( &invGain_Q30, pAR_Q12, LPC_order ) == 1 ) {
45 |             SKP_Silk_bwexpander( pAR_Q12, LPC_order, 65536 - SKP_SMULBB( 10 + i, i ) );		/* 10_Q16 = 0.00015 */
46 |         } else {
47 |             break;
48 |         }
49 |     }
50 | 
51 |     /* Reached the last iteration */
52 |     if( i == MAX_LPC_STABILIZE_ITERATIONS ) {
53 |         SKP_assert( 0 );
54 |         for( i = 0; i < LPC_order; i++ ) {
55 |             pAR_Q12[ i ] = 0;
56 |         }
57 |     }
58 | }
59 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_NLSF_VQ_rate_distortion_FIX.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #include "SKP_Silk_main_FIX.h"
29 | 
30 | /* Rate-Distortion calculations for multiple input data vectors */
31 | void SKP_Silk_NLSF_VQ_rate_distortion_FIX(
32 |     SKP_int32                       *pRD_Q20,           /* O    Rate-distortion values [psNLSF_CBS->nVectors*N] */
33 |     const SKP_Silk_NLSF_CBS         *psNLSF_CBS,        /* I    NLSF codebook stage struct                      */
34 |     const SKP_int                   *in_Q15,            /* I    Input vectors to be quantized                   */
35 |     const SKP_int                   *w_Q6,              /* I    Weight vector                                   */
36 |     const SKP_int32                 *rate_acc_Q5,       /* I    Accumulated rates from previous stage           */
37 |     const SKP_int                   mu_Q15,             /* I    Weight between weighted error and rate          */
38 |     const SKP_int                   N,                  /* I    Number of input vectors to be quantized         */
39 |     const SKP_int                   LPC_order           /* I    LPC order                                       */
40 | )
41 | {
42 |     SKP_int   i, n;
43 |     SKP_int32 *pRD_vec_Q20;
44 | 
45 |     /* Compute weighted quantization errors for all input vectors over one codebook stage */
46 |     SKP_Silk_NLSF_VQ_sum_error_FIX( pRD_Q20, in_Q15, w_Q6, psNLSF_CBS->CB_NLSF_Q15, 
47 |         N, psNLSF_CBS->nVectors, LPC_order );
48 | 
49 |     /* Loop over input vectors */
50 |     pRD_vec_Q20 = pRD_Q20;
51 |     for( n = 0; n < N; n++ ) {
52 |         /* Add rate cost to error for each codebook vector */
53 |         for( i = 0; i < psNLSF_CBS->nVectors; i++ ) {
54 |             SKP_assert( rate_acc_Q5[ n ] + psNLSF_CBS->Rates_Q5[ i ] >= 0 );
55 |             SKP_assert( rate_acc_Q5[ n ] + psNLSF_CBS->Rates_Q5[ i ] <= SKP_int16_MAX );
56 |             pRD_vec_Q20[ i ] = SKP_SMLABB( pRD_vec_Q20[ i ], rate_acc_Q5[ n ] + psNLSF_CBS->Rates_Q5[ i ], mu_Q15 );
57 |             SKP_assert( pRD_vec_Q20[ i ] >= 0 );
58 |         }
59 |         pRD_vec_Q20 += psNLSF_CBS->nVectors;
60 |     }
61 | }
62 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_NLSF_VQ_weights_laroia.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #include "SKP_Silk_SigProc_FIX.h"
29 | 
30 | /* 
31 | R. Laroia, N. Phamdo and N. Farvardin, "Robust and Efficient Quantization of Speech LSP
32 | Parameters Using Structured Vector Quantization", Proc. IEEE Int. Conf. Acoust., Speech,
33 | Signal Processing, pp. 641-644, 1991.
34 | */
35 | 
36 | #define Q_OUT                       6
37 | #define MIN_NDELTA                  3
38 | 
39 | /* Laroia low complexity NLSF weights */
40 | void SKP_Silk_NLSF_VQ_weights_laroia(
41 |     SKP_int             *pNLSFW_Q6,         /* O: Pointer to input vector weights           [D x 1]     */
42 |     const SKP_int       *pNLSF_Q15,         /* I: Pointer to input vector                   [D x 1]     */ 
43 |     const SKP_int       D                   /* I: Input vector dimension (even)                         */
44 | )
45 | {
46 |     SKP_int   k;
47 |     SKP_int32 tmp1_int, tmp2_int;
48 |     
49 |     /* Check that we are guaranteed to end up within the required range */
50 |     SKP_assert( D > 0 );
51 |     SKP_assert( ( D & 1 ) == 0 );
52 |     
53 |     /* First value */
54 |     tmp1_int = SKP_max_int( pNLSF_Q15[ 0 ], MIN_NDELTA );
55 |     tmp1_int = SKP_DIV32_16( 1 << ( 15 + Q_OUT ), tmp1_int );
56 |     tmp2_int = SKP_max_int( pNLSF_Q15[ 1 ] - pNLSF_Q15[ 0 ], MIN_NDELTA );
57 |     tmp2_int = SKP_DIV32_16( 1 << ( 15 + Q_OUT ), tmp2_int );
58 |     pNLSFW_Q6[ 0 ] = (SKP_int)SKP_min_int( tmp1_int + tmp2_int, SKP_int16_MAX );
59 |     SKP_assert( pNLSFW_Q6[ 0 ] > 0 );
60 |     
61 |     /* Main loop */
62 |     for( k = 1; k < D - 1; k += 2 ) {
63 |         tmp1_int = SKP_max_int( pNLSF_Q15[ k + 1 ] - pNLSF_Q15[ k ], MIN_NDELTA );
64 |         tmp1_int = SKP_DIV32_16( 1 << ( 15 + Q_OUT ), tmp1_int );
65 |         pNLSFW_Q6[ k ] = (SKP_int)SKP_min_int( tmp1_int + tmp2_int, SKP_int16_MAX );
66 |         SKP_assert( pNLSFW_Q6[ k ] > 0 );
67 | 
68 |         tmp2_int = SKP_max_int( pNLSF_Q15[ k + 2 ] - pNLSF_Q15[ k + 1 ], MIN_NDELTA );
69 |         tmp2_int = SKP_DIV32_16( 1 << ( 15 + Q_OUT ), tmp2_int );
70 |         pNLSFW_Q6[ k + 1 ] = (SKP_int)SKP_min_int( tmp1_int + tmp2_int, SKP_int16_MAX );
71 |         SKP_assert( pNLSFW_Q6[ k + 1 ] > 0 );
72 |     }
73 |     
74 |     /* Last value */
75 |     tmp1_int = SKP_max_int( ( 1 << 15 ) - pNLSF_Q15[ D - 1 ], MIN_NDELTA );
76 |     tmp1_int = SKP_DIV32_16( 1 << ( 15 + Q_OUT ), tmp1_int );
77 |     pNLSFW_Q6[ D - 1 ] = (SKP_int)SKP_min_int( tmp1_int + tmp2_int, SKP_int16_MAX );
78 |     SKP_assert( pNLSFW_Q6[ D - 1 ] > 0 );
79 | }
80 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_allpass_int_arm.S:
--------------------------------------------------------------------------------
  1 | /***********************************************************************
  2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
  3 | Redistribution and use in source and binary forms, with or without 
  4 | modification, (subject to the limitations in the disclaimer below) 
  5 | are permitted provided that the following conditions are met:
  6 | - Redistributions of source code must retain the above copyright notice,
  7 | this list of conditions and the following disclaimer.
  8 | - Redistributions in binary form must reproduce the above copyright 
  9 | notice, this list of conditions and the following disclaimer in the 
 10 | documentation and/or other materials provided with the distribution.
 11 | - Neither the name of Skype Limited, nor the names of specific 
 12 | contributors, may be used to endorse or promote products derived from 
 13 | this software without specific prior written permission.
 14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
 15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
 16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
 18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
 19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
 20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
 22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 26 | ***********************************************************************/
 27 | 
 28 | #if defined(__arm__)
 29 | 
 30 | #include "SKP_Silk_AsmPreproc.h"
 31 | 
 32 | #if EMBEDDED_ARM >= 5
 33 | 	VARDEF A, r2
 34 | 	VARDEF len, r4
 35 | 	VARDEF S00, r5
 36 | 	VARDEF ink1, r6
 37 | 	VARDEF ink2, r8
 38 | 	VARDEF Y2, sb
 39 | 	VARDEF outk1, sl
 40 | 	VARDEF outk2, ip
 41 | 
 42 | .globl	SYM(SKP_Silk_allpass_int)
 43 | SYM(SKP_Silk_allpass_int):
 44 | 	stmdb	sp!,  {r4-r10, fp, ip, lr}
 45 | 	add		fp, sp, #36
 46 | .set	len_offset, 40 
 47 | 	ldr			len, [sp, #len_offset]
 48 | 	ldr			S00, [r1]
 49 | 	movs		A, A, lsl #17
 50 | 	sub			len, len, #1
 51 | 	ldmia		r0!, {ink1,ink2}
 52 | 	bge			LR(1, f)/*AgeZero*/
 53 | L(0)
 54 | 	sub			Y2, ink1, S00
 55 | 	smlawt		outk1, Y2, A, ink1
 56 | 	add			S00, Y2, outk1
 57 | 	subs		len, len, #2
 58 | 	sub			Y2, ink2, S00
 59 | 	smlawt		outk2, Y2, A, ink2
 60 | #ifdef _WINRT
 61 | 	ble			LR(3, f)
 62 | 	ldmia		r0!, {ink1,ink2}
 63 | L(3)	
 64 | #else	
 65 | 	ldmgtia		r0!, {ink1,ink2}
 66 | #endif
 67 | 	add			S00, Y2, outk2
 68 | 	stmia		r3!, {outk1, outk2}
 69 | 	bgt			LR(0, b)
 70 | #ifdef _WINRT
 71 | 	bne			LR(2, f)
 72 | 	ldr			ink1, [r0], #4
 73 | 	sub			Y2, ink1, S00
 74 | 	smlawt		outk1, Y2, A, ink1
 75 | 	add			S00, Y2, outk1
 76 | 	str			outk1, [r3]
 77 | L(2)	
 78 | #else
 79 | 	ldreq		ink1, [r0], #4
 80 | 	subeq		Y2, ink1, S00
 81 | 	smlawteq	outk1, Y2, A, ink1
 82 | 	addeq		S00, Y2, outk1
 83 | 	streq		outk1, [r3]
 84 | #endif	
 85 | 	str			S00, [r1]	
 86 | 	ldmia	sp!,  {r4-r10, fp, ip, pc}
 87 | 
 88 | L(1)/*AgeZero:*/
 89 | 	sub			Y2, ink1, S00
 90 | 	smlawt		outk1, Y2, A, S00
 91 | 	add			S00, Y2, outk1
 92 | 	subs		len, len, #2
 93 | 	sub			Y2, ink2, S00
 94 | 	smlawt		outk2, Y2, A, S00
 95 | #ifdef _WINRT
 96 | 	ble			LR(3, f)
 97 | 	ldmia		r0!, {ink1,ink2}
 98 | L(3)
 99 | #else	
100 | 	ldmgtia		r0!, {ink1,ink2}
101 | #endif
102 | 	add			S00, Y2, outk2
103 | 	stmia		r3!, {outk1, outk2}
104 | 	bgt			LR(1, b)
105 | #ifdef _WINRT
106 | 	bne			LR(2, f)
107 | 	ldr			ink1, [r0], #4
108 | 	sub			Y2, ink1, S00
109 | 	smlawt		outk1, Y2, A, S00
110 | 	add			S00, Y2, outk1
111 | 	str			outk1, [r3]
112 | L(2)	
113 | #else	
114 | 	ldreq		ink1, [r0], #4
115 | 	subeq		Y2, ink1, S00
116 | 	smlawteq	outk1, Y2, A, S00
117 | 	addeq		S00, Y2, outk1
118 | 	streq		outk1, [r3]
119 | #endif	
120 | 	str			S00, [r1]	
121 | 	ldmia	sp!,  {r4-r10, fp, ip, pc}
122 | 	END
123 | #endif	
124 | #endif
125 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_array_maxabs.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | /*                                                                      *
29 |  * SKP_Silk_int16_array_maxabs.c                                      *
30 |  *                                                                      *
31 |  * Function that returns the maximum absolut value of                   *
32 |  * the input vector                                                     *
33 |  *                                                                      *
34 |  * Copyright 2006 (c), Skype Limited                                    *
35 |  * Date: 060221                                                         *
36 |  *                                                                      */
37 | #include "SKP_Silk_SigProc_FIX.h"
38 | 
39 | /* Function that returns the maximum absolut value of the input vector */
40 | #if (EMBEDDED_ARM<4)  
41 | SKP_int16 SKP_Silk_int16_array_maxabs(    /* O    Maximum absolute value, max: 2^15-1   */
42 |     const SKP_int16        *vec,            /* I    Input vector  [len]                   */
43 |     const SKP_int32        len              /* I    Length of input vector                */
44 | )                    
45 | {
46 |     SKP_int32 max = 0, i, lvl = 0, ind;
47 | 	if( len == 0 ) return 0;
48 | 
49 |     ind = len - 1;
50 |     max = SKP_SMULBB( vec[ ind ], vec[ ind ] );
51 |     for( i = len - 2; i >= 0; i-- ) {
52 |         lvl = SKP_SMULBB( vec[ i ], vec[ i ] );
53 |         if( lvl > max ) {
54 |             max = lvl;
55 |             ind = i;
56 |         }
57 |     }
58 | 
59 |     /* Do not return 32768, as it will not fit in an int16 so may lead to problems later on */
60 |     if( max >= 1073676289 ) { // (2^15-1)^2 = 1073676289
61 |         return( SKP_int16_MAX );
62 |     } else {
63 |         if( vec[ ind ] < 0 ) {
64 |             return( -vec[ ind ] );
65 |         } else {
66 |             return(  vec[ ind ] );
67 |         }
68 |     }
69 | }
70 | #endif
71 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_biquad.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | /*                                                                      *
29 |  * SKP_Silk_biquad.c                                                  *
30 |  *                                                                      *
31 |  * Second order ARMA filter                                             *
32 |  * Can handle slowly varying filter coefficients                        *
33 |  *                                                                      *
34 |  * Copyright 2006 (c), Skype Limited                                    *
35 |  * Date: 060221                                                         *
36 |  *                                                                      */
37 | #include "SKP_Silk_SigProc_FIX.h"
38 | 
39 | /* Second order ARMA filter */
40 | /* Can handle slowly varying filter coefficients */
41 | void SKP_Silk_biquad(
42 |     const SKP_int16      *in,        /* I:    input signal               */
43 |     const SKP_int16      *B,         /* I:    MA coefficients, Q13 [3]   */
44 |     const SKP_int16      *A,         /* I:    AR coefficients, Q13 [2]   */
45 |     SKP_int32            *S,         /* I/O:  state vector [2]           */
46 |     SKP_int16            *out,       /* O:    output signal              */
47 |     const SKP_int32      len         /* I:    signal length              */
48 | )
49 | {
50 |     SKP_int   k, in16;
51 |     SKP_int32 A0_neg, A1_neg, S0, S1, out32, tmp32;
52 | 
53 |     S0 = S[ 0 ];
54 |     S1 = S[ 1 ];
55 |     A0_neg = -A[ 0 ];
56 |     A1_neg = -A[ 1 ];
57 |     for( k = 0; k < len; k++ ) {
58 |         /* S[ 0 ], S[ 1 ]: Q13 */
59 |         in16  = in[ k ];
60 |         out32 = SKP_SMLABB( S0, in16, B[ 0 ] );
61 | 
62 |         S0 = SKP_SMLABB( S1, in16, B[ 1 ] );
63 |         S0 += SKP_LSHIFT( SKP_SMULWB( out32, A0_neg ), 3 );
64 | 
65 |         S1 = SKP_LSHIFT( SKP_SMULWB( out32, A1_neg ), 3 );
66 |         S1 = SKP_SMLABB( S1, in16, B[ 2 ] );
67 |         tmp32    = SKP_RSHIFT_ROUND( out32, 13 ) + 1;
68 |         out[ k ] = (SKP_int16)SKP_SAT16( tmp32 );
69 |     }
70 |     S[ 0 ] = S0;
71 |     S[ 1 ] = S1;
72 | }
73 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_biquad_alt.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | /*                                                                      *
29 |  * SKP_Silk_biquad_alt.c                                              *
30 |  *                                                                      *
31 |  * Second order ARMA filter                                             *
32 |  * Can handle slowly varying filter coefficients                        *
33 |  *                                                                      */
34 | #include "SKP_Silk_SigProc_FIX.h"
35 | 
36 | 
37 | /* Second order ARMA filter, alternative implementation */
38 | void SKP_Silk_biquad_alt(
39 |     const SKP_int16      *in,            /* I:    Input signal                   */
40 |     const SKP_int32      *B_Q28,         /* I:    MA coefficients [3]            */
41 |     const SKP_int32      *A_Q28,         /* I:    AR coefficients [2]            */
42 |     SKP_int32            *S,             /* I/O: State vector [2]                */
43 |     SKP_int16            *out,           /* O:    Output signal                  */
44 |     const SKP_int32      len             /* I:    Signal length (must be even)   */
45 | )
46 | {
47 |     /* DIRECT FORM II TRANSPOSED (uses 2 element state vector) */
48 |     SKP_int   k;
49 |     SKP_int32 inval, A0_U_Q28, A0_L_Q28, A1_U_Q28, A1_L_Q28, out32_Q14;
50 | 
51 |     /* Negate A_Q28 values and split in two parts */
52 |     A0_L_Q28 = ( -A_Q28[ 0 ] ) & 0x00003FFF;        /* lower part */
53 |     A0_U_Q28 = SKP_RSHIFT( -A_Q28[ 0 ], 14 );       /* upper part */
54 |     A1_L_Q28 = ( -A_Q28[ 1 ] ) & 0x00003FFF;        /* lower part */
55 |     A1_U_Q28 = SKP_RSHIFT( -A_Q28[ 1 ], 14 );       /* upper part */
56 |     
57 |     for( k = 0; k < len; k++ ) {
58 |         /* S[ 0 ], S[ 1 ]: Q12 */
59 |         inval = in[ k ];
60 |         out32_Q14 = SKP_LSHIFT( SKP_SMLAWB( S[ 0 ], B_Q28[ 0 ], inval ), 2 );
61 | 
62 |         S[ 0 ] = S[1] + SKP_RSHIFT_ROUND( SKP_SMULWB( out32_Q14, A0_L_Q28 ), 14 );
63 |         S[ 0 ] = SKP_SMLAWB( S[ 0 ], out32_Q14, A0_U_Q28 );
64 |         S[ 0 ] = SKP_SMLAWB( S[ 0 ], B_Q28[ 1 ], inval);
65 | 
66 |         S[ 1 ] = SKP_RSHIFT_ROUND( SKP_SMULWB( out32_Q14, A1_L_Q28 ), 14 );
67 |         S[ 1 ] = SKP_SMLAWB( S[ 1 ], out32_Q14, A1_U_Q28 );
68 |         S[ 1 ] = SKP_SMLAWB( S[ 1 ], B_Q28[ 2 ], inval );
69 | 
70 |         /* Scale back to Q0 and saturate */
71 |         out[ k ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT( out32_Q14 + (1<<14) - 1, 14 ) );
72 |     }
73 | }
74 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_bwexpander.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #include "SKP_Silk_SigProc_FIX.h"
29 | 
30 | /* Chirp (bandwidth expand) LP AR filter */
31 | void SKP_Silk_bwexpander( 
32 |     SKP_int16            *ar,        /* I/O  AR filter to be expanded (without leading 1)    */
33 |     const SKP_int        d,          /* I    Length of ar                                    */
34 |     SKP_int32            chirp_Q16   /* I    Chirp factor (typically in the range 0 to 1)    */
35 | )
36 | {
37 |     SKP_int   i;
38 |     SKP_int32 chirp_minus_one_Q16;
39 | 
40 |     chirp_minus_one_Q16 = chirp_Q16 - 65536;
41 | 
42 |     /* NB: Dont use SKP_SMULWB, instead of SKP_RSHIFT_ROUND( SKP_MUL() , 16 ), below. */
43 |     /* Bias in SKP_SMULWB can lead to unstable filters                                */
44 |     for( i = 0; i < d - 1; i++ ) {
45 |         ar[ i ]    = (SKP_int16)SKP_RSHIFT_ROUND( SKP_MUL( chirp_Q16, ar[ i ]             ), 16 );
46 |         chirp_Q16 +=            SKP_RSHIFT_ROUND( SKP_MUL( chirp_Q16, chirp_minus_one_Q16 ), 16 );
47 |     }
48 |     ar[ d - 1 ] = (SKP_int16)SKP_RSHIFT_ROUND( SKP_MUL( chirp_Q16, ar[ d - 1 ] ), 16 );
49 | }
50 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_bwexpander_32.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #include "SKP_Silk_SigProc_FIX.h"
29 | 
30 | /* Chirp (bandwidth expand) LP AR filter */
31 | void SKP_Silk_bwexpander_32( 
32 |     SKP_int32        *ar,      /* I/O    AR filter to be expanded (without leading 1)    */
33 |     const SKP_int    d,        /* I    Length of ar                                      */
34 |     SKP_int32        chirp_Q16 /* I    Chirp factor in Q16                               */
35 | )
36 | {
37 |     SKP_int   i;
38 |     SKP_int32 tmp_chirp_Q16;
39 | 
40 |     tmp_chirp_Q16 = chirp_Q16;
41 |     for( i = 0; i < d - 1; i++ ) {
42 |         ar[ i ]       = SKP_SMULWW( ar[ i ],   tmp_chirp_Q16 );
43 |         tmp_chirp_Q16 = SKP_SMULWW( chirp_Q16, tmp_chirp_Q16 );
44 |     }
45 |     ar[ d - 1 ] = SKP_SMULWW( ar[ d - 1 ], tmp_chirp_Q16 );
46 | }
47 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_clz_arm.S:
--------------------------------------------------------------------------------
  1 | /***********************************************************************
  2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
  3 | Redistribution and use in source and binary forms, with or without 
  4 | modification, (subject to the limitations in the disclaimer below) 
  5 | are permitted provided that the following conditions are met:
  6 | - Redistributions of source code must retain the above copyright notice,
  7 | this list of conditions and the following disclaimer.
  8 | - Redistributions in binary form must reproduce the above copyright 
  9 | notice, this list of conditions and the following disclaimer in the 
 10 | documentation and/or other materials provided with the distribution.
 11 | - Neither the name of Skype Limited, nor the names of specific 
 12 | contributors, may be used to endorse or promote products derived from 
 13 | this software without specific prior written permission.
 14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
 15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
 16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
 18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
 19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
 20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
 22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 26 | ***********************************************************************/
 27 | 
 28 | #if defined(__arm__)
 29 | 
 30 | #include "SKP_Silk_AsmPreproc.h"
 31 | #if (EMBEDDED_ARM>0) && (EMBEDDED_ARM<5)
 32 | 
 33 | .globl SYM(SKP_Silk_CLZ16)
 34 | .globl SYM(SKP_Silk_CLZ32)
 35 | 
 36 | SYM(SKP_Silk_CLZ16):
 37 | 	str		lr, [sp, #-4]!
 38 | 	
 39 | 	mov		r2, r0
 40 | 	mov		r0, #0
 41 | 	ands	r1, r2, #0xF000
 42 | 	movne	r1, r2, asr #12 
 43 | 	bne		0f
 44 | 	add		r0, r0, #4
 45 | 	ands	r1, r2, #0xF00
 46 | 	movne	r1, r2, asr #8
 47 | 	bne		0f
 48 | 	add		r0, r0, #4
 49 | 	ands	r1, r2, #0xF0
 50 | 	movne	r1, r2, asr #4
 51 | 	bne		0f
 52 | 	add		r0, r0, #4
 53 | 	mov		r1, r2
 54 | 0:
 55 | 	ands	r2, r1, #0x8
 56 | 	bne		1f
 57 | 	add		r0, r0, #1
 58 | 	ands	r2, r1, #0x4
 59 | 	bne		1f
 60 | 	add		r0, r0, #1
 61 | 	ands	r2, r1, #0x2
 62 | 	bne		1f
 63 | 	add		r0, r0, #1	
 64 | 	ands	r2, r1, #0x1
 65 | 	bne		1f
 66 | 	add		r0, r0, #1
 67 | 1:	
 68 | 	ldr		pc, [sp], #4 
 69 | 
 70 | SYM(SKP_Silk_CLZ32):
 71 | 
 72 | 	str		lr, [sp, #-4]!
 73 | 	
 74 | 	mov		r2, r0
 75 | 	mov		r0, #0
 76 | 	ands	r1, r2, #0xF0000000
 77 | 	movne	r1, r2, asr #28 
 78 | 	bne		0f
 79 | 	add		r0, r0, #4
 80 | 	ands	r1, r2, #0xF000000
 81 | 	movne	r1, r2, asr #24 
 82 | 	bne		0f
 83 | 	add		r0, r0, #4
 84 | 	ands	r1, r2, #0xF00000
 85 | 	movne	r1, r2, asr #20 
 86 | 	bne		0f
 87 | 	add		r0, r0, #4
 88 | 	ands	r1, r2, #0xF0000
 89 | 	movne	r1, r2, asr #16 
 90 | 	bne		0f
 91 | 	add		r0, r0, #4
 92 | 	ands	r1, r2, #0xF000
 93 | 	movne	r1, r2, asr #12 
 94 | 	bne		0f
 95 | 	add		r0, r0, #4
 96 | 	ands	r1, r2, #0xF00
 97 | 	movne	r1, r2, asr #8
 98 | 	bne		0f
 99 | 	add		r0, r0, #4
100 | 	ands	r1, r2, #0xF0
101 | 	movne	r1, r2, asr #4
102 | 	bne		0f
103 | 	add		r0, r0, #4
104 | 	mov		r1, r2
105 | 0:
106 | 	ands	r2, r1, #0x8
107 | 	bne		1f
108 | 	add		r0, r0, #1
109 | 	ands	r2, r1, #0x4
110 | 	bne		1f
111 | 	add		r0, r0, #1
112 | 	ands	r2, r1, #0x2
113 | 	bne		1f
114 | 	add		r0, r0, #1	
115 | 	ands	r2, r1, #0x1
116 | 	bne		1f
117 | 	add		r0, r0, #1
118 | 1:	
119 | 	ldr		pc, [sp], #4 
120 | 	
121 | #endif
122 | #endif
123 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_common_pitch_est_defines.h:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #ifndef SIGPROC_COMMON_PITCH_EST_DEFINES_H
29 | #define SIGPROC_COMMON_PITCH_EST_DEFINES_H
30 | 
31 | #include "SKP_Silk_SigProc_FIX.h"
32 | 
33 | /************************************************************/
34 | /* Definitions For Fix pitch estimator                      */
35 | /************************************************************/
36 | 
37 | #define PITCH_EST_MAX_FS_KHZ                24 /* Maximum sampling frequency used */
38 | 
39 | #define PITCH_EST_FRAME_LENGTH_MS           40 /* 40 ms */
40 | 
41 | #define PITCH_EST_MAX_FRAME_LENGTH          (PITCH_EST_FRAME_LENGTH_MS * PITCH_EST_MAX_FS_KHZ)
42 | #define PITCH_EST_MAX_FRAME_LENGTH_ST_1     (PITCH_EST_MAX_FRAME_LENGTH >> 2)
43 | #define PITCH_EST_MAX_FRAME_LENGTH_ST_2     (PITCH_EST_MAX_FRAME_LENGTH >> 1)
44 | #define PITCH_EST_MAX_SF_FRAME_LENGTH       (PITCH_EST_SUB_FRAME * PITCH_EST_MAX_FS_KHZ)
45 | 
46 | #define PITCH_EST_MAX_LAG_MS                18            /* 18 ms -> 56 Hz */
47 | #define PITCH_EST_MIN_LAG_MS                2            /* 2 ms -> 500 Hz */
48 | #define PITCH_EST_MAX_LAG                   (PITCH_EST_MAX_LAG_MS * PITCH_EST_MAX_FS_KHZ)
49 | #define PITCH_EST_MIN_LAG                   (PITCH_EST_MIN_LAG_MS * PITCH_EST_MAX_FS_KHZ)
50 | 
51 | #define PITCH_EST_NB_SUBFR                  4
52 | 
53 | #define PITCH_EST_D_SRCH_LENGTH             24
54 | 
55 | #define PITCH_EST_MAX_DECIMATE_STATE_LENGTH 7
56 | 
57 | #define PITCH_EST_NB_STAGE3_LAGS            5
58 | 
59 | #define PITCH_EST_NB_CBKS_STAGE2            3
60 | #define PITCH_EST_NB_CBKS_STAGE2_EXT        11
61 | 
62 | #define PITCH_EST_CB_mn2                    1
63 | #define PITCH_EST_CB_mx2                    2
64 | 
65 | #define PITCH_EST_NB_CBKS_STAGE3_MAX        34
66 | #define PITCH_EST_NB_CBKS_STAGE3_MID        24
67 | #define PITCH_EST_NB_CBKS_STAGE3_MIN        16
68 | 
69 | extern const SKP_int16 SKP_Silk_CB_lags_stage2[PITCH_EST_NB_SUBFR][PITCH_EST_NB_CBKS_STAGE2_EXT];
70 | extern const SKP_int16 SKP_Silk_CB_lags_stage3[PITCH_EST_NB_SUBFR][PITCH_EST_NB_CBKS_STAGE3_MAX];
71 | extern const SKP_int16 SKP_Silk_Lag_range_stage3[ SKP_Silk_PITCH_EST_MAX_COMPLEX + 1 ] [ PITCH_EST_NB_SUBFR ][ 2 ];
72 | extern const SKP_int16 SKP_Silk_cbk_sizes_stage3[ SKP_Silk_PITCH_EST_MAX_COMPLEX + 1 ];
73 | extern const SKP_int16 SKP_Silk_cbk_offsets_stage3[ SKP_Silk_PITCH_EST_MAX_COMPLEX + 1 ];
74 | 
75 | #endif
76 | 
77 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_create_init_destroy.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #include "SKP_Silk_main.h"
29 | 
30 | 
31 | /************************/
32 | /* Init Decoder State   */
33 | /************************/
34 | SKP_int SKP_Silk_init_decoder(
35 |     SKP_Silk_decoder_state      *psDec              /* I/O  Decoder state pointer                       */
36 | )
37 | {
38 |     SKP_memset( psDec, 0, sizeof( SKP_Silk_decoder_state ) );
39 |     /* Set sampling rate to 24 kHz, and init non-zero values */
40 |     SKP_Silk_decoder_set_fs( psDec, 24 );
41 | 
42 |     /* Used to deactivate e.g. LSF interpolation and fluctuation reduction */
43 |     psDec->first_frame_after_reset = 1;
44 |     psDec->prev_inv_gain_Q16 = 65536;
45 | 
46 |     /* Reset CNG state */
47 |     SKP_Silk_CNG_Reset( psDec );
48 | 
49 |     SKP_Silk_PLC_Reset( psDec );
50 |     
51 |     return(0);
52 | }
53 | 
54 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_decode_pitch.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | /***********************************************************
29 | * Pitch analyser function
30 | ********************************************************** */
31 | #include "SKP_Silk_SigProc_FIX.h"
32 | #include "SKP_Silk_common_pitch_est_defines.h"
33 | 
34 | void SKP_Silk_decode_pitch(
35 |     SKP_int          lagIndex,                        /* I                             */
36 |     SKP_int          contourIndex,                    /* O                             */
37 |     SKP_int          pitch_lags[],                    /* O 4 pitch values              */
38 |     SKP_int          Fs_kHz                           /* I sampling frequency (kHz)    */
39 | )
40 | {
41 |     SKP_int lag, i, min_lag;
42 | 
43 |     min_lag = SKP_SMULBB( PITCH_EST_MIN_LAG_MS, Fs_kHz );
44 | 
45 |     /* Only for 24 / 16 kHz version for now */
46 |     lag = min_lag + lagIndex;
47 |     if( Fs_kHz == 8 ) {
48 |         /* Only a small codebook for 8 khz */
49 |         for( i = 0; i < PITCH_EST_NB_SUBFR; i++ ) {
50 |             pitch_lags[ i ] = lag + SKP_Silk_CB_lags_stage2[ i ][ contourIndex ];
51 |         }
52 |     } else {
53 |         for( i = 0; i < PITCH_EST_NB_SUBFR; i++ ) {
54 |             pitch_lags[ i ] = lag + SKP_Silk_CB_lags_stage3[ i ][ contourIndex ];
55 |         }
56 |     }
57 | }
58 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_decoder_set_fs.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #include "SKP_Silk_main.h"
29 | 
30 | /* Set decoder sampling rate */
31 | void SKP_Silk_decoder_set_fs(
32 |     SKP_Silk_decoder_state          *psDec,             /* I/O  Decoder state pointer                       */
33 |     SKP_int                         fs_kHz              /* I    Sampling frequency (kHz)                    */
34 | )
35 | {
36 |     if( psDec->fs_kHz != fs_kHz ) {
37 |         psDec->fs_kHz  = fs_kHz;
38 |         psDec->frame_length = SKP_SMULBB( FRAME_LENGTH_MS, fs_kHz );
39 |         psDec->subfr_length = SKP_SMULBB( FRAME_LENGTH_MS / NB_SUBFR, fs_kHz );
40 |         if( psDec->fs_kHz == 8 ) {
41 |             psDec->LPC_order = MIN_LPC_ORDER;
42 |             psDec->psNLSF_CB[ 0 ] = &SKP_Silk_NLSF_CB0_10;
43 |             psDec->psNLSF_CB[ 1 ] = &SKP_Silk_NLSF_CB1_10;
44 |         } else {
45 |             psDec->LPC_order = MAX_LPC_ORDER;
46 |             psDec->psNLSF_CB[ 0 ] = &SKP_Silk_NLSF_CB0_16;
47 |             psDec->psNLSF_CB[ 1 ] = &SKP_Silk_NLSF_CB1_16;
48 |         }
49 |         /* Reset part of the decoder state */
50 |         SKP_memset( psDec->sLPC_Q14,     0, MAX_LPC_ORDER    * sizeof( SKP_int32 ) );
51 |         SKP_memset( psDec->outBuf,       0, MAX_FRAME_LENGTH * sizeof( SKP_int16 ) );
52 |         SKP_memset( psDec->prevNLSF_Q15, 0, MAX_LPC_ORDER    * sizeof( SKP_int )   );
53 | 
54 |         psDec->lagPrev                 = 100;
55 |         psDec->LastGainIndex           = 1;
56 |         psDec->prev_sigtype            = 0;
57 |         psDec->first_frame_after_reset = 1;
58 | 
59 |         if( fs_kHz == 24 ) {
60 |             psDec->HP_A = SKP_Silk_Dec_A_HP_24;
61 |             psDec->HP_B = SKP_Silk_Dec_B_HP_24;
62 |         } else if( fs_kHz == 16 ) {
63 |             psDec->HP_A = SKP_Silk_Dec_A_HP_16;
64 |             psDec->HP_B = SKP_Silk_Dec_B_HP_16;
65 |         } else if( fs_kHz == 12 ) {
66 |             psDec->HP_A = SKP_Silk_Dec_A_HP_12;
67 |             psDec->HP_B = SKP_Silk_Dec_B_HP_12;
68 |         } else if( fs_kHz == 8 ) {
69 |             psDec->HP_A = SKP_Silk_Dec_A_HP_8;
70 |             psDec->HP_B = SKP_Silk_Dec_B_HP_8;
71 |         } else {
72 |             /* unsupported sampling rate */
73 |             SKP_assert( 0 );
74 |         }
75 |     } 
76 | 
77 |     /* Check that settings are valid */
78 |     SKP_assert( psDec->frame_length > 0 && psDec->frame_length <= MAX_FRAME_LENGTH );
79 | }
80 | 
81 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_detect_SWB_input.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | /*
29 |  * Detect SWB input by measuring energy above 8 kHz.
30 |  */
31 | 
32 | #include "SKP_Silk_main.h"
33 | 
34 | void SKP_Silk_detect_SWB_input(
35 |     SKP_Silk_detect_SWB_state   *psSWBdetect,   /* (I/O) encoder state  */
36 |     const SKP_int16             samplesIn[],    /* (I) input to encoder */
37 |     SKP_int                     nSamplesIn      /* (I) length of input */
38 | )
39 | {
40 |     SKP_int     HP_8_kHz_len, i, shift;
41 |     SKP_int16   in_HP_8_kHz[ MAX_FRAME_LENGTH ];
42 |     SKP_int32   energy_32;
43 |     
44 |     /* High pass filter with cutoff at 8 khz */
45 |     HP_8_kHz_len = SKP_min_int( nSamplesIn, MAX_FRAME_LENGTH );
46 |     HP_8_kHz_len = SKP_max_int( HP_8_kHz_len, 0 );
47 | 
48 |     /* Cutoff around 9 khz */
49 |     /* A = conv(conv([8192,14613, 6868], [8192,12883, 7337]), [8192,11586, 7911]); */
50 |     /* B = conv(conv([575, -948, 575], [575, -221, 575]), [575, 104, 575]); */
51 |     SKP_Silk_biquad( samplesIn, SKP_Silk_SWB_detect_B_HP_Q13[ 0 ], SKP_Silk_SWB_detect_A_HP_Q13[ 0 ], 
52 |         psSWBdetect->S_HP_8_kHz[ 0 ], in_HP_8_kHz, HP_8_kHz_len );
53 |     for( i = 1; i < NB_SOS; i++ ) {
54 |         SKP_Silk_biquad( in_HP_8_kHz, SKP_Silk_SWB_detect_B_HP_Q13[ i ], SKP_Silk_SWB_detect_A_HP_Q13[ i ], 
55 |             psSWBdetect->S_HP_8_kHz[ i ], in_HP_8_kHz, HP_8_kHz_len );
56 |     }
57 | 
58 |     /* Calculate energy in HP signal */
59 |     SKP_Silk_sum_sqr_shift( &energy_32, &shift, in_HP_8_kHz, HP_8_kHz_len );
60 | 
61 |     /* Count concecutive samples above threshold, after adjusting threshold for number of input samples and shift */
62 |     if( energy_32 > SKP_RSHIFT( SKP_SMULBB( HP_8_KHZ_THRES, HP_8_kHz_len ), shift ) ) {
63 |         psSWBdetect->ConsecSmplsAboveThres += nSamplesIn;
64 |         if( psSWBdetect->ConsecSmplsAboveThres > CONCEC_SWB_SMPLS_THRES ) {
65 |             psSWBdetect->SWB_detected = 1;
66 |         }
67 |     } else {
68 |         psSWBdetect->ConsecSmplsAboveThres -= nSamplesIn;
69 |         psSWBdetect->ConsecSmplsAboveThres = SKP_max( psSWBdetect->ConsecSmplsAboveThres, 0 );
70 |     }
71 | 
72 |     /* If sufficient speech activity and no SWB detected, we detect the signal as being WB */
73 |     if( ( psSWBdetect->ActiveSpeech_ms > WB_DETECT_ACTIVE_SPEECH_MS_THRES ) && ( psSWBdetect->SWB_detected == 0 ) ) {
74 |         psSWBdetect->WB_detected = 1;
75 |     }
76 | }
77 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_div_oabi.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #include "SKP_Silk_typedef.h"
29 | 
30 | SKP_int32 SKP_DIV32_arm( SKP_int32 a32, SKP_int32 b32 ) {
31 | 	return ( ( SKP_int32 )( ( a32 ) / ( b32 ) ) );
32 | }
33 | 
34 | 
35 | 
36 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_init_encoder_FIX.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #include "SKP_Silk_main_FIX.h"
29 | 
30 | /*********************************/
31 | /* Initialize Silk Encoder state */
32 | /*********************************/
33 | SKP_int SKP_Silk_init_encoder_FIX(
34 |     SKP_Silk_encoder_state_FIX  *psEnc                  /* I/O  Pointer to Silk FIX encoder state       */
35 | ) {
36 |     SKP_int ret = 0;
37 |     /* Clear the entire encoder state */
38 |     SKP_memset( psEnc, 0, sizeof( SKP_Silk_encoder_state_FIX ) );
39 | 
40 | #if HIGH_PASS_INPUT
41 |     psEnc->variable_HP_smth1_Q15 = 200844; /* = SKP_Silk_log2(70)_Q0; */
42 |     psEnc->variable_HP_smth2_Q15 = 200844; /* = SKP_Silk_log2(70)_Q0; */
43 | #endif
44 | 
45 |     /* Used to deactivate e.g. LSF interpolation and fluctuation reduction */
46 |     psEnc->sCmn.first_frame_after_reset = 1;
47 | 
48 |     /* Initialize Silk VAD */
49 |     ret += SKP_Silk_VAD_Init( &psEnc->sCmn.sVAD );
50 | 
51 |     /* Initialize NSQ */
52 |     psEnc->sCmn.sNSQ.prev_inv_gain_Q16      = 65536;
53 |     psEnc->sCmn.sNSQ_LBRR.prev_inv_gain_Q16 = 65536;
54 | 
55 |     return( ret );
56 | }
57 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_inner_prod_aligned.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | /*                                                                                *
29 |  * SKP_Silk_inner_prod_aligned.c                                                *
30 |  *                                                                                *
31 |  *                                                                          	   *
32 |  * Copyright 2008-2010 (c), Skype Limited                                              *
33 |  * Date: 080601                                                                   *
34 |  *                                                                                */
35 | #include "SKP_Silk_SigProc_FIX.h"
36 | 
37 | /* sum= for(i=0;i<len;i++)inVec1[i]*inVec2[i];      ---        inner product    */
38 | /* Note for ARM asm:                                                            */
39 | /*        * inVec1 and inVec2 should be at least 2 byte aligned.    (Or defined as short/int16) */
40 | /*        * len should be positive 16bit integer.                               */
41 | /*        * only when len>6, memory access can be reduced by half.              */
42 | 
43 | #if (EMBEDDED_ARM<5) 
44 | SKP_int32 SKP_Silk_inner_prod_aligned(
45 |     const SKP_int16* const inVec1,  /*    I input vector 1    */
46 |     const SKP_int16* const inVec2,  /*    I input vector 2    */
47 |     const SKP_int             len   /*    I vector lengths    */
48 | )
49 | {
50 |     SKP_int   i; 
51 |     SKP_int32 sum = 0;
52 |     for( i = 0; i < len; i++ ) {
53 |         sum = SKP_SMLABB( sum, inVec1[ i ], inVec2[ i ] );
54 |     }
55 |     return sum;
56 | }
57 | #endif
58 | 
59 | #if (EMBEDDED_ARM<5) 
60 | SKP_int64 SKP_Silk_inner_prod16_aligned_64(
61 |     const SKP_int16 *inVec1,        /*    I input vector 1    */ 
62 |     const SKP_int16 *inVec2,        /*    I input vector 2    */
63 |     const SKP_int   len             /*    I vector lengths    */
64 | )
65 | {
66 |     SKP_int   i; 
67 |     SKP_int64 sum = 0;
68 |     for( i = 0; i < len; i++ ) {
69 |         sum = SKP_SMLALBB( sum, inVec1[ i ], inVec2[ i ] );
70 |     }
71 |     return sum;
72 | }
73 | #endif
74 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_interpolate.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #include "SKP_Silk_main.h"
29 | 
30 | /* Interpolate two vectors */
31 | void SKP_Silk_interpolate(
32 |     SKP_int                         xi[ MAX_LPC_ORDER ],    /* O    interpolated vector                     */
33 |     const SKP_int                   x0[ MAX_LPC_ORDER ],    /* I    first vector                            */
34 |     const SKP_int                   x1[ MAX_LPC_ORDER ],    /* I    second vector                           */
35 |     const SKP_int                   ifact_Q2,               /* I    interp. factor, weight on 2nd vector    */
36 |     const SKP_int                   d                       /* I    number of parameters                    */
37 | )
38 | {
39 |     SKP_int i;
40 | 
41 |     SKP_assert( ifact_Q2 >= 0 );
42 |     SKP_assert( ifact_Q2 <= ( 1 << 2 ) );
43 | 
44 |     for( i = 0; i < d; i++ ) {
45 |         xi[ i ] = ( SKP_int )( ( SKP_int32 )x0[ i ] + SKP_RSHIFT( SKP_MUL( ( SKP_int32 )x1[ i ] - ( SKP_int32 )x0[ i ], ifact_Q2 ), 2 ) );
46 |     }
47 | }
48 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_k2a.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | /*                                                                      *
29 |  * SKP_Silk_k2a.c                                                     *
30 |  *                                                                      *
31 |  * Step up function, converts reflection coefficients to prediction     *
32 |  * coefficients                                                         *
33 |  *                                                                      *
34 |  * Copyright 2008 (c), Skype Limited                                    *
35 |  * Date: 080103                                                         *
36 |  *                                                                      */
37 | #include "SKP_Silk_SigProc_FIX.h"
38 | 
39 | /* Step up function, converts reflection coefficients to prediction coefficients */
40 | void SKP_Silk_k2a(
41 |     SKP_int32            *A_Q24,                 /* O:    Prediction coefficients [order] Q24         */
42 |     const SKP_int16      *rc_Q15,                /* I:    Reflection coefficients [order] Q15         */
43 |     const SKP_int32      order                   /* I:    Prediction order                            */
44 | )
45 | {
46 |     SKP_int   k, n;
47 |     SKP_int32 Atmp[ SKP_Silk_MAX_ORDER_LPC ];
48 | 
49 |     for( k = 0; k < order; k++ ) {
50 |         for( n = 0; n < k; n++ ) {
51 |             Atmp[ n ] = A_Q24[ n ];
52 |         }
53 |         for( n = 0; n < k; n++ ) {
54 |             A_Q24[ n ] = SKP_SMLAWB( A_Q24[ n ], SKP_LSHIFT( Atmp[ k - n - 1 ], 1 ), rc_Q15[ k ] );
55 |         }
56 |         A_Q24[ k ] = -SKP_LSHIFT( (SKP_int32)rc_Q15[ k ], 9 );
57 |     }
58 | }
59 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_k2a_Q16.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | /*                                                                      *
29 |  * SKP_Silk_k2a.c                                                     *
30 |  *                                                                      *
31 |  * Step up function, converts reflection coefficients to prediction     *
32 |  * coefficients                                                         *
33 |  *                                                                      *
34 |  * Copyright 2008 (c), Skype Limited                                    *
35 |  * Date: 080103                                                         *
36 |  *                                                                      */
37 | #include "SKP_Silk_SigProc_FIX.h"
38 | 
39 | /* Step up function, converts reflection coefficients to prediction coefficients */
40 | void SKP_Silk_k2a_Q16(
41 |     SKP_int32            *A_Q24,                 /* O:    Prediction coefficients [order] Q24         */
42 |     const SKP_int32      *rc_Q16,                /* I:    Reflection coefficients [order] Q16         */
43 |     const SKP_int32      order                   /* I:    Prediction order                            */
44 | )
45 | {
46 |     SKP_int   k, n;
47 |     SKP_int32 Atmp[ SKP_Silk_MAX_ORDER_LPC ];
48 | 
49 |     for( k = 0; k < order; k++ ) {
50 |         for( n = 0; n < k; n++ ) {
51 |             Atmp[ n ] = A_Q24[ n ];
52 |         }
53 |         for( n = 0; n < k; n++ ) {
54 |             A_Q24[ n ] = SKP_SMLAWW( A_Q24[ n ], Atmp[ k - n - 1 ], rc_Q16[ k ] );
55 |         }
56 |         A_Q24[ k ] = -SKP_LSHIFT( rc_Q16[ k ], 8 );
57 |     }
58 | }
59 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_lin2log.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | /*                                                                      *
29 |  * SKP_Silk_lin2log.c                                                 *
30 |  *                                                                      *
31 |  * Convert input to a log scale                                         *
32 |  * Approximation of 128 * log2()                                        *
33 |  *                                                                      *
34 |  * Copyright 2006 (c), Skype Limited                                    *
35 |  * Date: 060221                                                         *
36 |  *                                                                      */
37 | #include "SKP_Silk_SigProc_FIX.h"
38 | #if EMBEDDED_ARM<4
39 | /* Approximation of 128 * log2() (very close inverse of approx 2^() below) */
40 | /* Convert input to a log scale    */ 
41 | SKP_int32 SKP_Silk_lin2log( const SKP_int32 inLin )    /* I:    Input in linear scale */
42 | {
43 |     SKP_int32 lz, frac_Q7;
44 | 
45 |     SKP_Silk_CLZ_FRAC( inLin, &lz, &frac_Q7 );
46 | 
47 |     /* Piece-wise parabolic approximation */
48 |     return( SKP_LSHIFT( 31 - lz, 7 ) + SKP_SMLAWB( frac_Q7, SKP_MUL( frac_Q7, 128 - frac_Q7 ), 179 ) );
49 | }
50 | #endif
51 | 
52 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_lin2log_arm.S:
--------------------------------------------------------------------------------
  1 | /***********************************************************************
  2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
  3 | Redistribution and use in source and binary forms, with or without 
  4 | modification, (subject to the limitations in the disclaimer below) 
  5 | are permitted provided that the following conditions are met:
  6 | - Redistributions of source code must retain the above copyright notice,
  7 | this list of conditions and the following disclaimer.
  8 | - Redistributions in binary form must reproduce the above copyright 
  9 | notice, this list of conditions and the following disclaimer in the 
 10 | documentation and/or other materials provided with the distribution.
 11 | - Neither the name of Skype Limited, nor the names of specific 
 12 | contributors, may be used to endorse or promote products derived from 
 13 | this software without specific prior written permission.
 14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
 15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
 16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
 18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
 19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
 20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
 22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 26 | ***********************************************************************/
 27 | 
 28 | #if defined(__arm__)
 29 | 
 30 | #include "SKP_Silk_AsmPreproc.h"
 31 | #if EMBEDDED_ARM>=5
 32 | 
 33 | 	VARDEF val_lz, r1
 34 | 	VARDEF val_shift, r2
 35 | 	VARDEF val_frac, r3
 36 | 
 37 | 	VARDEF val_ret1, r1
 38 | 	VARDEF val_128minfrac, r2
 39 | 	VARDEF val_mul_ret, r0
 40 | 	VARDEF val_add_ret, r3
 41 | 	VARDEF const1, r1
 42 | 
 43 | .globl	SYM(SKP_Silk_lin2log)
 44 | SYM(SKP_Silk_lin2log):
 45 | 	stmdb	sp!,  {r4-r5, fp, ip, lr}
 46 | 	add		fp, sp, #16
 47 | 	
 48 | 	clz		val_lz, r0											/*lz*/
 49 | 	cmp		val_lz, #24
 50 | 	sub		val_shift, val_lz, #24
 51 | #ifdef _WINRT
 52 | 	bge		LR(0, f)
 53 | 	rsb		val_shift, val_lz, #24
 54 | 	mov		val_frac, r0, asr val_shift
 55 | 	b		LR(1, f)
 56 | L(0)	
 57 | 	mov		val_frac, r0, lsl val_shift
 58 | L(1)	
 59 | #else	
 60 | 	rsblt	val_shift, val_lz, #24
 61 | 	movlt	val_frac, r0, asr val_shift
 62 | 	movge	val_frac, r0, lsl val_shift
 63 | #endif	
 64 | 	and		val_frac, val_frac, #0x7F							/*frac_Q7*/
 65 | 	
 66 | 	rsb		val_ret1, val_lz, #31								/*31-lz*/
 67 | 	rsb		val_128minfrac, val_frac, #128						/*128-frac_Q7*/
 68 | 	mov		val_ret1, val_ret1, lsl #7
 69 | 	mul		val_mul_ret, val_frac, val_128minfrac				/*SKP_MUL(frac_Q7, 128 - frac_Q7)*/
 70 | 	add		val_add_ret, val_ret1, val_frac
 71 | 	mov		const1, #179
 72 | 	smlawb	r0, val_mul_ret, const1, val_add_ret
 73 | 	
 74 | 	ldmia	sp!,  {r4-r5, fp, ip, pc}
 75 | 	
 76 | #elif EMBEDDED_ARM>=4
 77 | 	VARDEF val_lz, r0
 78 | 	VARDEF val_in, r4
 79 | 	VARDEF val_shift, r1
 80 | 	VARDEF val_frac, r2
 81 | 	VARDEF val_ret1, r1
 82 | 	VARDEF val_128minfrac, r3
 83 | 	VARDEF val_mul_ret, r3
 84 | 	VARDEF tmp0, r4
 85 | 	VARDEF const1, r2
 86 | 	VARDEF val_ret, r0
 87 | 
 88 | .globl	SYM(SKP_Silk_lin2log)
 89 | SYM(SKP_Silk_lin2log):
 90 | 	stmdb	sp!,  {r4-r5, fp, ip, lr}
 91 | 	add		fp, sp, #16
 92 | 
 93 | 	mov		val_in, r0
 94 | 	bl		SYM(SKP_Silk_CLZ32)
 95 | 	cmp		val_lz, #24
 96 | 	sub		val_shift, val_lz, #24
 97 | 	rsblt	val_shift, val_lz, #24
 98 | 	movlt	val_frac, val_in, asr val_shift
 99 | 	movge	val_frac, val_in, lsl val_shift
100 | 	and		val_frac, val_frac, #0x7F							/*frac_Q7*/
101 | 	
102 | 	rsb		val_ret1, val_lz, #31								/*31-lz*/
103 | 	rsb		val_128minfrac, val_frac, #128							/*128-frac_Q7*/
104 | 	mov		val_ret1, val_ret1, lsl #7
105 | 	mul		val_mul_ret, val_frac, val_128minfrac								/*SKP_MUL(frac_Q7, 128 - frac_Q7)*/
106 | 	add		val_ret, val_ret1, val_frac
107 | 	mov		tmp0, #0
108 | 	mov		const1, #0xB30000
109 | 	smlal	tmp0, val_ret, val_mul_ret, const1
110 | 	
111 | 	ldmia	sp!,  {r4-r5, fp, ip, pc}
112 | #endif
113 | 	END
114 | #endif
115 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_log2lin.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | /*                                                                      *
29 |  * SKP_Silk_log2lin.c                                                 *
30 |  *                                                                      *
31 |  * Convert input to a linear scale                                      *
32 |  *                                                                      *
33 |  * Copyright 2006 (c), Skype Limited                                    *
34 |  * Date: 060221                                                         *
35 |  *                                                                      */
36 | #include "SKP_Silk_SigProc_FIX.h"
37 | 
38 | /* Approximation of 2^() (very close inverse of SKP_Silk_lin2log()) */
39 | /* Convert input to a linear scale    */ 
40 | SKP_int32 SKP_Silk_log2lin( const SKP_int32 inLog_Q7 )    /* I:    Input on log scale */ 
41 | {
42 |     SKP_int32 out, frac_Q7;
43 | 
44 |     if( inLog_Q7 < 0 ) {
45 |         return( 0 );
46 |     } else if( inLog_Q7 >= ( 31 << 7 ) ) {
47 |         /* Saturate, and prevent wrap-around */
48 |         return( SKP_int32_MAX );
49 |     }
50 | 
51 |     out = SKP_LSHIFT( 1, SKP_RSHIFT( inLog_Q7, 7 ) );
52 |     frac_Q7 = inLog_Q7 & 0x7F;
53 |     if( inLog_Q7 < 2048 ) {
54 |         /* Piece-wise parabolic approximation */
55 |         out = SKP_ADD_RSHIFT( out, SKP_MUL( out, SKP_SMLAWB( frac_Q7, SKP_MUL( frac_Q7, 128 - frac_Q7 ), -174 ) ), 7 );
56 |     } else {
57 |         /* Piece-wise parabolic approximation */
58 |         out = SKP_MLA( out, SKP_RSHIFT( out, 7 ), SKP_SMLAWB( frac_Q7, SKP_MUL( frac_Q7, 128 - frac_Q7 ), -174 ) );
59 |     }
60 |     return out;
61 | }
62 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_pitch_est_defines.h:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #ifndef SIGPROCFIX_PITCH_EST_DEFINES_H
29 | #define SIGPROCFIX_PITCH_EST_DEFINES_H
30 | 
31 | /************************************************************/
32 | /* Definitions For Fix pitch estimator                      */
33 | /************************************************************/
34 | 
35 | #define PITCH_EST_SHORTLAG_BIAS_Q15         6554    /* 0.2f. for logarithmic weighting    */
36 | #define PITCH_EST_PREVLAG_BIAS_Q15          6554    /* Prev lag bias    */
37 | #define PITCH_EST_FLATCONTOUR_BIAS_Q20      52429   /* 0.05f */
38 | 
39 | #endif
40 | 
41 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_pitch_est_tables.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #include "SKP_Silk_typedef.h"
29 | #include "SKP_Silk_common_pitch_est_defines.h"
30 | 
31 | /********************************************************/
32 | /* Auto Generated File from generate_pitch_est_tables.m */
33 | /********************************************************/
34 | 
35 | const SKP_int16 SKP_Silk_CB_lags_stage2[PITCH_EST_NB_SUBFR][PITCH_EST_NB_CBKS_STAGE2_EXT] =
36 | {
37 |     {0, 2,-1,-1,-1, 0, 0, 1, 1, 0, 1},
38 |     {0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0},
39 |     {0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0},
40 |     {0,-1, 2, 1, 0, 1, 1, 0, 0,-1,-1} 
41 | };
42 | 
43 | const SKP_int16 SKP_Silk_CB_lags_stage3[PITCH_EST_NB_SUBFR][PITCH_EST_NB_CBKS_STAGE3_MAX] =
44 | {
45 |     {-9,-7,-6,-5,-5,-4,-4,-3,-3,-2,-2,-2,-1,-1,-1, 0, 0, 0, 1, 1, 0, 1, 2, 2, 2, 3, 3, 4, 4, 5, 6, 5, 6, 8},
46 |     {-3,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0,-1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 2, 1, 2, 2, 2, 2, 3},
47 |     { 3, 3, 2, 2, 2, 2, 1, 2, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,-1, 0, 0,-1,-1,-1,-1,-1,-2,-2,-2},
48 |     { 9, 8, 6, 5, 6, 5, 4, 4, 3, 3, 2, 2, 2, 1, 0, 1, 1, 0, 0, 0,-1,-1,-1,-2,-2,-2,-3,-3,-4,-4,-5,-5,-6,-7}
49 |  };
50 | 
51 | const SKP_int16 SKP_Silk_Lag_range_stage3[ SKP_Silk_PITCH_EST_MAX_COMPLEX + 1 ] [ PITCH_EST_NB_SUBFR ][ 2 ] =
52 | {
53 |     /* Lags to search for low number of stage3 cbks */
54 |     {
55 |         {-2,6},
56 |         {-1,5},
57 |         {-1,5},
58 |         {-2,7}
59 |     },
60 |     /* Lags to search for middle number of stage3 cbks */
61 |     {
62 |         {-4,8},
63 |         {-1,6},
64 |         {-1,6},
65 |         {-4,9}
66 |     },
67 |     /* Lags to search for max number of stage3 cbks */
68 |     {
69 |         {-9,12},
70 |         {-3,7},
71 |         {-2,7},
72 |         {-7,13}
73 |     }
74 | };
75 | 
76 | const SKP_int16 SKP_Silk_cbk_sizes_stage3[SKP_Silk_PITCH_EST_MAX_COMPLEX + 1] = 
77 | {
78 |     PITCH_EST_NB_CBKS_STAGE3_MIN,
79 |     PITCH_EST_NB_CBKS_STAGE3_MID,
80 |     PITCH_EST_NB_CBKS_STAGE3_MAX
81 | };
82 | 
83 | const SKP_int16 SKP_Silk_cbk_offsets_stage3[SKP_Silk_PITCH_EST_MAX_COMPLEX + 1] = 
84 | {
85 |     ((PITCH_EST_NB_CBKS_STAGE3_MAX - PITCH_EST_NB_CBKS_STAGE3_MIN) >> 1),
86 |     ((PITCH_EST_NB_CBKS_STAGE3_MAX - PITCH_EST_NB_CBKS_STAGE3_MID) >> 1),
87 |     0
88 | };
89 | 
90 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_regularize_correlations_FIX.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #include "SKP_Silk_main_FIX.h"
29 | 
30 | /* Add noise to matrix diagonal */
31 | void SKP_Silk_regularize_correlations_FIX(
32 |     SKP_int32                       *XX,                /* I/O  Correlation matrices                        */
33 |     SKP_int32                       *xx,                /* I/O  Correlation values                          */
34 |     SKP_int32                       noise,              /* I    Noise to add                                */
35 |     SKP_int                         D                   /* I    Dimension of XX                             */
36 | )
37 | {
38 |     SKP_int i;
39 |     for( i = 0; i < D; i++ ) {
40 |         matrix_ptr( &XX[ 0 ], i, i, D ) = SKP_ADD32( matrix_ptr( &XX[ 0 ], i, i, D ), noise );
41 |     }
42 |     xx[ 0 ] += noise;
43 | }
44 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_resampler_down2.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | /*                                                                      *
29 |  * SKP_Silk_resampler_down2.c                                         *
30 |  *                                                                      *
31 |  * Downsample by a factor 2, mediocre quality                           *
32 |  *                                                                      *
33 |  * Copyright 2010 (c), Skype Limited                                    *
34 |  *                                                                      */
35 | 
36 | #include "SKP_Silk_SigProc_FIX.h"
37 | #include "SKP_Silk_resampler_rom.h"
38 | 
39 | #if (EMBEDDED_ARM<5) 
40 | /* Downsample by a factor 2, mediocre quality */
41 | void SKP_Silk_resampler_down2(
42 |     SKP_int32                           *S,         /* I/O: State vector [ 2 ]                  */
43 |     SKP_int16                           *out,       /* O:   Output signal [ len ]               */
44 |     const SKP_int16                     *in,        /* I:   Input signal [ floor(len/2) ]       */
45 |     SKP_int32                           inLen       /* I:   Number of input samples             */
46 | )
47 | {
48 |     SKP_int32 k, len2 = SKP_RSHIFT32( inLen, 1 );
49 |     SKP_int32 in32, out32, Y, X;
50 | 
51 |     SKP_assert( SKP_Silk_resampler_down2_0 > 0 );
52 |     SKP_assert( SKP_Silk_resampler_down2_1 < 0 );
53 | 
54 |     /* Internal variables and state are in Q10 format */
55 |     for( k = 0; k < len2; k++ ) {
56 |         /* Convert to Q10 */
57 |         in32 = SKP_LSHIFT( (SKP_int32)in[ 2 * k ], 10 );
58 | 
59 |         /* All-pass section for even input sample */
60 |         Y      = SKP_SUB32( in32, S[ 0 ] );
61 |         X      = SKP_SMLAWB( Y, Y, SKP_Silk_resampler_down2_1 );
62 |         out32  = SKP_ADD32( S[ 0 ], X );
63 |         S[ 0 ] = SKP_ADD32( in32, X );
64 | 
65 |         /* Convert to Q10 */
66 |         in32 = SKP_LSHIFT( (SKP_int32)in[ 2 * k + 1 ], 10 );
67 | 
68 |         /* All-pass section for odd input sample, and add to output of previous section */
69 |         Y      = SKP_SUB32( in32, S[ 1 ] );
70 |         X      = SKP_SMULWB( Y, SKP_Silk_resampler_down2_0 );
71 |         out32  = SKP_ADD32( out32, S[ 1 ] );
72 |         out32  = SKP_ADD32( out32, X );
73 |         S[ 1 ] = SKP_ADD32( in32, X );
74 | 
75 |         /* Add, convert back to int16 and store to output */
76 |         out[ k ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( out32, 11 ) );
77 |     }
78 | }
79 | #endif
80 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_resampler_down2_arm.S:
--------------------------------------------------------------------------------
  1 | /***********************************************************************
  2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
  3 | Redistribution and use in source and binary forms, with or without 
  4 | modification, (subject to the limitations in the disclaimer below) 
  5 | are permitted provided that the following conditions are met:
  6 | - Redistributions of source code must retain the above copyright notice,
  7 | this list of conditions and the following disclaimer.
  8 | - Redistributions in binary form must reproduce the above copyright 
  9 | notice, this list of conditions and the following disclaimer in the 
 10 | documentation and/or other materials provided with the distribution.
 11 | - Neither the name of Skype Limited, nor the names of specific 
 12 | contributors, may be used to endorse or promote products derived from 
 13 | this software without specific prior written permission.
 14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
 15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
 16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
 18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
 19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
 20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
 22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 26 | ***********************************************************************/
 27 | 
 28 | #if defined(__arm__)
 29 | 
 30 | #include "SKP_Silk_AsmPreproc.h"
 31 | 
 32 | #if EMBEDDED_ARM>=5
 33 | #define SKP_Silk_resampler_down2_0 0x2690
 34 | #define SKP_Silk_resampler_down2_1 0x9B81
 35 | 
 36 | 	VARDEF xy0, r4
 37 | 	VARDEF xy1, r5
 38 | 	VARDEF down2_coefs, _r7
 39 | 	VARDEF S_0, r6
 40 | 	VARDEF S_1, r8
 41 | 	VARDEF in0, sb
 42 | 	VARDEF in1, sl
 43 | 	VARDEF out32, r0
 44 | 
 45 | .set	sp_S, 0 
 46 | .globl	SYM(SKP_Silk_resampler_down2)
 47 | SYM(SKP_Silk_resampler_down2):
 48 | 	stmdb	sp!,  {r4-r10, fp, ip, lr}
 49 | 	add		fp, sp, #36
 50 | 	sub		sp, sp, #4
 51 | 	ldrsh		in0, [r2], #2			// Avoid un-aligned access
 52 | 	ldrsh		in1, [r2], #2
 53 | 	str		r0, [sp, #sp_S]
 54 | 	ldmia		r0, {S_0, S_1}
 55 | 	mov		down2_coefs, #0x26000000
 56 | 	add		down2_coefs, down2_coefs, #0x900000
 57 | 	add		down2_coefs, down2_coefs, #0x9B00
 58 | 	add		down2_coefs, down2_coefs, #0x81		
 59 | 	mov		r3, r3, asr #1
 60 | 	mov		ip, #1024
 61 | L(0)
 62 | 	add		out32, S_0, S_1
 63 | 	rsb		xy0, S_0, in0, lsl #10
 64 | 	rsb		xy1, S_1, in1, lsl #10
 65 | 	smlawb		xy0, xy0, down2_coefs, xy0
 66 | 	smulwt		xy1, xy1, down2_coefs
 67 | 	add		out32, out32, xy0
 68 | 	add		S_0, xy0, in0, lsl #10
 69 | 	add		out32, out32, xy1
 70 | 	add		S_1, xy1, in1, lsl #10
 71 | #if EMBEDDED_ARM>=6
 72 | 	qadd		out32, out32, ip
 73 | 	subs		r3, r3, #1
 74 | 	ssat		out32, #16, out32, asr #11
 75 | #ifdef	_WINRT
 76 | 	ble			LR(1, f)
 77 | 	ldrsh		in0, [r2], #2
 78 | 	ldrsh		in1, [r2], #2
 79 | L(1)	
 80 | #else	
 81 | 	ldrgtsh		in0, [r2], #2
 82 | 	ldrgtsh		in1, [r2], #2
 83 | #endif	
 84 | #else
 85 | 	qadd		out32, out32, ip
 86 | 	cmp		out32, #0x4000000
 87 | 	movge		out32, #0x4000000
 88 | 	subge		out32, out32, #1
 89 | 	cmn		out32, #0x4000000
 90 | 	movlt		out32, #0x4000000
 91 | 	subs		r3, r3, #1
 92 | 	mov		out32, out32, asr #11
 93 | 	ldrgtsh		in0, [r2], #2	
 94 | 	ldrgtsh		in1, [r2], #2
 95 | #endif	
 96 | 	
 97 | 	strh		out32, [r1], #2
 98 | 	bgt		LR(0, b)
 99 | 
100 | 	ldr		r0, [sp, #sp_S]
101 | 	stmia		r0, {S_0, S_1}
102 | 
103 | 	add		sp, sp, #4
104 | 	ldmia	sp!,  {r4-r10, fp, ip, pc}
105 | 	END
106 | #endif
107 | #endif
108 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_resampler_private_AR2.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | /*																		*
29 |  * SKP_Silk_resampler_private_AR2. c                                  *
30 |  *																		*
31 |  * Second order AR filter with single delay elements                	*
32 |  *                                                                      *
33 |  * Copyright 2010 (c), Skype Limited                                    *
34 |  *                                                                      */
35 | 
36 | #include "SKP_Silk_SigProc_FIX.h"
37 | #include "SKP_Silk_resampler_private.h"
38 | 
39 | #if (EMBEDDED_ARM<5)  
40 | /* Second order AR filter with single delay elements */
41 | void SKP_Silk_resampler_private_AR2(
42 | 	SKP_int32					    S[],		    /* I/O: State vector [ 2 ]			    	    */
43 | 	SKP_int32					    out_Q8[],		/* O:	Output signal				    	    */
44 | 	const SKP_int16				    in[],			/* I:	Input signal				    	    */
45 | 	const SKP_int16				    A_Q14[],		/* I:	AR coefficients, Q14 	                */
46 | 	SKP_int32				        len				/* I:	Signal length				        	*/
47 | )
48 | {
49 | 	SKP_int32	k;
50 | 	SKP_int32	out32;
51 | 
52 | 	for( k = 0; k < len; k++ ) {
53 | 		out32       = SKP_ADD_LSHIFT32( S[ 0 ], (SKP_int32)in[ k ], 8 );
54 | 		out_Q8[ k ] = out32;
55 | 		out32       = SKP_LSHIFT( out32, 2 );
56 | 		S[ 0 ]      = SKP_SMLAWB( S[ 1 ], out32, A_Q14[ 0 ] );
57 | 		S[ 1 ]      = SKP_SMULWB( out32, A_Q14[ 1 ] );
58 | 	}
59 | }
60 | #endif
61 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_resampler_private_AR2_arm.S:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #if defined(__arm__)
29 | 
30 | #include "SKP_Silk_AsmPreproc.h"
31 | 
32 | #if EMBEDDED_ARM>=5
33 | 
34 | 	VARDEF	len, r4
35 | 	VARDEF	S_0, r5
36 | 	VARDEF	S_1, r6
37 | 	VARDEF	in0, _r7
38 | 	VARDEF	out32, r8
39 | 	VARDEF	A_Q140, sb
40 | 	VARDEF	A_Q141, sl
41 | 
42 | .set	sp_S, 0 
43 | .globl	SYM(SKP_Silk_resampler_private_AR2)
44 | SYM(SKP_Silk_resampler_private_AR2):
45 | 	stmdb	sp!,  {r4-r10, fp, ip, lr}
46 | 	add		fp, sp, #36
47 | 	sub		sp, sp, #4
48 | .set	sp_len, 44 
49 | 	
50 | 	str	r0, [sp, #sp_S]
51 | 	ldr	S_0, [r0], #4
52 | 	ldr	S_1, [r0], #-4
53 | 	ldr	len, [sp, #sp_len]
54 | 	ldrsh	A_Q140, [r3], #2
55 | 	ldrsh	A_Q141, [r3]
56 | 	cmp	len, #0
57 | 	beq	LR(1, f)
58 | 
59 | L(0)
60 | 	ldrsh	in0, [r2], #2
61 | 	add	out32, S_0, in0, lsl #8
62 | 	str	out32, [r1], #4
63 | 	subs	len, len, #1
64 | 	mov	out32, out32, lsl #2
65 | 	smlawb	S_0, out32, A_Q140, S_1
66 | 	smulwb	S_1, out32, A_Q141
67 | 	bgt	LR(0, b)	
68 | 	
69 | 	str	S_0, [r0], #4
70 | 	str	S_1, [r0]
71 | L(1)	
72 | 	add		sp, sp, #4
73 | 	ldmia	sp!,  {r4-r10, fp, ip, pc}
74 | 	END
75 | #endif
76 | #endif
77 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_resampler_private_ARMA4.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | /*																		*
29 |  * SKP_Silk_resampler_private_ARMA4.c                                 *
30 |  *																		*
31 |  * Fourth order ARMA filter, applies 64x gain                           *
32 |  *                                                                      *
33 |  * Copyright 2010 (c), Skype Limited                                    *
34 |  *                                                                      */
35 | 
36 | #include "SKP_Silk_SigProc_FIX.h"
37 | #include "SKP_Silk_resampler_private.h"
38 | 
39 | /* Fourth order ARMA filter                                             */
40 | /* Internally operates as two biquad filters in sequence.               */
41 | 
42 | /* Coeffients are stored in a packed format:                                                        */
43 | /*    { B1_Q14[1], B2_Q14[1], -A1_Q14[1], -A1_Q14[2], -A2_Q14[1], -A2_Q14[2], gain_Q16 }            */
44 | /* where it is assumed that B*_Q14[0], B*_Q14[2], A*_Q14[0] are all 16384                           */
45 | #if (EMBEDDED_ARM<5) 
46 | void SKP_Silk_resampler_private_ARMA4(
47 | 	SKP_int32					    S[],		    /* I/O: State vector [ 4 ]			    	    */
48 | 	SKP_int16					    out[],		    /* O:	Output signal				    	    */
49 | 	const SKP_int16				    in[],			/* I:	Input signal				    	    */
50 | 	const SKP_int16				    Coef[],		    /* I:	ARMA coefficients [ 7 ]                 */
51 | 	SKP_int32				        len				/* I:	Signal length				        	*/
52 | )
53 | {
54 | 	SKP_int32 k;
55 | 	SKP_int32 in_Q8, out1_Q8, out2_Q8, X;
56 | 
57 | 	for( k = 0; k < len; k++ ) {
58 |         in_Q8  = SKP_LSHIFT32( (SKP_int32)in[ k ], 8 );
59 | 
60 |         /* Outputs of first and second biquad */
61 |         out1_Q8 = SKP_ADD_LSHIFT32( in_Q8,   S[ 0 ], 2 );
62 |         out2_Q8 = SKP_ADD_LSHIFT32( out1_Q8, S[ 2 ], 2 );
63 | 
64 |         /* Update states, which are stored in Q6. Coefficients are in Q14 here */
65 |         X      = SKP_SMLAWB( S[ 1 ], in_Q8,   Coef[ 0 ] );
66 |         S[ 0 ] = SKP_SMLAWB( X,      out1_Q8, Coef[ 2 ] );
67 | 
68 |         X      = SKP_SMLAWB( S[ 3 ], out1_Q8, Coef[ 1 ] );
69 |         S[ 2 ] = SKP_SMLAWB( X,      out2_Q8, Coef[ 4 ] );
70 | 
71 |         S[ 1 ] = SKP_SMLAWB( SKP_RSHIFT32( in_Q8,   2 ), out1_Q8, Coef[ 3 ] );
72 |         S[ 3 ] = SKP_SMLAWB( SKP_RSHIFT32( out1_Q8, 2 ), out2_Q8, Coef[ 5 ] );
73 | 
74 |         /* Apply gain and store to output. The coefficient is in Q16 */
75 |         out[ k ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT32( SKP_SMLAWB( 128, out2_Q8, Coef[ 6 ] ), 8 ) );
76 | 	}
77 | }
78 | #endif
79 | 
80 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_resampler_private_ARMA4_arm.S:
--------------------------------------------------------------------------------
  1 | /***********************************************************************
  2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
  3 | Redistribution and use in source and binary forms, with or without 
  4 | modification, (subject to the limitations in the disclaimer below) 
  5 | are permitted provided that the following conditions are met:
  6 | - Redistributions of source code must retain the above copyright notice,
  7 | this list of conditions and the following disclaimer.
  8 | - Redistributions in binary form must reproduce the above copyright 
  9 | notice, this list of conditions and the following disclaimer in the 
 10 | documentation and/or other materials provided with the distribution.
 11 | - Neither the name of Skype Limited, nor the names of specific 
 12 | contributors, may be used to endorse or promote products derived from 
 13 | this software without specific prior written permission.
 14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
 15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
 16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
 18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
 19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
 20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
 22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 26 | ***********************************************************************/
 27 | 
 28 | #if defined(__arm__)
 29 | 
 30 | #include "SKP_Silk_AsmPreproc.h"
 31 | 
 32 | #if EMBEDDED_ARM>=5
 33 | 
 34 | 	VARDEF len, r0
 35 | 	VARDEF S_0, r3
 36 | 	VARDEF S_1, r4
 37 | 	VARDEF S_2, r5
 38 | 	VARDEF S_3, r6
 39 | 	VARDEF in, _r7
 40 | 	VARDEF out1, r8
 41 | 	VARDEF coef01, sb
 42 | 	VARDEF coef23, sl
 43 | 	VARDEF coef45, ip
 44 | 	VARDEF coef6, r8
 45 | 	VARDEF coef_tmp, _r7
 46 | 	VARDEF out2, lr
 47 | 
 48 | .set	sp_S, 0 
 49 | .set	sp_coef, 4 
 50 | .globl	SYM(SKP_Silk_resampler_private_ARMA4)
 51 | SYM(SKP_Silk_resampler_private_ARMA4):
 52 | 	stmdb	sp!,  {r4-r10, fp, ip, lr}
 53 | 	add		fp, sp, #36
 54 | 	sub		sp, sp, #8
 55 | .set	sp_len, 48 
 56 | 	
 57 | 	ldr	lr, [sp, #sp_len]
 58 | 	ldrh	coef01, [r3], #2
 59 | 	ldrh	S_1, [r3], #2
 60 | 	ldrh	coef23, [r3], #2
 61 | 	ldrh	S_2, [r3], #2
 62 | 	ldrh	coef45, [r3], #2
 63 | 	ldrh	S_3, [r3], #2
 64 | 	ldrh	coef6, [r3], #2
 65 | 	cmp	lr, #0
 66 | 	str	r0, [sp, #sp_S]
 67 | 	beq	LR(1, f)			// if len==0
 68 | 	
 69 | 	str	coef6, [sp, #sp_coef]
 70 | 	ldrsh	in, [r2], #2
 71 | 	add	coef01, coef01, S_1, lsl #16
 72 | 	add	coef23, coef23, S_2, lsl #16
 73 | 	add	coef45, coef45, S_3, lsl #16
 74 | 	ldmia	r0, {S_0, S_1, S_2, S_3}
 75 | 	mov	len, lr	
 76 | 	
 77 | L(0)
 78 | 	mov	in, in, lsl #8
 79 | 	add	out1, in, S_0, lsl #2
 80 | 	add	out2, out1, S_2, lsl #2
 81 | 	
 82 | 	smlawb	S_0, in, coef01, S_1
 83 | 	smlawb	S_0, out1, coef23, S_0
 84 | 	smlawt	S_2, out1, coef01, S_3
 85 | 	smlawb	S_2, out2, coef45, S_2
 86 | 	smulwt	S_1, out1, coef23
 87 | 	smulwt	S_3, out2, coef45
 88 | 	add	S_1, S_1, in, asr #2
 89 | 	ldr	coef_tmp, [sp, #sp_coef]
 90 | 	add	S_3, S_3, out1, asr #2
 91 | 	
 92 | 	mov	out1, #128
 93 | 	smlawb	out1, out2, coef_tmp, out1
 94 | #if EMBEDDED_ARM<6	
 95 | 	cmp	out1, #0x800000
 96 | 	movge	out1, #0x800000
 97 | 	subge	out1, out1, #1
 98 | 	cmn	out1, #0x800000
 99 | 	movlt	out1, #0x800000
100 | 	mov	out1, out1, asr #8
101 | #else		
102 | 	ssat	out1, #16, out1, asr #8
103 | #endif
104 | 	subs	len, len, #1
105 | 	strh	out1, [r1], #2
106 | #ifdef _WINRT
107 | 	ble		LR(1, f)
108 | 	ldrsh	in, [r2], #2
109 | 	b	LR(0, b)
110 | L(1)	
111 | #else	
112 | 	ldrgtsh	in, [r2], #2
113 | 	bgt	LR(0, b)
114 | #endif	
115 | 	
116 | 	ldr	r0, [sp, #sp_S]
117 | 	stmia	r0, {S_0, S_1, S_2, S_3}
118 | L(1)	
119 | 	add		sp, sp, #8
120 | 	ldmia	sp!,  {r4-r10, fp, ip, pc}
121 | 	END
122 | #endif
123 | #endif
124 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_resampler_private_IIR_FIR_arm.S:
--------------------------------------------------------------------------------
  1 | /***********************************************************************
  2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
  3 | Redistribution and use in source and binary forms, with or without 
  4 | modification, (subject to the limitations in the disclaimer below) 
  5 | are permitted provided that the following conditions are met:
  6 | - Redistributions of source code must retain the above copyright notice,
  7 | this list of conditions and the following disclaimer.
  8 | - Redistributions in binary form must reproduce the above copyright 
  9 | notice, this list of conditions and the following disclaimer in the 
 10 | documentation and/or other materials provided with the distribution.
 11 | - Neither the name of Skype Limited, nor the names of specific 
 12 | contributors, may be used to endorse or promote products derived from 
 13 | this software without specific prior written permission.
 14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
 15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
 16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
 18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
 19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
 20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
 22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 26 | ***********************************************************************/
 27 | 
 28 | #if defined(__arm__)
 29 | 
 30 | #include "SKP_Silk_AsmPreproc.h"
 31 | 
 32 | #if EMBEDDED_ARM>=5
 33 | 
 34 | 	VARDEF ind, r4
 35 | 	VARDEF tab1, r5
 36 | 	VARDEF tab2, r6
 37 | 	VARDEF tab3, _r7
 38 | 	VARDEF val1, r8
 39 | 	VARDEF val2, sb
 40 | 	VARDEF val3, r2
 41 | 	VARDEF val4, r3
 42 | 	VARDEF tmp1, sl
 43 | 	VARDEF tmp2, r2
 44 | 	VARDEF tmp3, r3
 45 | 	VARDEF tmp4, ip
 46 | 	VARDEF out, sl
 47 | 
 48 | .set	sp_max_i, 0 
 49 | .set	sp_inc, 4 
 50 | 
 51 | 	EXTERN SYM(SKP_Silk_resampler_frac_FIR_144_alt)
 52 | .globl	SYM(SKP_Silk_resampler_private_IIR_FIR_INTERPOL)
 53 | SYM(SKP_Silk_resampler_private_IIR_FIR_INTERPOL):
 54 | 	stmdb	sp!,  {r4-r10, fp, ip, lr}
 55 | 	add		fp, sp, #36
 56 | 	sub		sp, sp, #8
 57 | 	str		r2, [sp, #sp_max_i]
 58 | 	str		r3, [sp, #sp_inc]
 59 | 	cmp		r2, #0
 60 | 	mov		tmp3, #0xFF00
 61 | 	mov		ind, #0
 62 | 	ble		LR(1, f)
 63 | 	add		tmp3, tmp3, #0xFF
 64 | L(0)
 65 | 	ldr		tmp1, TABLE(L0, =SKP_Silk_resampler_frac_FIR_144_alt)
 66 | 	and		tmp3, ind, tmp3
 67 | 	mov		tmp2, #144
 68 | 	mov		tmp4, ind, asr #16
 69 | 	smulwb	tmp2, tmp3, tmp2
 70 | 	add		tmp1, tmp1, tmp2, lsl #3
 71 | 	add		tmp1, tmp1, tmp2, lsl #2
 72 | 	add		tmp4, r1, tmp4, lsl #1
 73 | 	
 74 | 	ldmia	tmp1, {tab1, tab2, tab3}
 75 | 	ldrsh	val1, [tmp4], #2
 76 | 	ldrsh	val2, [tmp4], #2
 77 | 	ldrsh	val3, [tmp4], #2
 78 | 	ldrsh	val4, [tmp4], #2
 79 | 	smulbb	out, val1, tab1
 80 | 	smlabt	out, val2, tab1, out
 81 | 	ldrsh	val1, [tmp4], #2
 82 | 	ldrsh	val2, [tmp4]
 83 | 	smlabb	out, val3, tab2, out
 84 | 	smlabt	out, val4, tab2, out
 85 | 	ldr		r2, [sp, #sp_max_i]
 86 | 	ldr		r3, [sp, #sp_inc]
 87 | 	smlabb	out, val1, tab3, out
 88 | 	smlabt	out, val2, tab3, out
 89 | 	add		ind, ind, r3
 90 | 	adds	out, out, #1<<14
 91 | 	mov		tmp3, #0xFF00
 92 | #ifdef _WINRT
 93 | 	bvc		LR(2, f)
 94 | 	mvn		out, #0x80000000
 95 | 	b		LR(3, f)
 96 | L(2)	
 97 | 	qadd	out, out, out
 98 | L(3)	
 99 | #else
100 | 	mvnvs	out, #0x80000000
101 | 	qaddvc	out, out, out
102 | #endif	
103 | 	add		tmp3, tmp3, #0xFF
104 | 	mov		out, out, asr #16
105 | 	cmp		ind, r2
106 | 	strh	out, [r0], #2
107 | 	blt		LR(0, b)
108 | L(1)	
109 | 	add		sp, sp, #8
110 | 	ldmia	sp!,  {r4-r10, fp, ip, pc}
111 | 
112 | L(L0)
113 | 	DCD	SYM(SKP_Silk_resampler_frac_FIR_144_alt)
114 | 	END
115 | #endif
116 | #endif
117 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_resampler_private_copy.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | /*																		*
29 |  * File Name:	SKP_Silk_resampler_private_copy.c                     *
30 |  *																		*
31 |  * Description: Copy.                                                   *
32 |  *                                                                      *
33 |  * Copyright 2010 (c), Skype Limited                                    *
34 |  * All rights reserved.													*
35 |  *                                                                      */
36 | 
37 | #include "SKP_Silk_SigProc_FIX.h"
38 | #include "SKP_Silk_resampler_private.h"
39 | 
40 | /* Copy */
41 | void SKP_Silk_resampler_private_copy(
42 | 	void	                        *SS,		    /* I/O: Resampler state (unused)				*/
43 | 	SKP_int16						out[],		    /* O:	Output signal 							*/
44 | 	const SKP_int16					in[],		    /* I:	Input signal							*/
45 | 	SKP_int32					    inLen		    /* I:	Number of input samples					*/
46 | )
47 | {
48 |     SKP_memcpy( out, in, inLen * sizeof( SKP_int16 ) );
49 | }
50 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_resampler_private_up4.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | /*                                                                      *
29 |  * SKP_Silk_resampler_private_up4.c                                   *
30 |  *                                                                      *
31 |  * Upsample by a factor 4, low quality                                  *
32 |  *                                                                      *
33 |  * Copyright 2010 (c), Skype Limited                                    *
34 |  *                                                                      */
35 | 
36 | #include "SKP_Silk_SigProc_FIX.h"
37 | #include "SKP_Silk_resampler_private.h"
38 | 
39 | /* Upsample by a factor 4, Note: very low quality, only use with output sampling rates above 96 kHz. */
40 | void SKP_Silk_resampler_private_up4(
41 |     SKP_int32                       *S,             /* I/O: State vector [ 2 ]                      */
42 |     SKP_int16                       *out,           /* O:   Output signal [ 4 * len ]               */
43 |     const SKP_int16                 *in,            /* I:   Input signal [ len ]                    */
44 |     SKP_int32                       len             /* I:   Number of INPUT samples                 */
45 | )
46 | {
47 |     SKP_int32 k;
48 |     SKP_int32 in32, out32, Y, X;
49 |     SKP_int16 out16;
50 | 
51 |     SKP_assert( SKP_Silk_resampler_up2_lq_0 > 0 );
52 |     SKP_assert( SKP_Silk_resampler_up2_lq_1 < 0 );
53 | 
54 |     /* Internal variables and state are in Q10 format */
55 |     for( k = 0; k < len; k++ ) {
56 |         /* Convert to Q10 */
57 |         in32 = SKP_LSHIFT( (SKP_int32)in[ k ], 10 );
58 | 
59 |         /* All-pass section for even output sample */
60 |         Y      = SKP_SUB32( in32, S[ 0 ] );
61 |         X      = SKP_SMULWB( Y, SKP_Silk_resampler_up2_lq_0 );
62 |         out32  = SKP_ADD32( S[ 0 ], X );
63 |         S[ 0 ] = SKP_ADD32( in32, X );
64 | 
65 |         /* Convert back to int16 and store to output */
66 |         out16 = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( out32, 10 ) );
67 |         out[ 4 * k ]     = out16;
68 |         out[ 4 * k + 1 ] = out16;
69 | 
70 |         /* All-pass section for odd output sample */
71 |         Y      = SKP_SUB32( in32, S[ 1 ] );
72 |         X      = SKP_SMLAWB( Y, Y, SKP_Silk_resampler_up2_lq_1 );
73 |         out32  = SKP_ADD32( S[ 1 ], X );
74 |         S[ 1 ] = SKP_ADD32( in32, X );
75 | 
76 |         /* Convert back to int16 and store to output */
77 |         out16 = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( out32, 10 ) );
78 |         out[ 4 * k + 2 ] = out16;
79 |         out[ 4 * k + 3 ] = out16;
80 |     }
81 | }
82 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_resampler_structs.h:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | /*																		*
29 |  * File Name:	SKP_Silk_resampler_structs.h							*
30 |  *																		*
31 |  * Description: Structs for IIR/FIR resamplers							*
32 |  *                                                                      *
33 |  * Copyright 2010 (c), Skype Limited                                    *
34 |  * All rights reserved.													*
35 |  *																		*
36 |  *                                                                      */
37 | 
38 | #ifndef SKP_Silk_RESAMPLER_STRUCTS_H
39 | #define SKP_Silk_RESAMPLER_STRUCTS_H
40 | 
41 | #ifdef __cplusplus
42 | extern "C" {
43 | #endif
44 | 
45 | /* Flag to enable support for input/output sampling rates above 48 kHz. Turn off for embedded devices */
46 | #define RESAMPLER_SUPPORT_ABOVE_48KHZ                   1
47 | 
48 | #define SKP_Silk_RESAMPLER_MAX_FIR_ORDER                 16
49 | #define SKP_Silk_RESAMPLER_MAX_IIR_ORDER                 6
50 | 
51 | 
52 | typedef struct _SKP_Silk_resampler_state_struct{
53 | 	SKP_int32       sIIR[ SKP_Silk_RESAMPLER_MAX_IIR_ORDER ];        /* this must be the first element of this struct */
54 | 	SKP_int32       sFIR[ SKP_Silk_RESAMPLER_MAX_FIR_ORDER ];
55 | 	SKP_int32       sDown2[ 2 ];
56 | 	void            (*resampler_function)( void *, SKP_int16 *, const SKP_int16 *, SKP_int32 );
57 | 	void            (*up2_function)(  SKP_int32 *, SKP_int16 *, const SKP_int16 *, SKP_int32 );
58 |     SKP_int32       batchSize;
59 | 	SKP_int32       invRatio_Q16;
60 | 	SKP_int32       FIR_Fracs;
61 |     SKP_int32       input2x;
62 | 	const SKP_int16	*Coefs;
63 | #if RESAMPLER_SUPPORT_ABOVE_48KHZ
64 | 	SKP_int32       sDownPre[ 2 ];
65 | 	SKP_int32       sUpPost[ 2 ];
66 | 	void            (*down_pre_function)( SKP_int32 *, SKP_int16 *, const SKP_int16 *, SKP_int32 );
67 | 	void            (*up_post_function)(  SKP_int32 *, SKP_int16 *, const SKP_int16 *, SKP_int32 );
68 | 	SKP_int32       batchSizePrePost;
69 | 	SKP_int32       ratio_Q16;
70 | 	SKP_int32       nPreDownsamplers;
71 | 	SKP_int32       nPostUpsamplers;
72 | #endif
73 | 	SKP_int32 magic_number;
74 | } SKP_Silk_resampler_state_struct;
75 | 
76 | #ifdef __cplusplus
77 | }
78 | #endif
79 | #endif /* SKP_Silk_RESAMPLER_STRUCTS_H */
80 | 
81 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_resampler_up2.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | /*                                                                      *
29 |  * SKP_Silk_resampler_up2.c                                           *
30 |  *                                                                      *
31 |  * Upsample by a factor 2, low quality                                  *
32 |  *                                                                      *
33 |  * Copyright 2010 (c), Skype Limited                                    *
34 |  *                                                                      */
35 | 
36 | #include "SKP_Silk_SigProc_FIX.h"
37 | #include "SKP_Silk_resampler_rom.h"
38 | 
39 | /* Upsample by a factor 2, low quality */
40 | #if EMBEDDED_ARM<5
41 | void SKP_Silk_resampler_up2(
42 |     SKP_int32                           *S,         /* I/O: State vector [ 2 ]                  */
43 |     SKP_int16                           *out,       /* O:   Output signal [ 2 * len ]           */
44 |     const SKP_int16                     *in,        /* I:   Input signal [ len ]                */
45 |     SKP_int32                           len         /* I:   Number of input samples             */
46 | )
47 | {
48 |     SKP_int32 k;
49 |     SKP_int32 in32, out32, Y, X;
50 | 
51 |     SKP_assert( SKP_Silk_resampler_up2_lq_0 > 0 );
52 |     SKP_assert( SKP_Silk_resampler_up2_lq_1 < 0 );
53 |     /* Internal variables and state are in Q10 format */
54 |     for( k = 0; k < len; k++ ) {
55 |         /* Convert to Q10 */
56 |         in32 = SKP_LSHIFT( (SKP_int32)in[ k ], 10 );
57 | 
58 |         /* All-pass section for even output sample */
59 |         Y      = SKP_SUB32( in32, S[ 0 ] );
60 |         X      = SKP_SMULWB( Y, SKP_Silk_resampler_up2_lq_0 );
61 |         out32  = SKP_ADD32( S[ 0 ], X );
62 |         S[ 0 ] = SKP_ADD32( in32, X );
63 | 
64 |         /* Convert back to int16 and store to output */
65 |         out[ 2 * k ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( out32, 10 ) );
66 | 
67 |         /* All-pass section for odd output sample */
68 |         Y      = SKP_SUB32( in32, S[ 1 ] );
69 |         X      = SKP_SMLAWB( Y, Y, SKP_Silk_resampler_up2_lq_1 );
70 |         out32  = SKP_ADD32( S[ 1 ], X );
71 |         S[ 1 ] = SKP_ADD32( in32, X );
72 | 
73 |         /* Convert back to int16 and store to output */
74 |         out[ 2 * k + 1 ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( out32, 10 ) );
75 |     }
76 | }
77 | #endif
78 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_resampler_up2_arm.S:
--------------------------------------------------------------------------------
  1 | /***********************************************************************
  2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
  3 | Redistribution and use in source and binary forms, with or without 
  4 | modification, (subject to the limitations in the disclaimer below) 
  5 | are permitted provided that the following conditions are met:
  6 | - Redistributions of source code must retain the above copyright notice,
  7 | this list of conditions and the following disclaimer.
  8 | - Redistributions in binary form must reproduce the above copyright 
  9 | notice, this list of conditions and the following disclaimer in the 
 10 | documentation and/or other materials provided with the distribution.
 11 | - Neither the name of Skype Limited, nor the names of specific 
 12 | contributors, may be used to endorse or promote products derived from 
 13 | this software without specific prior written permission.
 14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
 15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
 16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
 18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
 19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
 20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
 22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 26 | ***********************************************************************/
 27 | 
 28 | #if defined(__arm__)
 29 | 
 30 | #include "SKP_Silk_AsmPreproc.h"
 31 | 
 32 | #if EMBEDDED_ARM>=5
 33 | #define SKP_Silk_resampler_up2_lq_0 0x1FA6
 34 | #define SKP_Silk_resampler_up2_lq_1 0x8FAF
 35 | 
 36 | 	VARDEF xy0, r4
 37 | 	VARDEF xy1, r5
 38 | 	VARDEF up2_coefs, _r7
 39 | 	VARDEF S_0, r6
 40 | 	VARDEF S_1, r8
 41 | 	VARDEF in, sb
 42 | 	VARDEF out0, sl
 43 | 	VARDEF out1, r0
 44 | 
 45 | .set	sp_S, 0 
 46 | .globl	SYM(SKP_Silk_resampler_up2)
 47 | SYM(SKP_Silk_resampler_up2):
 48 | 	stmdb	sp!,  {r4-r10, fp, ip, lr}
 49 | 	add		fp, sp, #36
 50 | 	sub		sp, sp, #4
 51 | 	mov	up2_coefs, #0x1F000000
 52 | 	ldrsh	in, [r2], #2
 53 | 	add	up2_coefs, up2_coefs, #0xA60000
 54 | 	str	r0, [sp, #sp_S]
 55 | 	add	up2_coefs, up2_coefs, #0x8F00
 56 | 	ldmia	r0, {S_0, S_1}
 57 | 	add	up2_coefs, up2_coefs, #0xAF
 58 | 	mov	ip, #512
 59 | 	cmp	r3, #0
 60 | 	beq	LR(1, f)
 61 | L(0)
 62 | 	mov	in, in, lsl #10
 63 | 	sub	xy0, in, S_0
 64 | 	sub	xy1, in, S_1
 65 | 	smulwt	xy0, xy0, up2_coefs
 66 | 	smlawb	xy1, xy1, up2_coefs, xy1
 67 | 	add	out0, S_0, xy0
 68 | 	add	out1, S_1, xy1
 69 | 	add	S_0, in, xy0
 70 | 	add	S_1, in, xy1
 71 | 	qadd	out0, out0, ip
 72 | 	qadd	out1, out1, ip
 73 | #if EMBEDDED_ARM<6	
 74 | 	cmp	out0, #0x2000000
 75 | 	movge	out0, #0x2000000
 76 | 	subge	out0, out0, #1
 77 | 	cmn	out0, #0x2000000
 78 | 	movlt	out0, #0x2000000
 79 | 	cmp	out1, #0x2000000
 80 | 	movge	out1, #0x2000000
 81 | 	subge	out1 ,out1, #1
 82 | 	cmn	out1, #0x2000000
 83 | 	movlt	out1, #0x2000000
 84 | 	mov	out0, out0, asr #10
 85 | 	mov	out1, out1, asr #10
 86 | #else	
 87 | 	ssat	out0, #16, out0, asr #10
 88 | 	ssat	out1, #16, out1, asr #10
 89 | #endif	
 90 | 	subs	r3, r3, #1
 91 | #ifdef _WINRT
 92 | 	ble		LR(2, f)
 93 | 	ldrsh	in, [r2], #2
 94 | 	strh	out0, [r1], #2
 95 | 	strh	out1, [r1], #2
 96 | 	b		LR(0, b)
 97 | L(2)
 98 | 	strh	out0, [r1], #2
 99 | 	strh	out1, [r1], #2
100 | #else	
101 | 	ldrgtsh	in, [r2], #2
102 | 	strh	out0, [r1], #2
103 | 	strh	out1, [r1], #2
104 | 	bgt	LR(0, b)
105 | #endif	
106 | 	
107 | 	ldr	r0, [sp, #sp_S]
108 | 	stmia	r0, {S_0, S_1}
109 | L(1)
110 | 	add		sp, sp, #4
111 | 	ldmia	sp!,  {r4-r10, fp, ip, pc}
112 | 	END
113 | #endif
114 | #endif
115 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_scale_copy_vector16.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #include "SKP_Silk_SigProc_FIX.h"
29 | 
30 | /* Copy and multiply a vector by a constant */
31 | void SKP_Silk_scale_copy_vector16( 
32 |     SKP_int16           *data_out, 
33 |     const SKP_int16     *data_in, 
34 |     SKP_int32           gain_Q16,                   /* (I):   gain in Q16   */
35 |     const SKP_int       dataSize                    /* (I):   length        */
36 | )
37 | {
38 |     SKP_int  i;
39 |     SKP_int32 tmp32;
40 | 
41 |     for( i = 0; i < dataSize; i++ ) {
42 |         tmp32 = SKP_SMULWB( gain_Q16, data_in[ i ] );
43 |         data_out[ i ] = (SKP_int16)SKP_CHECK_FIT16( tmp32 );
44 |     }
45 | }
46 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_scale_vector.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #include "SKP_Silk_SigProc_FIX.h"
29 | 
30 | /* Multiply a vector by a constant */
31 | void SKP_Silk_scale_vector32_Q26_lshift_18( 
32 |     SKP_int32           *data1,                     /* (I/O): Q0/Q18        */
33 |     SKP_int32           gain_Q26,                   /* (I):   Q26           */
34 |     SKP_int             dataSize                    /* (I):   length        */
35 | )
36 | {
37 |     SKP_int  i;
38 | 
39 |     for( i = 0; i < dataSize; i++ ) {
40 |         data1[ i ] = (SKP_int32)SKP_CHECK_FIT32( SKP_RSHIFT64( SKP_SMULL( data1[ i ], gain_Q26 ), 8 ) );// OUTPUT: Q18
41 |     }
42 | }
43 | 
44 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_sigm_Q15.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | /*                                                                      *
29 |  * SKP_sigm_Q15.c                                                       *
30 |  *                                                                      *
31 |  * Approximate sigmoid function                                         *
32 |  *                                                                      *
33 |  * Copyright 2006 (c), Skype Limited                                    *
34 |  * Date: 060221                                                         *
35 |  *                                                                      */
36 | #include "SKP_Silk_SigProc_FIX.h"
37 | #if EMBEDDED_ARM<4
38 | /********************************/
39 | /* approximate sigmoid function */
40 | /********************************/
41 | /* fprintf(1, '%d, ', round(1024 * ([1 ./ (1 + exp(-(1:5))), 1] - 1 ./ (1 + exp(-(0:5)))))); */
42 | static const SKP_int32 sigm_LUT_slope_Q10[ 6 ] = {
43 |     237, 153, 73, 30, 12, 7
44 | };
45 | /* fprintf(1, '%d, ', round(32767 * 1 ./ (1 + exp(-(0:5))))); */
46 | static const SKP_int32 sigm_LUT_pos_Q15[ 6 ] = {
47 |     16384, 23955, 28861, 31213, 32178, 32548
48 | };
49 | /* fprintf(1, '%d, ', round(32767 * 1 ./ (1 + exp((0:5))))); */
50 | static const SKP_int32 sigm_LUT_neg_Q15[ 6 ] = {
51 |     16384, 8812, 3906, 1554, 589, 219
52 | };
53 | 
54 | SKP_int SKP_Silk_sigm_Q15( SKP_int in_Q5 ) 
55 | {
56 |     SKP_int ind;
57 | 
58 |     if( in_Q5 < 0 ) {
59 |         /* Negative input */
60 |         in_Q5 = -in_Q5;
61 |         if( in_Q5 >= 6 * 32 ) {
62 |             return 0;        /* Clip */
63 |         } else {
64 |             /* Linear interpolation of look up table */
65 |             ind = SKP_RSHIFT( in_Q5, 5 );
66 |             return( sigm_LUT_neg_Q15[ ind ] - SKP_SMULBB( sigm_LUT_slope_Q10[ ind ], in_Q5 & 0x1F ) );
67 |         }
68 |     } else {
69 |         /* Positive input */
70 |         if( in_Q5 >= 6 * 32 ) {
71 |             return 32767;        /* clip */
72 |         } else {
73 |             /* Linear interpolation of look up table */
74 |             ind = SKP_RSHIFT( in_Q5, 5 );
75 |             return( sigm_LUT_pos_Q15[ ind ] + SKP_SMULBB( sigm_LUT_slope_Q10[ ind ], in_Q5 & 0x1F ) );
76 |         }
77 |     }
78 | }
79 | #endif
80 | 
81 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_sigm_Q15_arm.S:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #if defined(__arm__)
29 | 
30 | #include "SKP_Silk_AsmPreproc.h"
31 | #if EMBEDDED_ARM>=4
32 | 
33 | 	VARDEF ptr_slope, r6
34 | 	VARDEF ptr_LUT, _r7
35 | 	VARDEF in_Q5, r1
36 | 	VARDEF ind, r2
37 | 	VARDEF val_slope, r5
38 | 	VARDEF val_PUT, r4
39 | 	VARDEF in_Q5_tmp, r3
40 | 
41 | .globl	SYM(SKP_Silk_sigm_Q15)
42 | SYM(SKP_Silk_sigm_Q15):
43 | 	stmdb	sp!,  {r4-r7, fp, ip, lr}
44 | 	add		fp, sp, #24
45 | 	cmp		r0, #0
46 | 	ldr		ptr_slope, TABLE(L0, =SKP_Silk_sigm_tab)
47 | 
48 | 	mov		in_Q5, r0
49 | 	rsblt	in_Q5, r0, #0
50 | 	mov		r0, #32768
51 | 	addlt	ptr_slope, ptr_slope, #24
52 | 	movlt	r0, #1
53 | 	add		ptr_LUT, ptr_slope, #12											/*sigm_LUT_pos_Q15*/
54 | 	cmp		in_Q5, #192											/*6*32*/
55 | 	sub		r0, r0, #1
56 | 	
57 | 	bge		LR(1, f)
58 | 	mov		ind, in_Q5, asr #5										/*ind*/	
59 | 	mov		ind, ind, lsl #1
60 | 	and		in_Q5_tmp,	in_Q5, #0x1F
61 | 	ldrsh	val_slope, [ptr_slope, ind]										/*sigm_LUT_slope_Q10*/
62 | 	ldrsh	val_PUT, [ptr_LUT, ind]										/*sigm_LUT_pos/neg_Q15*/
63 | 	mla		r0, val_slope, in_Q5_tmp, val_PUT
64 | L(1)	
65 | 	ldmia	sp!,  {r4-r7, fp, ip, pc}
66 | 	
67 | L(L0)		
68 | 	DCD	SYM(SKP_Silk_sigm_tab)
69 | 
70 | 	SKP_TABLE SKP_Silk_sigm_tab, 2
71 | 	DCW		237, 153, 73, 30, 12, 7,						\
72 | 			16384, 23955, 28861, 31213, 32178, 32548,		\
73 | 			-237, -153, -73, -30, -12, -7,					\
74 | 			16384, 8812, 3906, 1554, 589, 219
75 | 	END	
76 | #endif
77 | #endif
78 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_sum_sqr_shift_arm.S:
--------------------------------------------------------------------------------
  1 | /***********************************************************************
  2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
  3 | Redistribution and use in source and binary forms, with or without 
  4 | modification, (subject to the limitations in the disclaimer below) 
  5 | are permitted provided that the following conditions are met:
  6 | - Redistributions of source code must retain the above copyright notice,
  7 | this list of conditions and the following disclaimer.
  8 | - Redistributions in binary form must reproduce the above copyright 
  9 | notice, this list of conditions and the following disclaimer in the 
 10 | documentation and/or other materials provided with the distribution.
 11 | - Neither the name of Skype Limited, nor the names of specific 
 12 | contributors, may be used to endorse or promote products derived from 
 13 | this software without specific prior written permission.
 14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
 15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
 16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
 17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
 18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
 19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
 20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
 22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 26 | ***********************************************************************/
 27 | 
 28 | #if defined(__arm__)
 29 | 
 30 | #include "SKP_Silk_AsmPreproc.h"
 31 | #if EMBEDDED_ARM>=5
 32 | 
 33 | 	VARDEF		x0,		r4
 34 | 	VARDEF		nrg_tmp,	r5
 35 | 	VARDEF		shift, 		r6
 36 | 	VARDEF		nrg,	 	_r7
 37 | 	VARDEF		idx, 		r8
 38 | 
 39 | .globl	SYM(SKP_Silk_sum_sqr_shift)
 40 | SYM(SKP_Silk_sum_sqr_shift):
 41 | 	stmdb	sp!,  {r4-r8, fp, ip, lr}
 42 | 	add		fp, sp, #28
 43 |   	mov		idx, r3
 44 |  	ands		nrg_tmp, r2, #2
 45 |   	mov		nrg, #0
 46 | #ifdef _WINRT
 47 | 	beq		LR(6, f)
 48 | 	ldrh	x0, [r2], #2
 49 |   	smulbb	nrg, x0, x0
 50 |   	sub		idx, idx, #1
 51 | L(6)	
 52 | #else	
 53 |   	ldrneh	x0, [r2], #2
 54 |   	smulbbne	nrg, x0, x0
 55 |   	subne		idx, idx, #1
 56 | #endif	
 57 | 
 58 |   	ldr		r4, [r2], #4
 59 |  	mov		shift, #0
 60 |   	sub		idx, idx, #1
 61 | L(0)
 62 |   	subs		idx, idx, #2
 63 |  	SKP_SMLAD	nrg, x0, x0, nrg
 64 | #ifdef _WINRT
 65 | 	ldrgt		x0, [r2]
 66 | 	addgt		r2, r2, #4
 67 | #else	
 68 |   	ldrgt		x0, [r2], #4
 69 | #endif	
 70 |   	cmp		nrg, #0
 71 |   	blt		LR(1, f)
 72 |   	cmp		idx, #0
 73 |   	bgt 		LR(0, b)
 74 |   	beq		LR(4, f)
 75 |  	b		LR(5, f)
 76 | L(1)
 77 |   	mov		nrg, nrg, lsr #2
 78 |   	mov		shift, #2
 79 |   	cmp		idx, #0
 80 |   	beq		LR(4, f)
 81 |  	blt		LR(5, f)
 82 | L(3)
 83 |   	subs		idx, idx, #2  
 84 |   	SKP_SMUAD	nrg_tmp, x0, x0
 85 | #ifdef _WINRT
 86 | 	ldrgt		x0, [r2]
 87 | 	addgt		r2, r2, #4
 88 | 	mov			nrg_tmp, nrg_tmp, lsr shift
 89 | 	adds		nrg, nrg, nrg_tmp
 90 | #else
 91 | 	ldrgt		x0, [r2], #4
 92 |   	add		nrg, nrg, nrg_tmp, lsr shift
 93 | 	cmp		nrg, #0
 94 | #endif
 95 |   	movlt		nrg, nrg, lsr #2
 96 |   	addlt		shift, shift, #2
 97 |   	cmp		idx, #0
 98 |   	bgt		LR(3, b)
 99 |   	blt		LR(5, f)
100 | L(4)  
101 |   	ldrh		x0, [r2]
102 |   	smulbb	nrg_tmp, x0, x0
103 | #ifdef _WINRT
104 | 	mov		nrg_tmp, nrg_tmp, lsr shift
105 | 	add		nrg, nrg, nrg_tmp
106 | #else	
107 |   	add		nrg, nrg, nrg_tmp, lsr shift
108 | #endif
109 | L(5)
110 |  	ands		nrg_tmp, nrg, #0xC0000000
111 |  	movne		nrg, nrg, lsr #2
112 |   	addne		shift, shift, #2
113 |   	str		shift, [r1]
114 |   	str		nrg, [r0]
115 |   
116 | 	ldmia	sp!,  {r4-r8, fp, ip, pc}
117 | 	END
118 | #endif
119 | #endif
120 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_tables_NLSF_CB0_10.h:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #ifndef SKP_SILK_TABLES_NLSF_CB0_10_H
29 | #define SKP_SILK_TABLES_NLSF_CB0_10_H
30 | 
31 | #include "SKP_Silk_define.h"
32 | 
33 | #ifdef __cplusplus
34 | extern "C"
35 | {
36 | #endif
37 | 
38 | #define NLSF_MSVQ_CB0_10_STAGES       6
39 | #define NLSF_MSVQ_CB0_10_VECTORS      120
40 | 
41 | /* NLSF codebook entropy coding tables */
42 | extern const SKP_uint16         SKP_Silk_NLSF_MSVQ_CB0_10_CDF[ NLSF_MSVQ_CB0_10_VECTORS + NLSF_MSVQ_CB0_10_STAGES ];
43 | extern const SKP_uint16 * const SKP_Silk_NLSF_MSVQ_CB0_10_CDF_start_ptr[                  NLSF_MSVQ_CB0_10_STAGES ];
44 | extern const SKP_int            SKP_Silk_NLSF_MSVQ_CB0_10_CDF_middle_idx[                 NLSF_MSVQ_CB0_10_STAGES ];
45 | 
46 | #ifdef __cplusplus
47 | }
48 | #endif
49 | 
50 | #endif
51 | 
52 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_tables_NLSF_CB0_16.h:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #ifndef SKP_SILK_TABLES_NLSF_CB0_16_H
29 | #define SKP_SILK_TABLES_NLSF_CB0_16_H
30 | 
31 | #include "SKP_Silk_define.h"
32 | 
33 | #ifdef __cplusplus
34 | extern "C"
35 | {
36 | #endif
37 | 
38 | #define NLSF_MSVQ_CB0_16_STAGES       10
39 | #define NLSF_MSVQ_CB0_16_VECTORS      216
40 | 
41 | /* NLSF codebook entropy coding tables */
42 | extern const SKP_uint16         SKP_Silk_NLSF_MSVQ_CB0_16_CDF[ NLSF_MSVQ_CB0_16_VECTORS + NLSF_MSVQ_CB0_16_STAGES ];
43 | extern const SKP_uint16 * const SKP_Silk_NLSF_MSVQ_CB0_16_CDF_start_ptr[                  NLSF_MSVQ_CB0_16_STAGES ];
44 | extern const SKP_int            SKP_Silk_NLSF_MSVQ_CB0_16_CDF_middle_idx[                 NLSF_MSVQ_CB0_16_STAGES ];
45 | 
46 | #ifdef __cplusplus
47 | }
48 | #endif
49 | 
50 | #endif
51 | 
52 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_tables_NLSF_CB1_10.h:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #ifndef SKP_SILK_TABLES_NLSF_CB1_10_H
29 | #define SKP_SILK_TABLES_NLSF_CB1_10_H
30 | 
31 | #include "SKP_Silk_define.h"
32 | 
33 | #ifdef __cplusplus
34 | extern "C"
35 | {
36 | #endif
37 | 
38 | #define NLSF_MSVQ_CB1_10_STAGES       6
39 | #define NLSF_MSVQ_CB1_10_VECTORS      72
40 | 
41 | /* NLSF codebook entropy coding tables */
42 | extern const SKP_uint16         SKP_Silk_NLSF_MSVQ_CB1_10_CDF[ NLSF_MSVQ_CB1_10_VECTORS + NLSF_MSVQ_CB1_10_STAGES ];
43 | extern const SKP_uint16 * const SKP_Silk_NLSF_MSVQ_CB1_10_CDF_start_ptr[                  NLSF_MSVQ_CB1_10_STAGES ];
44 | extern const SKP_int            SKP_Silk_NLSF_MSVQ_CB1_10_CDF_middle_idx[                 NLSF_MSVQ_CB1_10_STAGES ];
45 | 
46 | #ifdef __cplusplus
47 | }
48 | #endif
49 | 
50 | #endif
51 | 
52 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_tables_NLSF_CB1_16.h:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #ifndef SKP_SILK_TABLES_NLSF_CB1_16_H
29 | #define SKP_SILK_TABLES_NLSF_CB1_16_H
30 | 
31 | #include "SKP_Silk_define.h"
32 | 
33 | #ifdef __cplusplus
34 | extern "C"
35 | {
36 | #endif
37 | 
38 | #define NLSF_MSVQ_CB1_16_STAGES       10
39 | #define NLSF_MSVQ_CB1_16_VECTORS      104
40 | 
41 | /* NLSF codebook entropy coding tables */
42 | extern const SKP_uint16         SKP_Silk_NLSF_MSVQ_CB1_16_CDF[ NLSF_MSVQ_CB1_16_VECTORS + NLSF_MSVQ_CB1_16_STAGES ];
43 | extern const SKP_uint16 * const SKP_Silk_NLSF_MSVQ_CB1_16_CDF_start_ptr[                  NLSF_MSVQ_CB1_16_STAGES ];
44 | extern const SKP_int            SKP_Silk_NLSF_MSVQ_CB1_16_CDF_middle_idx[                 NLSF_MSVQ_CB1_16_STAGES ];
45 | 
46 | #ifdef __cplusplus
47 | }
48 | #endif
49 | 
50 | #endif
51 | 
52 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_tables_gain.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #include "SKP_Silk_tables.h"
29 | 
30 | #ifdef __cplusplus
31 | extern "C"
32 | {
33 | #endif
34 | 
35 | const SKP_uint16 SKP_Silk_gain_CDF[ 2 ][ 65 ] = 
36 | {
37 | {
38 |          0,     18,     45,     94,    181,    320,    519,    777,
39 |       1093,   1468,   1909,   2417,   2997,   3657,   4404,   5245,
40 |       6185,   7228,   8384,   9664,  11069,  12596,  14244,  16022,
41 |      17937,  19979,  22121,  24345,  26646,  29021,  31454,  33927,
42 |      36438,  38982,  41538,  44068,  46532,  48904,  51160,  53265,
43 |      55184,  56904,  58422,  59739,  60858,  61793,  62568,  63210,
44 |      63738,  64165,  64504,  64769,  64976,  65133,  65249,  65330,
45 |      65386,  65424,  65451,  65471,  65487,  65501,  65513,  65524,
46 |      65535
47 | },
48 | {
49 |          0,    214,    581,   1261,   2376,   3920,   5742,   7632,
50 |       9449,  11157,  12780,  14352,  15897,  17427,  18949,  20462,
51 |      21957,  23430,  24889,  26342,  27780,  29191,  30575,  31952,
52 |      33345,  34763,  36200,  37642,  39083,  40519,  41930,  43291,
53 |      44602,  45885,  47154,  48402,  49619,  50805,  51959,  53069,
54 |      54127,  55140,  56128,  57101,  58056,  58979,  59859,  60692,
55 |      61468,  62177,  62812,  63368,  63845,  64242,  64563,  64818,
56 |      65023,  65184,  65306,  65391,  65447,  65482,  65505,  65521,
57 |      65535
58 | }
59 | };
60 | 
61 | const SKP_int SKP_Silk_gain_CDF_offset = 32;
62 | 
63 | 
64 | const SKP_uint16 SKP_Silk_delta_gain_CDF[ 46 ] = {
65 |          0,   2358,   3856,   7023,  15376,  53058,  59135,  61555,
66 |      62784,  63498,  63949,  64265,  64478,  64647,  64783,  64894,
67 |      64986,  65052,  65113,  65169,  65213,  65252,  65284,  65314,
68 |      65338,  65359,  65377,  65392,  65403,  65415,  65424,  65432,
69 |      65440,  65448,  65455,  65462,  65470,  65477,  65484,  65491,
70 |      65499,  65506,  65513,  65521,  65528,  65535
71 | };
72 | 
73 | const SKP_int SKP_Silk_delta_gain_CDF_offset = 5;
74 | 
75 | #ifdef __cplusplus
76 | }
77 | #endif
78 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_tables_sign.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #include "SKP_Silk_tables.h"
29 | 
30 | const SKP_uint16 SKP_Silk_sign_CDF[ 36 ] = 
31 | {
32 |          37840,  36944,  36251,  35304,
33 |          34715,  35503,  34529,  34296,
34 |          34016,  47659,  44945,  42503,
35 |          40235,  38569,  40254,  37851,
36 |          37243,  36595,  43410,  44121,
37 |          43127,  40978,  38845,  40433,
38 |          38252,  37795,  36637,  59159,
39 |          55630,  51806,  48073,  45036,
40 |          48416,  43857,  42678,  41146,
41 | };
42 | 
43 | 


--------------------------------------------------------------------------------
/silk/src/SKP_Silk_tables_type_offset.c:
--------------------------------------------------------------------------------
 1 | /***********************************************************************
 2 | Copyright (c) 2006-2012, Skype Limited. All rights reserved. 
 3 | Redistribution and use in source and binary forms, with or without 
 4 | modification, (subject to the limitations in the disclaimer below) 
 5 | are permitted provided that the following conditions are met:
 6 | - Redistributions of source code must retain the above copyright notice,
 7 | this list of conditions and the following disclaimer.
 8 | - Redistributions in binary form must reproduce the above copyright 
 9 | notice, this list of conditions and the following disclaimer in the 
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Skype Limited, nor the names of specific 
12 | contributors, may be used to endorse or promote products derived from 
13 | this software without specific prior written permission.
14 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED 
15 | BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
16 | CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
19 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
22 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 | 
28 | #include "SKP_Silk_tables.h"
29 | 
30 | const SKP_uint16 SKP_Silk_type_offset_CDF[ 5 ] = {
31 |          0,  37522,  41030,  44212,  65535
32 | };
33 | 
34 | const SKP_int SKP_Silk_type_offset_CDF_offset = 2;
35 | 
36 | 
37 | const SKP_uint16 SKP_Silk_type_offset_joint_CDF[ 4 ][ 5 ] = 
38 | {
39 | {
40 |          0,  57686,  61230,  62358,  65535
41 | },
42 | {
43 |          0,  18346,  40067,  43659,  65535
44 | },
45 | {
46 |          0,  22694,  24279,  35507,  65535
47 | },
48 | {
49 |          0,   6067,   7215,  13010,  65535
50 | }
51 | };
52 | 
53 | 


--------------------------------------------------------------------------------
/windows/CHANGELOG.md:
--------------------------------------------------------------------------------
  1 | ## ChangeLog
  2 | 
  3 | <b>Version 1.0.3.3</b> (23 Jan 2020)
  4 |  * Fix a bug form 1.0.3.2.
  5 | 
  6 | <b>Version 1.0.3.2</b> (04 Jan 2020)
  7 |  * Repack application by Obfuscator.
  8 | 
  9 | <b>Version 1.0.3.1</b> (17 June 2019)
 10 |  * Repack application by UPX.
 11 | 
 12 | <b>Version 1.0.3.0</b> (17 June 2019)
 13 |  * Add code cert, repack application.
 14 | 
 15 | <b>Version 1.0.2.9</b> (24 May 2019)
 16 |  * Repack application by ASPack.
 17 | 
 18 | <b>Version 1.0.2.8</b> (30 Mar 2019)
 19 |  * Repack application.
 20 | 
 21 | <b>Version 1.0.2.7</b> (19 Feb 2019)
 22 |  * Fix a bug.
 23 | 
 24 | <b>Version 1.0.2.6</b> (14 Feb 2019)
 25 |  * Repack application.
 26 | 
 27 | <b>Version 1.0.2.5</b> (01 Sept 2017)
 28 |  * Optimized code.
 29 | 
 30 | <b>Version 1.0.2.4</b> (22 Aug 2017)
 31 |  * Fix some bugs.
 32 | 
 33 | <b>Version 1.0.2.3</b> (22 Aug 2017)
 34 |  * Fix some bugs.
 35 |  * Remove drag and drop function.
 36 | 
 37 | <b>Version 1.0.2.2</b> (19 Aug 2017)
 38 |  * Fix some bugs.
 39 | 
 40 | <b>Version 1.0.2.1</b> (28 Jun 2017)
 41 |  * Add files to listview via drag and drop.
 42 | 
 43 | <b>Version 1.0.2.0</b> (28 May 2017)
 44 |  * Add AMR header fix checkbox.
 45 |  * Wechat mini program audio conversion support.
 46 |  * Fix some bugs.
 47 | 
 48 | <b>Version 1.0.1.2</b> (19 Feb 2017)
 49 |  * Force frequency, max CBR bitrate output(for mp3).
 50 | 
 51 | <b>Version 1.0.1.1</b> (03 Nov 2016)
 52 |  * Add custom encode output format support.
 53 |  * Fix some bugs.
 54 | 
 55 | <b>Version 1.0.1.0</b> (30 Sept 2016)
 56 |  * Fix miss AMR header error.
 57 |  * Add about page.
 58 |  * Fix some bugs.
 59 |  
 60 | <b>Version 1.0.0.6</b> (22 Sept 2016)
 61 |  * Fix Wechat play Silk v3 encode file(from silk2mp3) error.
 62 |  * Add custom decode output format support.
 63 |  * Fix some bugs.
 64 | 
 65 | <b>Version 1.0.0.5</b> (27 Jul 2016)
 66 |  * Optimized code.
 67 |  * Enable professional mode when FFmpeg has been found.
 68 | 
 69 | <b>Version 1.0.0.4</b> (15 Jun 2016)
 70 |  * Add Chinese(Traditional) language support.
 71 |  * Fix some bugs.
 72 | 
 73 | <b>Version 1.0.0.3</b> (01 Jun 2016)
 74 |  * Add Silk v3 encode support.
 75 |  * Fix some bugs.
 76 | 
 77 | <b>Version 1.0.0.2</b> (29 Apr 2016)
 78 |  * Hide command windows when converting.
 79 | 
 80 | <b>Version 1.0.0.1</b> (13 Apr 2016)
 81 |  * Add English language support.
 82 |  * Fix some bugs.
 83 | 
 84 | <b>Version 1.0.0.0</b> (12 Apr 2016)
 85 |  * First published version.
 86 | 
 87 | 
 88 | ## 更新历史
 89 | 
 90 | 2020-01-23发布1.0.3.3版本:
 91 |  * 修复上一版本打包方式导致的win10系统以下不可用问题。
 92 | 
 93 | 2020-01-04发布1.0.3.2版本:
 94 |  * 混淆代码重新打包程序。
 95 | 
 96 | 2019-06-17发布1.0.3.1版本:
 97 |  * 使用UPX重新打包程序。
 98 | 
 99 | 2019-06-17发布1.0.3.0版本:
100 |  * 添加代码证书重新打包程序。
101 | 
102 | 2019-05-24发布1.0.2.9版本:
103 |  * 使用ASPack重新打包程序。
104 | 
105 | 2019-03-30发布1.0.2.8版本:
106 |  * 重新打包程序。
107 | 
108 | 2019-02-19发布1.0.2.7版本:
109 |  * 修复上一版本列表无法显示问题。
110 | 
111 | 2019-02-14发布1.0.2.6版本:
112 |  * 重新打包程序。
113 | 
114 | 2017-09-01发布1.0.2.5版本:
115 |  * 优化代码。
116 | 
117 | 2017-08-22发布1.0.2.4版本:
118 |  * 修复一些Bug。
119 | 
120 | 2017-08-22发布1.0.2.3版本:
121 |  * 修复一些Bug。
122 |  * 去掉拖拽功能。
123 | 
124 | 2017-08-19发布1.0.2.2版本:
125 |  * 修复一些Bug。
126 | 
127 | 2017-06-28发布1.0.2.1版本:
128 |  * 支持拖拽文件进列表框替换待转换文件列表。
129 | 
130 | 2017-05-28发布1.0.2.0版本:
131 |  * “尝试强制AMR编码解码文件”变为可选项。
132 |  * 支持微信小程序语音转换(包括编码、解码)。
133 |  * 修复一些Bug。
134 | 
135 | 2017-02-19发布1.0.1.2版本:
136 |  * 强制输出固定频率和最大化比特率(主要针对MP3)。
137 | 
138 | 2016-11-03发布1.0.1.1版本:
139 |  * 添加编码输出格式自定义。
140 |  * 修复一些Bug。
141 | 
142 | 2016-09-30发布1.0.1.0版本:
143 |  * 修复缺失AMR头无法转换问题。
144 |  * 新增关于页。
145 |  * 修复一些Bug。
146 | 
147 | 2016-09-22发布1.0.0.6版本:
148 |  * 修复编码后,微信播放完,会有杂音。
149 |  * 新增解码输出格式自定义。
150 |  * 修复一些Bug。
151 | 
152 | 2016-07-27发布1.0.0.5版本:
153 |  * 最小加载模式。
154 |  * 当发现程序目录下存在FFmpeg时,启用专业模式。
155 | 
156 | 2016-06-15发布1.0.0.4版本:
157 |  * 添加语言支持,新增繁体中文支持。
158 |  * 修复一些Bug。
159 | 
160 | 2016-06-01发布1.0.0.3版本:
161 |  * 支持转换音频文件为Silk v3编码。
162 |  * 修复一些Bug。
163 | 
164 | 2016-04-29发布1.0.0.2版本:
165 |  * 隐藏转换时弹出的命令行窗口。
166 | 
167 | 2016-04-13发布1.0.0.1版本:
168 |  * 添加语言支持,新增英文支持。
169 |  * 修复一些Bug。
170 | 
171 | 2016-04-12发布1.0.0.0版本:
172 |  * 第一个版本,由Autoit3编译而成。
173 | 


--------------------------------------------------------------------------------
/windows/README.md:
--------------------------------------------------------------------------------
  1 | # Silk2MP3
  2 | 
  3 | ## Description
  4 | 
  5 | Decode silk v3 audio files (like wechat amr, aud files, qq slk files) and convert to other format.
  6 | 
  7 | The program for Windows users.
  8 | 
  9 | Batch conversion support.
 10 | 
 11 | Also support encode to silk v3 (Need `silk_v3_encoder`), compatible with QQ/Wechat.
 12 | 
 13 | Wechat mini program audio conversion support.
 14 | 
 15 | ## Requirement
 16 | 
 17 | * silk_v3_decoder
 18 | * lame
 19 | 
 20 | ## Expansion
 21 | 
 22 | * silk_v3_encoder (Encode to silk v3 support)
 23 | * ffmpeg (Note: When using FFmpeg, do not need LAME any more)
 24 | 
 25 | ## How To Use
 26 | 
 27 | Download the `lame.exe`, `silk2mp3.exe`, `silk_v3_decoder.exe` in one folder. Then run the `silk2mp3.exe`.
 28 | 
 29 | [Click here to download zip package for silk2mp3](https://dl.kn007.net/directlink/silk2mp3.zip "silk2mp3.zip").
 30 | 
 31 | If need more features, please download [expansion package](https://dl.kn007.net/directlink/silk2mp3-expansion.zip "silk2mp3-expansion.zip").
 32 | 
 33 | Also you can download the [full version](https://dl.kn007.net/directlink/silk2mp3-full.zip "silk2mp3-full.zip") to get more features.
 34 | 
 35 | ## Screenshots
 36 | 
 37 | ![screenshot](/windows/screenshots/20170528161558.png?raw=true "Screenshot")
 38 | 
 39 | [More screenshots](/windows/screenshots/)
 40 | 
 41 | ## Hash
 42 | 
 43 | MD5: 5956F1AD437FD25F81BD31665F8FA1B6
 44 | 
 45 | SHA1: A17C48766B71667D9EB9795EAC11E245D69665BC
 46 | 
 47 | CRC32: 7D42B4D1
 48 | 
 49 | ## Notice
 50 | 
 51 | The program compiled with `Autoit3`.
 52 | 
 53 | ## Test
 54 | 
 55 | The test was passed when used following system:
 56 | * Windows XP
 57 | * Windows Vista
 58 | * Windows 7
 59 | * Windows 8
 60 | * Windows 10
 61 | 
 62 | ## Links
 63 | 
 64 | [https://kn007.net/topics/batch-convert-silk-v3-audio-files-to-mp3-in-windows/](https://kn007.net/topics/batch-convert-silk-v3-audio-files-to-mp3-in-windows/)
 65 | 
 66 | ## About
 67 | 
 68 | [kn007's blog](https://kn007.net) 
 69 | 
 70 | ## Donate
 71 | 
 72 | PayPal: kn007#126.com (Change # to @)
 73 | 
 74 | Alipay: kn007#126.com (Change # to @)
 75 | 
 76 | [More(Like Wechat, Tenpay, etc.)](https://kn007.net/donate/) 
 77 | 
 78 | *** 
 79 | 
 80 | ## 中文说明
 81 | 解码silk v3音频文件(类似微信的amr和aud文件、QQ的slk文件)并转换为其他音频格式。
 82 | 
 83 | 在Windows平台可用的应用程序。
 84 | 
 85 | 支持批量转换。
 86 | 
 87 | 支持将文件编码为silk v3音频文件(需要`silk_v3_encoder`),兼容QQ、微信。
 88 | 
 89 | 支持转换微信小程序语音文件,可编码或解码。
 90 | 
 91 | ## 依赖组件
 92 | 
 93 | * silk_v3_decoder
 94 | * lame
 95 | 
 96 | ## 扩展组件
 97 | 
 98 | * silk_v3_encoder (编码支持组件)
 99 | * ffmpeg (注意:当使用FFmpeg时,LAME组件不再强制依赖)
100 | 
101 | ## 如何使用
102 | 
103 | 下载 `lame.exe`、`silk2mp3.exe`、`silk_v3_decoder.exe`后,直接运行`silk2mp3.exe`即可。
104 | 
105 | [点击这里打包下载](https://dl.kn007.net/directlink/silk2mp3.zip "silk2mp3.zip")
106 | 
107 | 需要扩展功能,请下载[扩展包](https://dl.kn007.net/directlink/silk2mp3-expansion.zip "silk2mp3-expansion.zip")。
108 | 
109 | 你也可以通过下载[完整版](https://dl.kn007.net/directlink/silk2mp3-full.zip "silk2mp3-full.zip"),来得到更多的功能。
110 | 
111 | ## 程序截图
112 | 
113 | ![screenshot](/windows/screenshots/20170528161523.png?raw=true "Screenshot")
114 | 
115 | [更多截图](/windows/screenshots/)
116 | 
117 | ## 程序鉴定
118 | 
119 | MD5: 5956F1AD437FD25F81BD31665F8FA1B6
120 | 
121 | SHA1: A17C48766B71667D9EB9795EAC11E245D69665BC
122 | 
123 | CRC32: 7D42B4D1
124 | 
125 | ## 其他提示
126 | 
127 | 该程序由`Autoit3`编译而成,个别小牌杀软可能会误报。
128 | 
129 | ## 环境测试
130 | 
131 | 于以下环境测试通过:
132 | * Windows XP
133 | * Windows Vista
134 | * Windows 7
135 | * Windows 8
136 | * Windows 10
137 | 
138 | ## 相关链接
139 | 
140 | [https://kn007.net/topics/batch-convert-silk-v3-audio-files-to-mp3-in-windows/](https://kn007.net/topics/batch-convert-silk-v3-audio-files-to-mp3-in-windows/)
141 | 
142 | ## 关于作者
143 | 
144 | [kn007的个人博客](https://kn007.net) 
145 | 
146 | ## 赞助作者
147 | 
148 | PayPal:kn007#126.com (请将 # 改为 @)
149 | 
150 | 支付宝:kn007#126.com (请将 # 改为 @)
151 | 
152 | [其他方式(如微信支付、财付通等)](https://kn007.net/donate/) 
153 | 


--------------------------------------------------------------------------------
/windows/ffmpeg compatible with XP.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kn007/silk-v3-decoder/507be6bca8ce1fb977a061481f1d79e8c610e309/windows/ffmpeg compatible with XP.zip


--------------------------------------------------------------------------------
/windows/ffmpeg.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kn007/silk-v3-decoder/507be6bca8ce1fb977a061481f1d79e8c610e309/windows/ffmpeg.zip


--------------------------------------------------------------------------------
/windows/lame.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kn007/silk-v3-decoder/507be6bca8ce1fb977a061481f1d79e8c610e309/windows/lame.exe


--------------------------------------------------------------------------------
/windows/screenshots/20160413145612.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kn007/silk-v3-decoder/507be6bca8ce1fb977a061481f1d79e8c610e309/windows/screenshots/20160413145612.png


--------------------------------------------------------------------------------
/windows/screenshots/20160413145643.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kn007/silk-v3-decoder/507be6bca8ce1fb977a061481f1d79e8c610e309/windows/screenshots/20160413145643.png


--------------------------------------------------------------------------------
/windows/screenshots/20160413171427.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kn007/silk-v3-decoder/507be6bca8ce1fb977a061481f1d79e8c610e309/windows/screenshots/20160413171427.png


--------------------------------------------------------------------------------
/windows/screenshots/20160413171521.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kn007/silk-v3-decoder/507be6bca8ce1fb977a061481f1d79e8c610e309/windows/screenshots/20160413171521.png


--------------------------------------------------------------------------------
/windows/screenshots/20160601170900.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kn007/silk-v3-decoder/507be6bca8ce1fb977a061481f1d79e8c610e309/windows/screenshots/20160601170900.png


--------------------------------------------------------------------------------
/windows/screenshots/20160601170959.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kn007/silk-v3-decoder/507be6bca8ce1fb977a061481f1d79e8c610e309/windows/screenshots/20160601170959.png


--------------------------------------------------------------------------------
/windows/screenshots/20160928221726.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kn007/silk-v3-decoder/507be6bca8ce1fb977a061481f1d79e8c610e309/windows/screenshots/20160928221726.png


--------------------------------------------------------------------------------
/windows/screenshots/20160928221818.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kn007/silk-v3-decoder/507be6bca8ce1fb977a061481f1d79e8c610e309/windows/screenshots/20160928221818.png


--------------------------------------------------------------------------------
/windows/screenshots/20170528161523.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kn007/silk-v3-decoder/507be6bca8ce1fb977a061481f1d79e8c610e309/windows/screenshots/20170528161523.png


--------------------------------------------------------------------------------
/windows/screenshots/20170528161558.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kn007/silk-v3-decoder/507be6bca8ce1fb977a061481f1d79e8c610e309/windows/screenshots/20170528161558.png


--------------------------------------------------------------------------------
/windows/silk2mp3.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kn007/silk-v3-decoder/507be6bca8ce1fb977a061481f1d79e8c610e309/windows/silk2mp3.exe


--------------------------------------------------------------------------------
/windows/silk_v3_decoder.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kn007/silk-v3-decoder/507be6bca8ce1fb977a061481f1d79e8c610e309/windows/silk_v3_decoder.exe


--------------------------------------------------------------------------------
/windows/silk_v3_encoder.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kn007/silk-v3-decoder/507be6bca8ce1fb977a061481f1d79e8c610e309/windows/silk_v3_encoder.exe


--------------------------------------------------------------------------------