OLD | NEW |
1 /*********************************************************************** | 1 /*********************************************************************** |
2 Copyright (c) 2006-2011, Skype Limited. All rights reserved. | 2 Copyright (c) 2006-2011, Skype Limited. All rights reserved. |
3 Redistribution and use in source and binary forms, with or without | 3 Redistribution and use in source and binary forms, with or without |
4 modification, are permitted provided that the following conditions | 4 modification, are permitted provided that the following conditions |
5 are met: | 5 are met: |
6 - Redistributions of source code must retain the above copyright notice, | 6 - Redistributions of source code must retain the above copyright notice, |
7 this list of conditions and the following disclaimer. | 7 this list of conditions and the following disclaimer. |
8 - Redistributions in binary form must reproduce the above copyright | 8 - Redistributions in binary form must reproduce the above copyright |
9 notice, this list of conditions and the following disclaimer in the | 9 notice, this list of conditions and the following disclaimer in the |
10 documentation and/or other materials provided with the distribution. | 10 documentation and/or other materials provided with the distribution. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 opus_int32 Q_Q10; | 50 opus_int32 Q_Q10; |
51 opus_int32 RD_Q10; | 51 opus_int32 RD_Q10; |
52 opus_int32 xq_Q14; | 52 opus_int32 xq_Q14; |
53 opus_int32 LF_AR_Q14; | 53 opus_int32 LF_AR_Q14; |
54 opus_int32 sLTP_shp_Q14; | 54 opus_int32 sLTP_shp_Q14; |
55 opus_int32 LPC_exc_Q14; | 55 opus_int32 LPC_exc_Q14; |
56 } NSQ_sample_struct; | 56 } NSQ_sample_struct; |
57 | 57 |
58 typedef NSQ_sample_struct NSQ_sample_pair[ 2 ]; | 58 typedef NSQ_sample_struct NSQ_sample_pair[ 2 ]; |
59 | 59 |
60 static inline void silk_nsq_del_dec_scale_states( | 60 static OPUS_INLINE void silk_nsq_del_dec_scale_states( |
61 const silk_encoder_state *psEncC, /* I Encoder State
*/ | 61 const silk_encoder_state *psEncC, /* I Encoder State
*/ |
62 silk_nsq_state *NSQ, /* I/O NSQ state
*/ | 62 silk_nsq_state *NSQ, /* I/O NSQ state
*/ |
63 NSQ_del_dec_struct psDelDec[], /* I/O Delayed decision sta
tes */ | 63 NSQ_del_dec_struct psDelDec[], /* I/O Delayed decision sta
tes */ |
64 const opus_int32 x_Q3[], /* I Input in Q3
*/ | 64 const opus_int32 x_Q3[], /* I Input in Q3
*/ |
65 opus_int32 x_sc_Q10[], /* O Input scaled with 1/
Gain in Q10 */ | 65 opus_int32 x_sc_Q10[], /* O Input scaled with 1/
Gain in Q10 */ |
66 const opus_int16 sLTP[], /* I Re-whitened LTP stat
e in Q0 */ | 66 const opus_int16 sLTP[], /* I Re-whitened LTP stat
e in Q0 */ |
67 opus_int32 sLTP_Q15[], /* O LTP state matching s
caled input */ | 67 opus_int32 sLTP_Q15[], /* O LTP state matching s
caled input */ |
68 opus_int subfr, /* I Subframe number
*/ | 68 opus_int subfr, /* I Subframe number
*/ |
69 opus_int nStatesDelayedDecision, /* I Number of del dec st
ates */ | 69 opus_int nStatesDelayedDecision, /* I Number of del dec st
ates */ |
70 const opus_int LTP_scale_Q14, /* I LTP state scaling
*/ | 70 const opus_int LTP_scale_Q14, /* I LTP state scaling
*/ |
71 const opus_int32 Gains_Q16[ MAX_NB_SUBFR ], /* I
*/ | 71 const opus_int32 Gains_Q16[ MAX_NB_SUBFR ], /* I
*/ |
72 const opus_int pitchL[ MAX_NB_SUBFR ], /* I Pitch lag
*/ | 72 const opus_int pitchL[ MAX_NB_SUBFR ], /* I Pitch lag
*/ |
73 const opus_int signal_type, /* I Signal type
*/ | 73 const opus_int signal_type, /* I Signal type
*/ |
74 const opus_int decisionDelay /* I Decision delay
*/ | 74 const opus_int decisionDelay /* I Decision delay
*/ |
75 ); | 75 ); |
76 | 76 |
77 /******************************************/ | 77 /******************************************/ |
78 /* Noise shape quantizer for one subframe */ | 78 /* Noise shape quantizer for one subframe */ |
79 /******************************************/ | 79 /******************************************/ |
80 static inline void silk_noise_shape_quantizer_del_dec( | 80 static OPUS_INLINE void silk_noise_shape_quantizer_del_dec( |
81 silk_nsq_state *NSQ, /* I/O NSQ state
*/ | 81 silk_nsq_state *NSQ, /* I/O NSQ state
*/ |
82 NSQ_del_dec_struct psDelDec[], /* I/O Delayed decision states
*/ | 82 NSQ_del_dec_struct psDelDec[], /* I/O Delayed decision states
*/ |
83 opus_int signalType, /* I Signal type
*/ | 83 opus_int signalType, /* I Signal type
*/ |
84 const opus_int32 x_Q10[], /* I
*/ | 84 const opus_int32 x_Q10[], /* I
*/ |
85 opus_int8 pulses[], /* O
*/ | 85 opus_int8 pulses[], /* O
*/ |
86 opus_int16 xq[], /* O
*/ | 86 opus_int16 xq[], /* O
*/ |
87 opus_int32 sLTP_Q15[], /* I/O LTP filter state
*/ | 87 opus_int32 sLTP_Q15[], /* I/O LTP filter state
*/ |
88 opus_int32 delayedGain_Q10[], /* I/O Gain delay buffer
*/ | 88 opus_int32 delayedGain_Q10[], /* I/O Gain delay buffer
*/ |
89 const opus_int16 a_Q12[], /* I Short term prediction co
efs */ | 89 const opus_int16 a_Q12[], /* I Short term prediction co
efs */ |
90 const opus_int16 b_Q14[], /* I Long term prediction coe
fs */ | 90 const opus_int16 b_Q14[], /* I Long term prediction coe
fs */ |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 /* Save quantized speech signal */ | 296 /* Save quantized speech signal */ |
297 /* DEBUG_STORE_DATA( enc.pcm, &NSQ->xq[psEncC->ltp_mem_length], psEncC->fram
e_length * sizeof( opus_int16 ) ) */ | 297 /* DEBUG_STORE_DATA( enc.pcm, &NSQ->xq[psEncC->ltp_mem_length], psEncC->fram
e_length * sizeof( opus_int16 ) ) */ |
298 silk_memmove( NSQ->xq, &NSQ->xq[ psEncC->frame_length ],
psEncC->ltp_mem_length * sizeof( opus_int16 ) ); | 298 silk_memmove( NSQ->xq, &NSQ->xq[ psEncC->frame_length ],
psEncC->ltp_mem_length * sizeof( opus_int16 ) ); |
299 silk_memmove( NSQ->sLTP_shp_Q14, &NSQ->sLTP_shp_Q14[ psEncC->frame_length ],
psEncC->ltp_mem_length * sizeof( opus_int32 ) ); | 299 silk_memmove( NSQ->sLTP_shp_Q14, &NSQ->sLTP_shp_Q14[ psEncC->frame_length ],
psEncC->ltp_mem_length * sizeof( opus_int32 ) ); |
300 RESTORE_STACK; | 300 RESTORE_STACK; |
301 } | 301 } |
302 | 302 |
303 /******************************************/ | 303 /******************************************/ |
304 /* Noise shape quantizer for one subframe */ | 304 /* Noise shape quantizer for one subframe */ |
305 /******************************************/ | 305 /******************************************/ |
306 static inline void silk_noise_shape_quantizer_del_dec( | 306 static OPUS_INLINE void silk_noise_shape_quantizer_del_dec( |
307 silk_nsq_state *NSQ, /* I/O NSQ state
*/ | 307 silk_nsq_state *NSQ, /* I/O NSQ state
*/ |
308 NSQ_del_dec_struct psDelDec[], /* I/O Delayed decision states
*/ | 308 NSQ_del_dec_struct psDelDec[], /* I/O Delayed decision states
*/ |
309 opus_int signalType, /* I Signal type
*/ | 309 opus_int signalType, /* I Signal type
*/ |
310 const opus_int32 x_Q10[], /* I
*/ | 310 const opus_int32 x_Q10[], /* I
*/ |
311 opus_int8 pulses[], /* O
*/ | 311 opus_int8 pulses[], /* O
*/ |
312 opus_int16 xq[], /* O
*/ | 312 opus_int16 xq[], /* O
*/ |
313 opus_int32 sLTP_Q15[], /* I/O LTP filter state
*/ | 313 opus_int32 sLTP_Q15[], /* I/O LTP filter state
*/ |
314 opus_int32 delayedGain_Q10[], /* I/O Gain delay buffer
*/ | 314 opus_int32 delayedGain_Q10[], /* I/O Gain delay buffer
*/ |
315 const opus_int16 a_Q12[], /* I Short term prediction co
efs */ | 315 const opus_int16 a_Q12[], /* I Short term prediction co
efs */ |
316 const opus_int16 b_Q14[], /* I Long term prediction coe
fs */ | 316 const opus_int16 b_Q14[], /* I Long term prediction coe
fs */ |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 delayedGain_Q10[ *smpl_buf_idx ] = Gain_Q10; | 623 delayedGain_Q10[ *smpl_buf_idx ] = Gain_Q10; |
624 } | 624 } |
625 /* Update LPC states */ | 625 /* Update LPC states */ |
626 for( k = 0; k < nStatesDelayedDecision; k++ ) { | 626 for( k = 0; k < nStatesDelayedDecision; k++ ) { |
627 psDD = &psDelDec[ k ]; | 627 psDD = &psDelDec[ k ]; |
628 silk_memcpy( psDD->sLPC_Q14, &psDD->sLPC_Q14[ length ], NSQ_LPC_BUF_LENG
TH * sizeof( opus_int32 ) ); | 628 silk_memcpy( psDD->sLPC_Q14, &psDD->sLPC_Q14[ length ], NSQ_LPC_BUF_LENG
TH * sizeof( opus_int32 ) ); |
629 } | 629 } |
630 RESTORE_STACK; | 630 RESTORE_STACK; |
631 } | 631 } |
632 | 632 |
633 static inline void silk_nsq_del_dec_scale_states( | 633 static OPUS_INLINE void silk_nsq_del_dec_scale_states( |
634 const silk_encoder_state *psEncC, /* I Encoder State
*/ | 634 const silk_encoder_state *psEncC, /* I Encoder State
*/ |
635 silk_nsq_state *NSQ, /* I/O NSQ state
*/ | 635 silk_nsq_state *NSQ, /* I/O NSQ state
*/ |
636 NSQ_del_dec_struct psDelDec[], /* I/O Delayed decision sta
tes */ | 636 NSQ_del_dec_struct psDelDec[], /* I/O Delayed decision sta
tes */ |
637 const opus_int32 x_Q3[], /* I Input in Q3
*/ | 637 const opus_int32 x_Q3[], /* I Input in Q3
*/ |
638 opus_int32 x_sc_Q10[], /* O Input scaled with 1/
Gain in Q10 */ | 638 opus_int32 x_sc_Q10[], /* O Input scaled with 1/
Gain in Q10 */ |
639 const opus_int16 sLTP[], /* I Re-whitened LTP stat
e in Q0 */ | 639 const opus_int16 sLTP[], /* I Re-whitened LTP stat
e in Q0 */ |
640 opus_int32 sLTP_Q15[], /* O LTP state matching s
caled input */ | 640 opus_int32 sLTP_Q15[], /* O LTP state matching s
caled input */ |
641 opus_int subfr, /* I Subframe number
*/ | 641 opus_int subfr, /* I Subframe number
*/ |
642 opus_int nStatesDelayedDecision, /* I Number of del dec st
ates */ | 642 opus_int nStatesDelayedDecision, /* I Number of del dec st
ates */ |
643 const opus_int LTP_scale_Q14, /* I LTP state scaling
*/ | 643 const opus_int LTP_scale_Q14, /* I LTP state scaling
*/ |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 for( i = 0; i < MAX_SHAPE_LPC_ORDER; i++ ) { | 710 for( i = 0; i < MAX_SHAPE_LPC_ORDER; i++ ) { |
711 psDD->sAR2_Q14[ i ] = silk_SMULWW( gain_adj_Q16, psDD->sAR2_Q14[
i ] ); | 711 psDD->sAR2_Q14[ i ] = silk_SMULWW( gain_adj_Q16, psDD->sAR2_Q14[
i ] ); |
712 } | 712 } |
713 for( i = 0; i < DECISION_DELAY; i++ ) { | 713 for( i = 0; i < DECISION_DELAY; i++ ) { |
714 psDD->Pred_Q15[ i ] = silk_SMULWW( gain_adj_Q16, psDD->Pred_Q15
[ i ] ); | 714 psDD->Pred_Q15[ i ] = silk_SMULWW( gain_adj_Q16, psDD->Pred_Q15
[ i ] ); |
715 psDD->Shape_Q14[ i ] = silk_SMULWW( gain_adj_Q16, psDD->Shape_Q1
4[ i ] ); | 715 psDD->Shape_Q14[ i ] = silk_SMULWW( gain_adj_Q16, psDD->Shape_Q1
4[ i ] ); |
716 } | 716 } |
717 } | 717 } |
718 } | 718 } |
719 } | 719 } |
OLD | NEW |