cannam@154
|
1 /***********************************************************************
|
cannam@154
|
2 Copyright (C) 2014 Vidyo
|
cannam@154
|
3 Redistribution and use in source and binary forms, with or without
|
cannam@154
|
4 modification, are permitted provided that the following conditions
|
cannam@154
|
5 are met:
|
cannam@154
|
6 - Redistributions of source code must retain the above copyright notice,
|
cannam@154
|
7 this list of conditions and the following disclaimer.
|
cannam@154
|
8 - Redistributions in binary form must reproduce the above copyright
|
cannam@154
|
9 notice, this list of conditions and the following disclaimer in the
|
cannam@154
|
10 documentation and/or other materials provided with the distribution.
|
cannam@154
|
11 - Neither the name of Internet Society, IETF or IETF Trust, nor the
|
cannam@154
|
12 names of specific contributors, may be used to endorse or promote
|
cannam@154
|
13 products derived from this software without specific prior written
|
cannam@154
|
14 permission.
|
cannam@154
|
15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
cannam@154
|
16 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
cannam@154
|
17 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
cannam@154
|
18 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
cannam@154
|
19 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
cannam@154
|
20 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
cannam@154
|
21 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
cannam@154
|
22 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
cannam@154
|
23 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
cannam@154
|
24 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
cannam@154
|
25 POSSIBILITY OF SUCH DAMAGE.
|
cannam@154
|
26 ***********************************************************************/
|
cannam@154
|
27 #ifdef HAVE_CONFIG_H
|
cannam@154
|
28 # include "config.h"
|
cannam@154
|
29 #endif
|
cannam@154
|
30
|
cannam@154
|
31 #include "main_FIX.h"
|
cannam@154
|
32 #include "NSQ.h"
|
cannam@154
|
33 #include "SigProc_FIX.h"
|
cannam@154
|
34
|
cannam@154
|
35 #if defined(OPUS_HAVE_RTCD)
|
cannam@154
|
36
|
cannam@154
|
37 # if (defined(OPUS_ARM_MAY_HAVE_NEON_INTR) && \
|
cannam@154
|
38 !defined(OPUS_ARM_PRESUME_NEON_INTR))
|
cannam@154
|
39
|
cannam@154
|
40 void (*const SILK_BIQUAD_ALT_STRIDE2_IMPL[OPUS_ARCHMASK + 1])(
|
cannam@154
|
41 const opus_int16 *in, /* I input signal */
|
cannam@154
|
42 const opus_int32 *B_Q28, /* I MA coefficients [3] */
|
cannam@154
|
43 const opus_int32 *A_Q28, /* I AR coefficients [2] */
|
cannam@154
|
44 opus_int32 *S, /* I/O State vector [4] */
|
cannam@154
|
45 opus_int16 *out, /* O output signal */
|
cannam@154
|
46 const opus_int32 len /* I signal length (must be even) */
|
cannam@154
|
47 ) = {
|
cannam@154
|
48 silk_biquad_alt_stride2_c, /* ARMv4 */
|
cannam@154
|
49 silk_biquad_alt_stride2_c, /* EDSP */
|
cannam@154
|
50 silk_biquad_alt_stride2_c, /* Media */
|
cannam@154
|
51 silk_biquad_alt_stride2_neon, /* Neon */
|
cannam@154
|
52 };
|
cannam@154
|
53
|
cannam@154
|
54 opus_int32 (*const SILK_LPC_INVERSE_PRED_GAIN_IMPL[OPUS_ARCHMASK + 1])( /* O Returns inverse prediction gain in energy domain, Q30 */
|
cannam@154
|
55 const opus_int16 *A_Q12, /* I Prediction coefficients, Q12 [order] */
|
cannam@154
|
56 const opus_int order /* I Prediction order */
|
cannam@154
|
57 ) = {
|
cannam@154
|
58 silk_LPC_inverse_pred_gain_c, /* ARMv4 */
|
cannam@154
|
59 silk_LPC_inverse_pred_gain_c, /* EDSP */
|
cannam@154
|
60 silk_LPC_inverse_pred_gain_c, /* Media */
|
cannam@154
|
61 silk_LPC_inverse_pred_gain_neon, /* Neon */
|
cannam@154
|
62 };
|
cannam@154
|
63
|
cannam@154
|
64 void (*const SILK_NSQ_DEL_DEC_IMPL[OPUS_ARCHMASK + 1])(
|
cannam@154
|
65 const silk_encoder_state *psEncC, /* I Encoder State */
|
cannam@154
|
66 silk_nsq_state *NSQ, /* I/O NSQ state */
|
cannam@154
|
67 SideInfoIndices *psIndices, /* I/O Quantization Indices */
|
cannam@154
|
68 const opus_int16 x16[], /* I Input */
|
cannam@154
|
69 opus_int8 pulses[], /* O Quantized pulse signal */
|
cannam@154
|
70 const opus_int16 PredCoef_Q12[ 2 * MAX_LPC_ORDER ], /* I Short term prediction coefs */
|
cannam@154
|
71 const opus_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ], /* I Long term prediction coefs */
|
cannam@154
|
72 const opus_int16 AR_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /* I Noise shaping coefs */
|
cannam@154
|
73 const opus_int HarmShapeGain_Q14[ MAX_NB_SUBFR ], /* I Long term shaping coefs */
|
cannam@154
|
74 const opus_int Tilt_Q14[ MAX_NB_SUBFR ], /* I Spectral tilt */
|
cannam@154
|
75 const opus_int32 LF_shp_Q14[ MAX_NB_SUBFR ], /* I Low frequency shaping coefs */
|
cannam@154
|
76 const opus_int32 Gains_Q16[ MAX_NB_SUBFR ], /* I Quantization step sizes */
|
cannam@154
|
77 const opus_int pitchL[ MAX_NB_SUBFR ], /* I Pitch lags */
|
cannam@154
|
78 const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */
|
cannam@154
|
79 const opus_int LTP_scale_Q14 /* I LTP state scaling */
|
cannam@154
|
80 ) = {
|
cannam@154
|
81 silk_NSQ_del_dec_c, /* ARMv4 */
|
cannam@154
|
82 silk_NSQ_del_dec_c, /* EDSP */
|
cannam@154
|
83 silk_NSQ_del_dec_c, /* Media */
|
cannam@154
|
84 silk_NSQ_del_dec_neon, /* Neon */
|
cannam@154
|
85 };
|
cannam@154
|
86
|
cannam@154
|
87 /*There is no table for silk_noise_shape_quantizer_short_prediction because the
|
cannam@154
|
88 NEON version takes different parameters than the C version.
|
cannam@154
|
89 Instead RTCD is done via if statements at the call sites.
|
cannam@154
|
90 See NSQ_neon.h for details.*/
|
cannam@154
|
91
|
cannam@154
|
92 opus_int32
|
cannam@154
|
93 (*const SILK_NSQ_NOISE_SHAPE_FEEDBACK_LOOP_IMPL[OPUS_ARCHMASK+1])(
|
cannam@154
|
94 const opus_int32 *data0, opus_int32 *data1, const opus_int16 *coef,
|
cannam@154
|
95 opus_int order) = {
|
cannam@154
|
96 silk_NSQ_noise_shape_feedback_loop_c, /* ARMv4 */
|
cannam@154
|
97 silk_NSQ_noise_shape_feedback_loop_c, /* EDSP */
|
cannam@154
|
98 silk_NSQ_noise_shape_feedback_loop_c, /* Media */
|
cannam@154
|
99 silk_NSQ_noise_shape_feedback_loop_neon, /* NEON */
|
cannam@154
|
100 };
|
cannam@154
|
101
|
cannam@154
|
102 # endif
|
cannam@154
|
103
|
cannam@154
|
104 # if defined(FIXED_POINT) && \
|
cannam@154
|
105 defined(OPUS_ARM_MAY_HAVE_NEON_INTR) && !defined(OPUS_ARM_PRESUME_NEON_INTR)
|
cannam@154
|
106
|
cannam@154
|
107 void (*const SILK_WARPED_AUTOCORRELATION_FIX_IMPL[OPUS_ARCHMASK + 1])(
|
cannam@154
|
108 opus_int32 *corr, /* O Result [order + 1] */
|
cannam@154
|
109 opus_int *scale, /* O Scaling of the correlation vector */
|
cannam@154
|
110 const opus_int16 *input, /* I Input data to correlate */
|
cannam@154
|
111 const opus_int warping_Q16, /* I Warping coefficient */
|
cannam@154
|
112 const opus_int length, /* I Length of input */
|
cannam@154
|
113 const opus_int order /* I Correlation order (even) */
|
cannam@154
|
114 ) = {
|
cannam@154
|
115 silk_warped_autocorrelation_FIX_c, /* ARMv4 */
|
cannam@154
|
116 silk_warped_autocorrelation_FIX_c, /* EDSP */
|
cannam@154
|
117 silk_warped_autocorrelation_FIX_c, /* Media */
|
cannam@154
|
118 silk_warped_autocorrelation_FIX_neon, /* Neon */
|
cannam@154
|
119 };
|
cannam@154
|
120
|
cannam@154
|
121 # endif
|
cannam@154
|
122
|
cannam@154
|
123 #endif /* OPUS_HAVE_RTCD */
|