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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 } | 57 } |
58 | 58 |
59 /* Reduce bitrate for 10 ms modes in these calculations */ | 59 /* Reduce bitrate for 10 ms modes in these calculations */ |
60 if( psEncC->nb_subfr == 2 ) { | 60 if( psEncC->nb_subfr == 2 ) { |
61 TargetRate_bps -= REDUCE_BITRATE_10_MS_BPS; | 61 TargetRate_bps -= REDUCE_BITRATE_10_MS_BPS; |
62 } | 62 } |
63 | 63 |
64 /* Find bitrate interval in table and interpolate */ | 64 /* Find bitrate interval in table and interpolate */ |
65 for( k = 1; k < TARGET_RATE_TAB_SZ; k++ ) { | 65 for( k = 1; k < TARGET_RATE_TAB_SZ; k++ ) { |
66 if( TargetRate_bps <= rateTable[ k ] ) { | 66 if( TargetRate_bps <= rateTable[ k ] ) { |
67 frac_Q6 = silk_DIV32( silk_LSHIFT( TargetRate_bps - rateTable[ k
- 1 ], 6 ), | 67 frac_Q6 = silk_DIV32( silk_LSHIFT( TargetRate_bps - rateTable[ k
- 1 ], 6 ), rateTable[ k ] - rateTable[ k - 1 ] ); |
68 rateTable[ k ] - rateTable[ k -
1 ] ); | |
69 psEncC->SNR_dB_Q7 = silk_LSHIFT( silk_SNR_table_Q1[ k - 1 ], 6 )
+ silk_MUL( frac_Q6, silk_SNR_table_Q1[ k ] - silk_SNR_table_Q1[ k - 1 ] ); | 68 psEncC->SNR_dB_Q7 = silk_LSHIFT( silk_SNR_table_Q1[ k - 1 ], 6 )
+ silk_MUL( frac_Q6, silk_SNR_table_Q1[ k ] - silk_SNR_table_Q1[ k - 1 ] ); |
70 break; | 69 break; |
71 } | 70 } |
72 } | 71 } |
73 } | 72 } |
74 | 73 |
75 return ret; | 74 return ret; |
76 } | 75 } |
OLD | NEW |