| 1 | /*********************************************************************** |
| 2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved. |
| 3 | Redistribution and use in source and binary forms, with or without |
| 4 | modification, are permitted provided that the following conditions |
| 5 | 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 Internet Society, IETF or IETF Trust, nor the |
| 12 | names of specific contributors, may be used to endorse or promote |
| 13 | products derived from this software without specific prior written |
| 14 | permission. |
| 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
| 19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 21 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 22 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 23 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 25 | POSSIBILITY OF SUCH DAMAGE. |
| 26 | ***********************************************************************/ |
| 27 | |
| 28 | //#ifdef HAVE_CONFIG_H |
| 29 | #include "opus__config.h"cxx . . $ `<file>/external/opusfile/opus/opus__config.h`/ |
| 30 | //#endif |
| 31 | #include "define.h"cxx . . $ `<file>/external/opusfile/opus/silk/define.h`/ |
| 32 | #include "API.h"cxx . . $ `<file>/external/opusfile/opus/silk/API.h`/ |
| 33 | #include "control.h"cxx . . $ `<file>/external/opusfile/opus/silk/control.h`/ |
| 34 | #include "typedef.h"cxx . . $ `<file>/external/opusfile/opus/silk/typedef.h`/ |
| 35 | #include "stack_alloc.h"cxx . . $ `<file>/external/opusfile/opus/celt/stack_alloc.h`/ |
| 36 | #include "structs.h"cxx . . $ `<file>/external/opusfile/opus/silk/structs.h`/ |
| 37 | #include "tuning_parameters.h"cxx . . $ `<file>/external/opusfile/opus/silk/tuning_parameters.h`/ |
| 38 | #ifdef FIXED_POINT |
| 39 | #include "main_FIX.h" |
| 40 | #else |
| 41 | #include "main_FLP.h"cxx . . $ `<file>/external/opusfile/opus/silk/float/main_FLP.h`/ |
| 42 | #endif |
| 43 | |
| 44 | /***************************************/ |
| 45 | /* Read control structure from encoder */ |
| 46 | /***************************************/ |
| 47 | static opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! silk_QueryEncodercxx . . $ silk_QueryEncoder(fc9d34ce378d4358).( /* O Returns error code */ |
| 48 | const void *encState, /* I State */ |
| 49 | silk_EncControlStructcxx . . $ silk_EncControlStruct# *encStatus /* O Encoder Status */ |
| 50 | ); |
| 51 | |
| 52 | /****************************************/ |
| 53 | /* Encoder functions */ |
| 54 | /****************************************/ |
| 55 | |
| 56 | opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! silk_Get_Encoder_Sizecxx . . $ silk_Get_Encoder_Size(a5f7824ee4986326).( /* O Returns error code */ |
| 57 | opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! *encSizeBytes /* O Number of bytes in SILK encoder state */ |
| 58 | ) |
| 59 | { |
| 60 | opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! ret = SILK_NO_ERRORcxx . . $ `external/opusfile/opus/silk/errors.h:39:9`!; |
| 61 | |
| 62 | *encSizeBytes = sizeof( silk_encodercxx . . $ silk_encoder# ); |
| 63 | |
| 64 | return ret; |
| 65 | } |
| 66 | |
| 67 | /*************************/ |
| 68 | /* Init or Reset encoder */ |
| 69 | /*************************/ |
| 70 | opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! silk_InitEncodercxx . . $ silk_InitEncoder(2c1f4aff1d3d9ba8).( /* O Returns error code */ |
| 71 | void *encState, /* I/O State */ |
| 72 | int arch, /* I Run-time architecture */ |
| 73 | silk_EncControlStructcxx . . $ silk_EncControlStruct# *encStatus /* O Encoder Status */ |
| 74 | ) |
| 75 | { |
| 76 | silk_encodercxx . . $ silk_encoder# *psEnc; |
| 77 | opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! n, ret = SILK_NO_ERRORcxx . . $ `external/opusfile/opus/silk/errors.h:39:9`!; |
| 78 | |
| 79 | psEnc = (silk_encodercxx . . $ silk_encoder# *)encState; |
| 80 | |
| 81 | /* Reset encoder */ |
| 82 | silk_memsetcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:421:9`!( psEnc, 0, sizeof( silk_encoder ) ); |
| 83 | for( n = 0; n < ENCODER_NUM_CHANNELScxx . . $ `external/opusfile/opus/silk/define.h:40:9`!; n++ ) { |
| 84 | if( ret += silk_init_encodercxx . . $ silk_init_encoder(c9c7e39f6113ca69).( &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ], arch ) ) { |
| 85 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( 0 ); |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | psEnc->nChannelsAPIcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#nChannelsAPI. = 1; |
| 90 | psEnc->nChannelsInternalcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#nChannelsInternal. = 1; |
| 91 | |
| 92 | /* Read control structure */ |
| 93 | if( ret += silk_QueryEncodercxx . . $ silk_QueryEncoder(fc9d34ce378d4358).( encState, encStatus ) ) { |
| 94 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( 0 ); |
| 95 | } |
| 96 | |
| 97 | return ret; |
| 98 | } |
| 99 | |
| 100 | /***************************************/ |
| 101 | /* Read control structure from encoder */ |
| 102 | /***************************************/ |
| 103 | static opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! silk_QueryEncodercxx . . $ silk_QueryEncoder(fc9d34ce378d4358).( /* O Returns error code */ |
| 104 | const void *encState, /* I State */ |
| 105 | silk_EncControlStructcxx . . $ silk_EncControlStruct# *encStatus /* O Encoder Status */ |
| 106 | ) |
| 107 | { |
| 108 | opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! ret = SILK_NO_ERRORcxx . . $ `external/opusfile/opus/silk/errors.h:39:9`!; |
| 109 | silk_encoder_state_Fxxcxx . . $ `external/opusfile/opus/silk/float/main_FLP.h:44:9`! *state_Fxx; |
| 110 | silk_encodercxx . . $ silk_encoder# *psEnc = (silk_encodercxx . . $ silk_encoder# *)encState; |
| 111 | |
| 112 | state_Fxx = psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.; |
| 113 | |
| 114 | encStatus->nChannelsAPIcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsAPI. = psEnc->nChannelsAPIcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#nChannelsAPI.; |
| 115 | encStatus->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal. = psEnc->nChannelsInternalcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#nChannelsInternal.; |
| 116 | encStatus->API_sampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#API_sampleRate. = state_Fxx[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..API_fs_Hzcxx . . $ $anonymous_type_c9846ade8c67dd67_7#API_fs_Hz.; |
| 117 | encStatus->maxInternalSampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#maxInternalSampleRate. = state_Fxx[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..maxInternal_fs_Hzcxx . . $ $anonymous_type_c9846ade8c67dd67_7#maxInternal_fs_Hz.; |
| 118 | encStatus->minInternalSampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#minInternalSampleRate. = state_Fxx[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..minInternal_fs_Hzcxx . . $ $anonymous_type_c9846ade8c67dd67_7#minInternal_fs_Hz.; |
| 119 | encStatus->desiredInternalSampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#desiredInternalSampleRate. = state_Fxx[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..desiredInternal_fs_Hzcxx . . $ $anonymous_type_c9846ade8c67dd67_7#desiredInternal_fs_Hz.; |
| 120 | encStatus->payloadSize_mscxx . . $ $anonymous_type_1138ce94d7cabe34_0#payloadSize_ms. = state_Fxx[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..PacketSize_mscxx . . $ $anonymous_type_c9846ade8c67dd67_7#PacketSize_ms.; |
| 121 | encStatus->bitRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#bitRate. = state_Fxx[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..TargetRate_bpscxx . . $ $anonymous_type_c9846ade8c67dd67_7#TargetRate_bps.; |
| 122 | encStatus->packetLossPercentagecxx . . $ $anonymous_type_1138ce94d7cabe34_0#packetLossPercentage. = state_Fxx[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..PacketLoss_perccxx . . $ $anonymous_type_c9846ade8c67dd67_7#PacketLoss_perc.; |
| 123 | encStatus->complexitycxx . . $ $anonymous_type_1138ce94d7cabe34_0#complexity. = state_Fxx[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..Complexitycxx . . $ $anonymous_type_c9846ade8c67dd67_7#Complexity.; |
| 124 | encStatus->useInBandFECcxx . . $ $anonymous_type_1138ce94d7cabe34_0#useInBandFEC. = state_Fxx[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..useInBandFECcxx . . $ $anonymous_type_c9846ade8c67dd67_7#useInBandFEC.; |
| 125 | encStatus->useDTXcxx . . $ $anonymous_type_1138ce94d7cabe34_0#useDTX. = state_Fxx[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..useDTXcxx . . $ $anonymous_type_c9846ade8c67dd67_7#useDTX.; |
| 126 | encStatus->useCBRcxx . . $ $anonymous_type_1138ce94d7cabe34_0#useCBR. = state_Fxx[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..useCBRcxx . . $ $anonymous_type_c9846ade8c67dd67_7#useCBR.; |
| 127 | encStatus->internalSampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#internalSampleRate. = silk_SMULBBcxx . . $ `external/opusfile/opus/silk/macros.h:70:9`!( state_Fxx[ 0 ].sCmn.fs_kHz, 1000 ); |
| 128 | encStatus->allowBandwidthSwitchcxx . . $ $anonymous_type_1138ce94d7cabe34_0#allowBandwidthSwitch. = state_Fxx[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..allow_bandwidth_switchcxx . . $ $anonymous_type_c9846ade8c67dd67_7#allow_bandwidth_switch.; |
| 129 | encStatus->inWBmodeWithoutVariableLPcxx . . $ $anonymous_type_1138ce94d7cabe34_0#inWBmodeWithoutVariableLP. = state_Fxx[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..fs_kHzcxx . . $ $anonymous_type_c9846ade8c67dd67_7#fs_kHz. == 16 && state_Fxx[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..sLPcxx . . $ $anonymous_type_c9846ade8c67dd67_7#sLP..modecxx . . $ $anonymous_type_c9846ade8c67dd67_2#mode. == 0; |
| 130 | |
| 131 | return ret; |
| 132 | } |
| 133 | |
| 134 | |
| 135 | /**************************/ |
| 136 | /* Encode frame with Silk */ |
| 137 | /**************************/ |
| 138 | /* Note: if prefillFlag is set, the input must contain 10 ms of audio, irrespective of what */ |
| 139 | /* encControl->payloadSize_ms is set to */ |
| 140 | opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! silk_Encodecxx . . $ silk_Encode(df06407b0355e6ed).( /* O Returns error code */ |
| 141 | void *encState, /* I/O State */ |
| 142 | silk_EncControlStructcxx . . $ silk_EncControlStruct# *encControl, /* I Control status */ |
| 143 | const opus_int16cxx . . $ opus_int16# *samplesIn, /* I Speech sample input vector */ |
| 144 | opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! nSamplesIn, /* I Number of samples in input vector */ |
| 145 | ec_enccxx . . $ ec_enc# *psRangeEnc, /* I/O Compressor data structure */ |
| 146 | opus_int32cxx . . $ opus_int32# *nBytesOut, /* I/O Number of bytes in payload (input: Max bytes) */ |
| 147 | const opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! prefillFlag, /* I Flag to indicate prefilling buffers no coding */ |
| 148 | opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! activity /* I Decision of Opus voice activity detector */ |
| 149 | ) |
| 150 | { |
| 151 | opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! n, i, nBits, flags, tmp_payloadSize_ms = 0, tmp_complexity = 0, ret = 0; |
| 152 | opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! nSamplesToBuffer, nSamplesToBufferMax, nBlocksOf10ms; |
| 153 | opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! nSamplesFromInput = 0, nSamplesFromInputMax; |
| 154 | opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! speech_act_thr_for_switch_Q8; |
| 155 | opus_int32cxx . . $ opus_int32# TargetRate_bps, MStargetRates_bps[ 2 ], channelRate_bps, LBRR_symbol, sum; |
| 156 | silk_encodercxx . . $ silk_encoder# *psEnc = ( silk_encodercxx . . $ silk_encoder# * )encState; |
| 157 | VARDECLcxx . . $ `external/opusfile/opus/celt/stack_alloc.h:94:9`!( opus_int16, buf ); |
| 158 | opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! transition, curr_block, tot_blocks; |
| 159 | SAVE_STACKcxx . . $ `external/opusfile/opus/celt/stack_alloc.h:96:9`!; |
| 160 | |
| 161 | if (encControl->reducedDependencycxx . . $ $anonymous_type_1138ce94d7cabe34_0#reducedDependency.) |
| 162 | { |
| 163 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[0].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..first_frame_after_resetcxx . . $ $anonymous_type_c9846ade8c67dd67_7#first_frame_after_reset. = 1; |
| 164 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[1].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..first_frame_after_resetcxx . . $ $anonymous_type_c9846ade8c67dd67_7#first_frame_after_reset. = 1; |
| 165 | } |
| 166 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesEncodedcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesEncoded. = psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesEncodedcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesEncoded. = 0; |
| 167 | |
| 168 | /* Check values in encoder control structure */ |
| 169 | if( ( ret = check_control_inputcxx . . $ check_control_input(4fcd8096fd70892e).( encControl ) ) != 0 ) { |
| 170 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( 0 ); |
| 171 | RESTORE_STACKcxx . . $ `external/opusfile/opus/celt/stack_alloc.h:97:9`!; |
| 172 | return ret; |
| 173 | } |
| 174 | |
| 175 | encControl->switchReadycxx . . $ $anonymous_type_1138ce94d7cabe34_0#switchReady. = 0; |
| 176 | |
| 177 | if( encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal. > psEnc->nChannelsInternalcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#nChannelsInternal. ) { |
| 178 | /* Mono -> Stereo transition: init state of second channel and stereo state */ |
| 179 | ret += silk_init_encodercxx . . $ silk_init_encoder(c9c7e39f6113ca69).( &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ], psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..archcxx . . $ $anonymous_type_c9846ade8c67dd67_7#arch. ); |
| 180 | silk_memsetcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:421:9`!( psEnc->sStereo.pred_prev_Q13, 0, sizeof( psEnc->sStereo.pred_prev_Q13 ) ); |
| 181 | silk_memsetcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:421:9`!( psEnc->sStereo.sSide, 0, sizeof( psEnc->sStereo.sSide ) ); |
| 182 | psEnc->sStereocxx . . $ $anonymous_type_f1d9da68e5821ba3_3#sStereo..mid_side_amp_Q0cxx . . $ $anonymous_type_c9846ade8c67dd67_4#mid_side_amp_Q0.[ 0 ] = 0; |
| 183 | psEnc->sStereocxx . . $ $anonymous_type_f1d9da68e5821ba3_3#sStereo..mid_side_amp_Q0cxx . . $ $anonymous_type_c9846ade8c67dd67_4#mid_side_amp_Q0.[ 1 ] = 1; |
| 184 | psEnc->sStereocxx . . $ $anonymous_type_f1d9da68e5821ba3_3#sStereo..mid_side_amp_Q0cxx . . $ $anonymous_type_c9846ade8c67dd67_4#mid_side_amp_Q0.[ 2 ] = 0; |
| 185 | psEnc->sStereocxx . . $ $anonymous_type_f1d9da68e5821ba3_3#sStereo..mid_side_amp_Q0cxx . . $ $anonymous_type_c9846ade8c67dd67_4#mid_side_amp_Q0.[ 3 ] = 1; |
| 186 | psEnc->sStereocxx . . $ $anonymous_type_f1d9da68e5821ba3_3#sStereo..width_prev_Q14cxx . . $ $anonymous_type_c9846ade8c67dd67_4#width_prev_Q14. = 0; |
| 187 | psEnc->sStereocxx . . $ $anonymous_type_f1d9da68e5821ba3_3#sStereo..smth_width_Q14cxx . . $ $anonymous_type_c9846ade8c67dd67_4#smth_width_Q14. = SILK_FIX_CONSTcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:543:9`!( 1, 14 ); |
| 188 | if( psEnc->nChannelsAPIcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#nChannelsAPI. == 2 ) { |
| 189 | silk_memcpycxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:420:9`!( &psEnc->state_Fxx[ 1 ].sCmn.resampler_state, &psEnc->state_Fxx[ 0 ].sCmn.resampler_state, sizeof( silk_resampler_state_struct ) ); |
| 190 | silk_memcpycxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:420:9`!( &psEnc->state_Fxx[ 1 ].sCmn.In_HP_State, &psEnc->state_Fxx[ 0 ].sCmn.In_HP_State, sizeof( psEnc->state_Fxx[ 1 ].sCmn.In_HP_State ) ); |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | transition = (encControl->payloadSize_mscxx . . $ $anonymous_type_1138ce94d7cabe34_0#payloadSize_ms. != psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..PacketSize_mscxx . . $ $anonymous_type_c9846ade8c67dd67_7#PacketSize_ms.) || (psEnc->nChannelsInternalcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#nChannelsInternal. != encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal.); |
| 195 | |
| 196 | psEnc->nChannelsAPIcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#nChannelsAPI. = encControl->nChannelsAPIcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsAPI.; |
| 197 | psEnc->nChannelsInternalcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#nChannelsInternal. = encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal.; |
| 198 | |
| 199 | nBlocksOf10ms = silk_DIV32cxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:461:9`!( 100 * nSamplesIn, encControl->API_sampleRate ); |
| 200 | tot_blocks = ( nBlocksOf10ms > 1 ) ? nBlocksOf10ms >> 1 : 1; |
| 201 | curr_block = 0; |
| 202 | if( prefillFlag ) { |
| 203 | silk_LP_statecxx . . $ silk_LP_state# save_LP; |
| 204 | /* Only accept input length of 10 ms */ |
| 205 | if( nBlocksOf10ms != 1 ) { |
| 206 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( 0 ); |
| 207 | RESTORE_STACKcxx . . $ `external/opusfile/opus/celt/stack_alloc.h:97:9`!; |
| 208 | return SILK_ENC_INPUT_INVALID_NO_OF_SAMPLEScxx . . $ `external/opusfile/opus/silk/errors.h:46:9`!; |
| 209 | } |
| 210 | if ( prefillFlag == 2 ) { |
| 211 | save_LP = psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..sLPcxx . . $ $anonymous_type_c9846ade8c67dd67_7#sLP.; |
| 212 | /* Save the sampling rate so the bandwidth switching code can keep handling transitions. */ |
| 213 | save_LP.saved_fs_kHzcxx . . $ $anonymous_type_c9846ade8c67dd67_2#saved_fs_kHz. = psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..fs_kHzcxx . . $ $anonymous_type_c9846ade8c67dd67_7#fs_kHz.; |
| 214 | } |
| 215 | /* Reset Encoder */ |
| 216 | for( n = 0; n < encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal.; n++ ) { |
| 217 | ret = silk_init_encodercxx . . $ silk_init_encoder(c9c7e39f6113ca69).( &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ], psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..archcxx . . $ $anonymous_type_c9846ade8c67dd67_7#arch. ); |
| 218 | /* Restore the variable LP state. */ |
| 219 | if ( prefillFlag == 2 ) { |
| 220 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..sLPcxx . . $ $anonymous_type_c9846ade8c67dd67_7#sLP. = save_LP; |
| 221 | } |
| 222 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( !ret ); |
| 223 | } |
| 224 | tmp_payloadSize_ms = encControl->payloadSize_mscxx . . $ $anonymous_type_1138ce94d7cabe34_0#payloadSize_ms.; |
| 225 | encControl->payloadSize_mscxx . . $ $anonymous_type_1138ce94d7cabe34_0#payloadSize_ms. = 10; |
| 226 | tmp_complexity = encControl->complexitycxx . . $ $anonymous_type_1138ce94d7cabe34_0#complexity.; |
| 227 | encControl->complexitycxx . . $ $anonymous_type_1138ce94d7cabe34_0#complexity. = 0; |
| 228 | for( n = 0; n < encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal.; n++ ) { |
| 229 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..controlled_since_last_payloadcxx . . $ $anonymous_type_c9846ade8c67dd67_7#controlled_since_last_payload. = 0; |
| 230 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..prefillFlagcxx . . $ $anonymous_type_c9846ade8c67dd67_7#prefillFlag. = 1; |
| 231 | } |
| 232 | } else { |
| 233 | /* Only accept input lengths that are a multiple of 10 ms */ |
| 234 | if( nBlocksOf10ms * encControl->API_sampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#API_sampleRate. != 100 * nSamplesIn || nSamplesIn < 0 ) { |
| 235 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( 0 ); |
| 236 | RESTORE_STACKcxx . . $ `external/opusfile/opus/celt/stack_alloc.h:97:9`!; |
| 237 | return SILK_ENC_INPUT_INVALID_NO_OF_SAMPLEScxx . . $ `external/opusfile/opus/silk/errors.h:46:9`!; |
| 238 | } |
| 239 | /* Make sure no more than one packet can be produced */ |
| 240 | if( 1000 * (opus_int32cxx . . $ opus_int32#)nSamplesIn > encControl->payloadSize_mscxx . . $ $anonymous_type_1138ce94d7cabe34_0#payloadSize_ms. * encControl->API_sampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#API_sampleRate. ) { |
| 241 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( 0 ); |
| 242 | RESTORE_STACKcxx . . $ `external/opusfile/opus/celt/stack_alloc.h:97:9`!; |
| 243 | return SILK_ENC_INPUT_INVALID_NO_OF_SAMPLEScxx . . $ `external/opusfile/opus/silk/errors.h:46:9`!; |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | for( n = 0; n < encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal.; n++ ) { |
| 248 | /* Force the side channel to the same rate as the mid */ |
| 249 | opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! force_fs_kHz = (n==1) ? psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[0].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..fs_kHzcxx . . $ $anonymous_type_c9846ade8c67dd67_7#fs_kHz. : 0; |
| 250 | if( ( ret = silk_control_encodercxx . . $ silk_control_encoder(b5a802d14a76463b).( &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ], encControl, psEnc->allowBandwidthSwitchcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#allowBandwidthSwitch., n, force_fs_kHz ) ) != 0 ) { |
| 251 | silk_assertcxx . . $ `external/opusfile/opus/silk/typedef.h:74:11`!( 0 ); |
| 252 | RESTORE_STACKcxx . . $ `external/opusfile/opus/celt/stack_alloc.h:97:9`!; |
| 253 | return ret; |
| 254 | } |
| 255 | if( psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[n].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..first_frame_after_resetcxx . . $ $anonymous_type_c9846ade8c67dd67_7#first_frame_after_reset. || transition ) { |
| 256 | for( i = 0; i < psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesPerPacketcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesPerPacket.; i++ ) { |
| 257 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..LBRR_flagscxx . . $ $anonymous_type_c9846ade8c67dd67_7#LBRR_flags.[ i ] = 0; |
| 258 | } |
| 259 | } |
| 260 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inDTXcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inDTX. = psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..useDTXcxx . . $ $anonymous_type_c9846ade8c67dd67_7#useDTX.; |
| 261 | } |
| 262 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( encControl->nChannelsInternal == 1 || psEnc->state_Fxx[ 0 ].sCmn.fs_kHz == psEnc->state_Fxx[ 1 ].sCmn.fs_kHz ); |
| 263 | |
| 264 | /* Input buffering/resampling and encoding */ |
| 265 | nSamplesToBufferMax = |
| 266 | 10 * nBlocksOf10ms * psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..fs_kHzcxx . . $ $anonymous_type_c9846ade8c67dd67_7#fs_kHz.; |
| 267 | nSamplesFromInputMax = |
| 268 | silk_DIV32_16cxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:460:9`!( nSamplesToBufferMax * |
| 269 | psEnc->state_Fxx[ 0 ].sCmn.API_fs_Hz, |
| 270 | psEnc->state_Fxx[ 0 ].sCmn.fs_kHz * 1000 ); |
| 271 | ALLOCcxx . . $ `external/opusfile/opus/celt/stack_alloc.h:95:9`!( buf, nSamplesFromInputMax, opus_int16 ); |
| 272 | while( 1 ) { |
| 273 | nSamplesToBuffer = psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..frame_lengthcxx . . $ $anonymous_type_c9846ade8c67dd67_7#frame_length. - psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufIxcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBufIx.; |
| 274 | nSamplesToBuffer = silk_mincxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:539:9`!( nSamplesToBuffer, nSamplesToBufferMax ); |
| 275 | nSamplesFromInput = silk_DIV32_16cxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:460:9`!( nSamplesToBuffer * psEnc->state_Fxx[ 0 ].sCmn.API_fs_Hz, psEnc->state_Fxx[ 0 ].sCmn.fs_kHz * 1000 ); |
| 276 | /* Resample and write to buffer */ |
| 277 | if( encControl->nChannelsAPIcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsAPI. == 2 && encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal. == 2 ) { |
| 278 | opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! id = psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesEncodedcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesEncoded.; |
| 279 | for( n = 0; n < nSamplesFromInput; n++ ) { |
| 280 | buf[ n ] = samplesIn[ 2 * n ]; |
| 281 | } |
| 282 | /* Making sure to start both resamplers from the same state when switching from mono to stereo */ |
| 283 | if( psEnc->nPrevChannelsInternalcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#nPrevChannelsInternal. == 1 && id==0 ) { |
| 284 | silk_memcpycxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:420:9`!( &psEnc->state_Fxx[ 1 ].sCmn.resampler_state, &psEnc->state_Fxx[ 0 ].sCmn.resampler_state, sizeof(psEnc->state_Fxx[ 1 ].sCmn.resampler_state)); |
| 285 | } |
| 286 | |
| 287 | ret += silk_resamplercxx . . $ silk_resampler(35bad50a08f43124).( &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..resampler_statecxx . . $ $anonymous_type_c9846ade8c67dd67_7#resampler_state., |
| 288 | &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBuf.[ psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufIxcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBufIx. + 2 ], buf, nSamplesFromInput ); |
| 289 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufIxcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBufIx. += nSamplesToBuffer; |
| 290 | |
| 291 | nSamplesToBuffer = psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..frame_lengthcxx . . $ $anonymous_type_c9846ade8c67dd67_7#frame_length. - psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufIxcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBufIx.; |
| 292 | nSamplesToBuffer = silk_mincxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:539:9`!( nSamplesToBuffer, 10 * nBlocksOf10ms * psEnc->state_Fxx[ 1 ].sCmn.fs_kHz ); |
| 293 | for( n = 0; n < nSamplesFromInput; n++ ) { |
| 294 | buf[ n ] = samplesIn[ 2 * n + 1 ]; |
| 295 | } |
| 296 | ret += silk_resamplercxx . . $ silk_resampler(35bad50a08f43124).( &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..resampler_statecxx . . $ $anonymous_type_c9846ade8c67dd67_7#resampler_state., |
| 297 | &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBuf.[ psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufIxcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBufIx. + 2 ], buf, nSamplesFromInput ); |
| 298 | |
| 299 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufIxcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBufIx. += nSamplesToBuffer; |
| 300 | } else if( encControl->nChannelsAPIcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsAPI. == 2 && encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal. == 1 ) { |
| 301 | /* Combine left and right channels before resampling */ |
| 302 | for( n = 0; n < nSamplesFromInput; n++ ) { |
| 303 | sum = samplesIn[ 2 * n ] + samplesIn[ 2 * n + 1 ]; |
| 304 | buf[ n ] = (opus_int16cxx . . $ opus_int16#)silk_RSHIFT_ROUNDcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:531:9`!( sum, 1 ); |
| 305 | } |
| 306 | ret += silk_resamplercxx . . $ silk_resampler(35bad50a08f43124).( &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..resampler_statecxx . . $ $anonymous_type_c9846ade8c67dd67_7#resampler_state., |
| 307 | &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBuf.[ psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufIxcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBufIx. + 2 ], buf, nSamplesFromInput ); |
| 308 | /* On the first mono frame, average the results for the two resampler states */ |
| 309 | if( psEnc->nPrevChannelsInternalcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#nPrevChannelsInternal. == 2 && psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesEncodedcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesEncoded. == 0 ) { |
| 310 | ret += silk_resamplercxx . . $ silk_resampler(35bad50a08f43124).( &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..resampler_statecxx . . $ $anonymous_type_c9846ade8c67dd67_7#resampler_state., |
| 311 | &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBuf.[ psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufIxcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBufIx. + 2 ], buf, nSamplesFromInput ); |
| 312 | for( n = 0; n < psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..frame_lengthcxx . . $ $anonymous_type_c9846ade8c67dd67_7#frame_length.; n++ ) { |
| 313 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBuf.[ psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufIxcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBufIx.+n+2 ] = |
| 314 | silk_RSHIFTcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:511:9`!(psEnc->state_Fxx[ 0 ].sCmn.inputBuf[ psEnc->state_Fxx[ 0 ].sCmn.inputBufIx+n+2 ] |
| 315 | + psEnc->state_Fxx[ 1 ].sCmn.inputBuf[ psEnc->state_Fxx[ 1 ].sCmn.inputBufIx+n+2 ], 1); |
| 316 | } |
| 317 | } |
| 318 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufIxcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBufIx. += nSamplesToBuffer; |
| 319 | } else { |
| 320 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( encControl->nChannelsAPI == 1 && encControl->nChannelsInternal == 1 ); |
| 321 | silk_memcpycxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:420:9`!(buf, samplesIn, nSamplesFromInput*sizeof(opus_int16)); |
| 322 | ret += silk_resamplercxx . . $ silk_resampler(35bad50a08f43124).( &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..resampler_statecxx . . $ $anonymous_type_c9846ade8c67dd67_7#resampler_state., |
| 323 | &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBuf.[ psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufIxcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBufIx. + 2 ], buf, nSamplesFromInput ); |
| 324 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufIxcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBufIx. += nSamplesToBuffer; |
| 325 | } |
| 326 | |
| 327 | samplesIn += nSamplesFromInput * encControl->nChannelsAPIcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsAPI.; |
| 328 | nSamplesIn -= nSamplesFromInput; |
| 329 | |
| 330 | /* Default */ |
| 331 | psEnc->allowBandwidthSwitchcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#allowBandwidthSwitch. = 0; |
| 332 | |
| 333 | /* Silk encoder */ |
| 334 | if( psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufIxcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBufIx. >= psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..frame_lengthcxx . . $ $anonymous_type_c9846ade8c67dd67_7#frame_length. ) { |
| 335 | /* Enough data in input buffer, so encode */ |
| 336 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( psEnc->state_Fxx[ 0 ].sCmn.inputBufIx == psEnc->state_Fxx[ 0 ].sCmn.frame_length ); |
| 337 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( encControl->nChannelsInternal == 1 || psEnc->state_Fxx[ 1 ].sCmn.inputBufIx == psEnc->state_Fxx[ 1 ].sCmn.frame_length ); |
| 338 | |
| 339 | /* Deal with LBRR data */ |
| 340 | if( psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesEncodedcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesEncoded. == 0 && !prefillFlag ) { |
| 341 | /* Create space at start of payload for VAD and FEC flags */ |
| 342 | opus_uint8cxx . . $ opus_uint8# iCDF[ 2 ] = { 0, 0 }; |
| 343 | iCDF[ 0 ] = 256 - silk_RSHIFTcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:511:9`!( 256, ( psEnc->state_Fxx[ 0 ].sCmn.nFramesPerPacket + 1 ) * encControl->nChannelsInternal ); |
| 344 | ec_enc_icdfcxx . . $ ec_enc_icdf(aae3d6d7e5dce2b2).( psRangeEnc, 0, iCDF, 8 ); |
| 345 | |
| 346 | /* Encode any LBRR data from previous packet */ |
| 347 | /* Encode LBRR flags */ |
| 348 | for( n = 0; n < encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal.; n++ ) { |
| 349 | LBRR_symbol = 0; |
| 350 | for( i = 0; i < psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesPerPacketcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesPerPacket.; i++ ) { |
| 351 | LBRR_symbol |= silk_LSHIFTcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:505:9`!( psEnc->state_Fxx[ n ].sCmn.LBRR_flags[ i ], i ); |
| 352 | } |
| 353 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..LBRR_flagcxx . . $ $anonymous_type_c9846ade8c67dd67_7#LBRR_flag. = LBRR_symbol > 0 ? 1 : 0; |
| 354 | if( LBRR_symbol && psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesPerPacketcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesPerPacket. > 1 ) { |
| 355 | ec_enc_icdfcxx . . $ ec_enc_icdf(aae3d6d7e5dce2b2).( psRangeEnc, LBRR_symbol - 1, silk_LBRR_flags_iCDF_ptrcxx . . $ silk_LBRR_flags_iCDF_ptr.[ psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesPerPacketcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesPerPacket. - 2 ], 8 ); |
| 356 | } |
| 357 | } |
| 358 | |
| 359 | /* Code LBRR indices and excitation signals */ |
| 360 | for( i = 0; i < psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesPerPacketcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesPerPacket.; i++ ) { |
| 361 | for( n = 0; n < encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal.; n++ ) { |
| 362 | if( psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..LBRR_flagscxx . . $ $anonymous_type_c9846ade8c67dd67_7#LBRR_flags.[ i ] ) { |
| 363 | opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! condCoding; |
| 364 | |
| 365 | if( encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal. == 2 && n == 0 ) { |
| 366 | silk_stereo_encode_predcxx . . $ silk_stereo_encode_pred(86eacff9412b009).( psRangeEnc, psEnc->sStereocxx . . $ $anonymous_type_f1d9da68e5821ba3_3#sStereo..predIxcxx . . $ $anonymous_type_c9846ade8c67dd67_4#predIx.[ i ] ); |
| 367 | /* For LBRR data there's no need to code the mid-only flag if the side-channel LBRR flag is set */ |
| 368 | if( psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..LBRR_flagscxx . . $ $anonymous_type_c9846ade8c67dd67_7#LBRR_flags.[ i ] == 0 ) { |
| 369 | silk_stereo_encode_mid_onlycxx . . $ silk_stereo_encode_mid_only(40adebacf725b59c).( psRangeEnc, psEnc->sStereocxx . . $ $anonymous_type_f1d9da68e5821ba3_3#sStereo..mid_only_flagscxx . . $ $anonymous_type_c9846ade8c67dd67_4#mid_only_flags.[ i ] ); |
| 370 | } |
| 371 | } |
| 372 | /* Use conditional coding if previous frame available */ |
| 373 | if( i > 0 && psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..LBRR_flagscxx . . $ $anonymous_type_c9846ade8c67dd67_7#LBRR_flags.[ i - 1 ] ) { |
| 374 | condCoding = CODE_CONDITIONALLYcxx . . $ `external/opusfile/opus/silk/define.h:77:9`!; |
| 375 | } else { |
| 376 | condCoding = CODE_INDEPENDENTLYcxx . . $ `external/opusfile/opus/silk/define.h:75:9`!; |
| 377 | } |
| 378 | silk_encode_indicescxx . . $ silk_encode_indices(ff8f51fcf2ede63a).( &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn., psRangeEnc, i, 1, condCoding ); |
| 379 | silk_encode_pulsescxx . . $ silk_encode_pulses(b0c488396eb75e85).( psRangeEnc, psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..indices_LBRRcxx . . $ $anonymous_type_c9846ade8c67dd67_7#indices_LBRR.[i].signalTypecxx . . $ $anonymous_type_c9846ade8c67dd67_6#signalType., psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..indices_LBRRcxx . . $ $anonymous_type_c9846ade8c67dd67_7#indices_LBRR.[i].quantOffsetTypecxx . . $ $anonymous_type_c9846ade8c67dd67_6#quantOffsetType., |
| 380 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..pulses_LBRRcxx . . $ $anonymous_type_c9846ade8c67dd67_7#pulses_LBRR.[ i ], psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..frame_lengthcxx . . $ $anonymous_type_c9846ade8c67dd67_7#frame_length. ); |
| 381 | } |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | /* Reset LBRR flags */ |
| 386 | for( n = 0; n < encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal.; n++ ) { |
| 387 | silk_memsetcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:421:9`!( psEnc->state_Fxx[ n ].sCmn.LBRR_flags, 0, sizeof( psEnc->state_Fxx[ n ].sCmn.LBRR_flags ) ); |
| 388 | } |
| 389 | |
| 390 | psEnc->nBitsUsedLBRRcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#nBitsUsedLBRR. = ec_tellcxx . . $ ec_tell(d262775a7bafb6a0).( psRangeEnc ); |
| 391 | } |
| 392 | |
| 393 | silk_HP_variable_cutoffcxx . . $ silk_HP_variable_cutoff(a60c7498a8a81d69).( psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx. ); |
| 394 | |
| 395 | /* Total target bits for packet */ |
| 396 | nBits = silk_DIV32_16cxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:460:9`!( silk_MULcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:427:9`!( encControl->bitRate, encControl->payloadSize_ms ), 1000 ); |
| 397 | /* Subtract bits used for LBRR */ |
| 398 | if( !prefillFlag ) { |
| 399 | nBits -= psEnc->nBitsUsedLBRRcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#nBitsUsedLBRR.; |
| 400 | } |
| 401 | /* Divide by number of uncoded frames left in packet */ |
| 402 | nBits = silk_DIV32_16cxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:460:9`!( nBits, psEnc->state_Fxx[ 0 ].sCmn.nFramesPerPacket ); |
| 403 | /* Convert to bits/second */ |
| 404 | if( encControl->payloadSize_mscxx . . $ $anonymous_type_1138ce94d7cabe34_0#payloadSize_ms. == 10 ) { |
| 405 | TargetRate_bps = silk_SMULBBcxx . . $ `external/opusfile/opus/silk/macros.h:70:9`!( nBits, 100 ); |
| 406 | } else { |
| 407 | TargetRate_bps = silk_SMULBBcxx . . $ `external/opusfile/opus/silk/macros.h:70:9`!( nBits, 50 ); |
| 408 | } |
| 409 | /* Subtract fraction of bits in excess of target in previous frames and packets */ |
| 410 | TargetRate_bps -= silk_DIV32_16cxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:460:9`!( silk_MULcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:427:9`!( psEnc->nBitsExceeded, 1000 ), BITRESERVOIR_DECAY_TIME_MScxx . . $ `external/opusfile/opus/silk/tuning_parameters.h:37:9`! ); |
| 411 | if( !prefillFlag && psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesEncodedcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesEncoded. > 0 ) { |
| 412 | /* Compare actual vs target bits so far in this packet */ |
| 413 | opus_int32cxx . . $ opus_int32# bitsBalance = ec_tellcxx . . $ ec_tell(d262775a7bafb6a0).( psRangeEnc ) - psEnc->nBitsUsedLBRRcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#nBitsUsedLBRR. - nBits * psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesEncodedcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesEncoded.; |
| 414 | TargetRate_bps -= silk_DIV32_16cxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:460:9`!( silk_MULcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:427:9`!( bitsBalance, 1000 ), BITRESERVOIR_DECAY_TIME_MScxx . . $ `external/opusfile/opus/silk/tuning_parameters.h:37:9`! ); |
| 415 | } |
| 416 | /* Never exceed input bitrate */ |
| 417 | TargetRate_bps = silk_LIMITcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:581:9`!( TargetRate_bps, encControl->bitRate, 5000 ); |
| 418 | |
| 419 | /* Convert Left/Right to Mid/Side */ |
| 420 | if( encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal. == 2 ) { |
| 421 | silk_stereo_LR_to_MScxx . . $ silk_stereo_LR_to_MS(680593ae8f96460e).( &psEnc->sStereocxx . . $ $anonymous_type_f1d9da68e5821ba3_3#sStereo., &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBuf.[ 2 ], &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBuf.[ 2 ], |
| 422 | psEnc->sStereocxx . . $ $anonymous_type_f1d9da68e5821ba3_3#sStereo..predIxcxx . . $ $anonymous_type_c9846ade8c67dd67_4#predIx.[ psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesEncodedcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesEncoded. ], &psEnc->sStereocxx . . $ $anonymous_type_f1d9da68e5821ba3_3#sStereo..mid_only_flagscxx . . $ $anonymous_type_c9846ade8c67dd67_4#mid_only_flags.[ psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesEncodedcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesEncoded. ], |
| 423 | MStargetRates_bps, TargetRate_bps, psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..speech_activity_Q8cxx . . $ $anonymous_type_c9846ade8c67dd67_7#speech_activity_Q8., encControl->toMonocxx . . $ $anonymous_type_1138ce94d7cabe34_0#toMono., |
| 424 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..fs_kHzcxx . . $ $anonymous_type_c9846ade8c67dd67_7#fs_kHz., psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..frame_lengthcxx . . $ $anonymous_type_c9846ade8c67dd67_7#frame_length. ); |
| 425 | if( psEnc->sStereocxx . . $ $anonymous_type_f1d9da68e5821ba3_3#sStereo..mid_only_flagscxx . . $ $anonymous_type_c9846ade8c67dd67_4#mid_only_flags.[ psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesEncodedcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesEncoded. ] == 0 ) { |
| 426 | /* Reset side channel encoder memory for first frame with side coding */ |
| 427 | if( psEnc->prev_decode_only_middlecxx . . $ $anonymous_type_f1d9da68e5821ba3_3#prev_decode_only_middle. == 1 ) { |
| 428 | silk_memsetcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:421:9`!( &psEnc->state_Fxx[ 1 ].sShape, 0, sizeof( psEnc->state_Fxx[ 1 ].sShape ) ); |
| 429 | silk_memsetcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:421:9`!( &psEnc->state_Fxx[ 1 ].sCmn.sNSQ, 0, sizeof( psEnc->state_Fxx[ 1 ].sCmn.sNSQ ) ); |
| 430 | silk_memsetcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:421:9`!( psEnc->state_Fxx[ 1 ].sCmn.prev_NLSFq_Q15, 0, sizeof( psEnc->state_Fxx[ 1 ].sCmn.prev_NLSFq_Q15 ) ); |
| 431 | silk_memsetcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:421:9`!( &psEnc->state_Fxx[ 1 ].sCmn.sLP.In_LP_State, 0, sizeof( psEnc->state_Fxx[ 1 ].sCmn.sLP.In_LP_State ) ); |
| 432 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..prevLagcxx . . $ $anonymous_type_c9846ade8c67dd67_7#prevLag. = 100; |
| 433 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..sNSQcxx . . $ $anonymous_type_c9846ade8c67dd67_7#sNSQ..lagPrevcxx . . $ $anonymous_type_c9846ade8c67dd67_0#lagPrev. = 100; |
| 434 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sShapecxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sShape..LastGainIndexcxx . . $ $anonymous_type_f1d9da68e5821ba3_0#LastGainIndex. = 10; |
| 435 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..prevSignalTypecxx . . $ $anonymous_type_c9846ade8c67dd67_7#prevSignalType. = TYPE_NO_VOICE_ACTIVITYcxx . . $ `external/opusfile/opus/silk/define.h:70:9`!; |
| 436 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..sNSQcxx . . $ $anonymous_type_c9846ade8c67dd67_7#sNSQ..prev_gain_Q16cxx . . $ $anonymous_type_c9846ade8c67dd67_0#prev_gain_Q16. = 65536; |
| 437 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..first_frame_after_resetcxx . . $ $anonymous_type_c9846ade8c67dd67_7#first_frame_after_reset. = 1; |
| 438 | } |
| 439 | silk_encode_do_VAD_Fxxcxx . . $ `external/opusfile/opus/silk/float/main_FLP.h:45:9`!( &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ], activity ); |
| 440 | } else { |
| 441 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..VAD_flagscxx . . $ $anonymous_type_c9846ade8c67dd67_7#VAD_flags.[ psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesEncodedcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesEncoded. ] = 0; |
| 442 | } |
| 443 | if( !prefillFlag ) { |
| 444 | silk_stereo_encode_predcxx . . $ silk_stereo_encode_pred(86eacff9412b009).( psRangeEnc, psEnc->sStereocxx . . $ $anonymous_type_f1d9da68e5821ba3_3#sStereo..predIxcxx . . $ $anonymous_type_c9846ade8c67dd67_4#predIx.[ psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesEncodedcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesEncoded. ] ); |
| 445 | if( psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..VAD_flagscxx . . $ $anonymous_type_c9846ade8c67dd67_7#VAD_flags.[ psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesEncodedcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesEncoded. ] == 0 ) { |
| 446 | silk_stereo_encode_mid_onlycxx . . $ silk_stereo_encode_mid_only(40adebacf725b59c).( psRangeEnc, psEnc->sStereocxx . . $ $anonymous_type_f1d9da68e5821ba3_3#sStereo..mid_only_flagscxx . . $ $anonymous_type_c9846ade8c67dd67_4#mid_only_flags.[ psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesEncodedcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesEncoded. ] ); |
| 447 | } |
| 448 | } |
| 449 | } else { |
| 450 | /* Buffering */ |
| 451 | silk_memcpycxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:420:9`!( psEnc->state_Fxx[ 0 ].sCmn.inputBuf, psEnc->sStereo.sMid, 2 * sizeof( opus_int16 ) ); |
| 452 | silk_memcpycxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:420:9`!( psEnc->sStereo.sMid, &psEnc->state_Fxx[ 0 ].sCmn.inputBuf[ psEnc->state_Fxx[ 0 ].sCmn.frame_length ], 2 * sizeof( opus_int16 ) ); |
| 453 | } |
| 454 | silk_encode_do_VAD_Fxxcxx . . $ `external/opusfile/opus/silk/float/main_FLP.h:45:9`!( &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ], activity ); |
| 455 | |
| 456 | /* Encode */ |
| 457 | for( n = 0; n < encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal.; n++ ) { |
| 458 | opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! maxBits, useCBR; |
| 459 | |
| 460 | /* Handling rate constraints */ |
| 461 | maxBits = encControl->maxBitscxx . . $ $anonymous_type_1138ce94d7cabe34_0#maxBits.; |
| 462 | if( tot_blocks == 2 && curr_block == 0 ) { |
| 463 | maxBits = maxBits * 3 / 5; |
| 464 | } else if( tot_blocks == 3 ) { |
| 465 | if( curr_block == 0 ) { |
| 466 | maxBits = maxBits * 2 / 5; |
| 467 | } else if( curr_block == 1 ) { |
| 468 | maxBits = maxBits * 3 / 4; |
| 469 | } |
| 470 | } |
| 471 | useCBR = encControl->useCBRcxx . . $ $anonymous_type_1138ce94d7cabe34_0#useCBR. && curr_block == tot_blocks - 1; |
| 472 | |
| 473 | if( encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal. == 1 ) { |
| 474 | channelRate_bps = TargetRate_bps; |
| 475 | } else { |
| 476 | channelRate_bps = MStargetRates_bps[ n ]; |
| 477 | if( n == 0 && MStargetRates_bps[ 1 ] > 0 ) { |
| 478 | useCBR = 0; |
| 479 | /* Give mid up to 1/2 of the max bits for that frame */ |
| 480 | maxBits -= encControl->maxBitscxx . . $ $anonymous_type_1138ce94d7cabe34_0#maxBits. / ( tot_blocks * 2 ); |
| 481 | } |
| 482 | } |
| 483 | |
| 484 | if( channelRate_bps > 0 ) { |
| 485 | opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! condCoding; |
| 486 | |
| 487 | silk_control_SNRcxx . . $ silk_control_SNR(99ece60f02e4a8bb).( &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn., channelRate_bps ); |
| 488 | |
| 489 | /* Use independent coding if no previous frame available */ |
| 490 | if( psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesEncodedcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesEncoded. - n <= 0 ) { |
| 491 | condCoding = CODE_INDEPENDENTLYcxx . . $ `external/opusfile/opus/silk/define.h:75:9`!; |
| 492 | } else if( n > 0 && psEnc->prev_decode_only_middlecxx . . $ $anonymous_type_f1d9da68e5821ba3_3#prev_decode_only_middle. ) { |
| 493 | /* If we skipped a side frame in this packet, we don't |
| 494 | need LTP scaling; the LTP state is well-defined. */ |
| 495 | condCoding = CODE_INDEPENDENTLY_NO_LTP_SCALINGcxx . . $ `external/opusfile/opus/silk/define.h:76:9`!; |
| 496 | } else { |
| 497 | condCoding = CODE_CONDITIONALLYcxx . . $ `external/opusfile/opus/silk/define.h:77:9`!; |
| 498 | } |
| 499 | if( ( ret = silk_encode_frame_Fxxcxx . . $ `external/opusfile/opus/silk/float/main_FLP.h:46:9`!( &psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ], nBytesOut, psRangeEnc, condCoding, maxBits, useCBR ) ) != 0 ) { |
| 500 | silk_assertcxx . . $ `external/opusfile/opus/silk/typedef.h:74:11`!( 0 ); |
| 501 | } |
| 502 | } |
| 503 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..controlled_since_last_payloadcxx . . $ $anonymous_type_c9846ade8c67dd67_7#controlled_since_last_payload. = 0; |
| 504 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inputBufIxcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inputBufIx. = 0; |
| 505 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesEncodedcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesEncoded.++; |
| 506 | } |
| 507 | psEnc->prev_decode_only_middlecxx . . $ $anonymous_type_f1d9da68e5821ba3_3#prev_decode_only_middle. = psEnc->sStereocxx . . $ $anonymous_type_f1d9da68e5821ba3_3#sStereo..mid_only_flagscxx . . $ $anonymous_type_c9846ade8c67dd67_4#mid_only_flags.[ psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesEncodedcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesEncoded. - 1 ]; |
| 508 | |
| 509 | /* Insert VAD and FEC flags at beginning of bitstream */ |
| 510 | if( *nBytesOut > 0 && psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesEncodedcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesEncoded. == psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesPerPacketcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesPerPacket.) { |
| 511 | flags = 0; |
| 512 | for( n = 0; n < encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal.; n++ ) { |
| 513 | for( i = 0; i < psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesPerPacketcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesPerPacket.; i++ ) { |
| 514 | flags = silk_LSHIFTcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:505:9`!( flags, 1 ); |
| 515 | flags |= psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..VAD_flagscxx . . $ $anonymous_type_c9846ade8c67dd67_7#VAD_flags.[ i ]; |
| 516 | } |
| 517 | flags = silk_LSHIFTcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:505:9`!( flags, 1 ); |
| 518 | flags |= psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..LBRR_flagcxx . . $ $anonymous_type_c9846ade8c67dd67_7#LBRR_flag.; |
| 519 | } |
| 520 | if( !prefillFlag ) { |
| 521 | ec_enc_patch_initial_bitscxx . . $ ec_enc_patch_initial_bits(12a473fca7c00ee8).( psRangeEnc, flags, ( psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..nFramesPerPacketcxx . . $ $anonymous_type_c9846ade8c67dd67_7#nFramesPerPacket. + 1 ) * encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal. ); |
| 522 | } |
| 523 | |
| 524 | /* Return zero bytes if all channels DTXed */ |
| 525 | if( psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inDTXcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inDTX. && ( encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal. == 1 || psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 1 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..inDTXcxx . . $ $anonymous_type_c9846ade8c67dd67_7#inDTX. ) ) { |
| 526 | *nBytesOut = 0; |
| 527 | } |
| 528 | |
| 529 | psEnc->nBitsExceededcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#nBitsExceeded. += *nBytesOut * 8; |
| 530 | psEnc->nBitsExceededcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#nBitsExceeded. -= silk_DIV32_16cxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:460:9`!( silk_MULcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:427:9`!( encControl->bitRate, encControl->payloadSize_ms ), 1000 ); |
| 531 | psEnc->nBitsExceededcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#nBitsExceeded. = silk_LIMITcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:581:9`!( psEnc->nBitsExceeded, 0, 10000 ); |
| 532 | |
| 533 | /* Update flag indicating if bandwidth switching is allowed */ |
| 534 | speech_act_thr_for_switch_Q8 = silk_SMLAWBcxx . . $ `external/opusfile/opus/silk/macros.h:50:9`!( SILK_FIX_CONSTcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:543:9`!( SPEECH_ACTIVITY_DTX_THREScxx . . $ `external/opusfile/opus/silk/tuning_parameters.h:80:9`!, 8 ), |
| 535 | SILK_FIX_CONSTcxx . . $ `external/opusfile/opus/silk/SigProc_FIX.h:543:9`!( ( 1 - SPEECH_ACTIVITY_DTX_THREScxx . . $ `external/opusfile/opus/silk/tuning_parameters.h:80:9`! ) / MAX_BANDWIDTH_SWITCH_DELAY_MScxx . . $ `external/opusfile/opus/silk/tuning_parameters.h:149:9`!, 16 + 8 ), psEnc->timeSinceSwitchAllowed_ms ); |
| 536 | if( psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..speech_activity_Q8cxx . . $ $anonymous_type_c9846ade8c67dd67_7#speech_activity_Q8. < speech_act_thr_for_switch_Q8 ) { |
| 537 | psEnc->allowBandwidthSwitchcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#allowBandwidthSwitch. = 1; |
| 538 | psEnc->timeSinceSwitchAllowed_mscxx . . $ $anonymous_type_f1d9da68e5821ba3_3#timeSinceSwitchAllowed_ms. = 0; |
| 539 | } else { |
| 540 | psEnc->allowBandwidthSwitchcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#allowBandwidthSwitch. = 0; |
| 541 | psEnc->timeSinceSwitchAllowed_mscxx . . $ $anonymous_type_f1d9da68e5821ba3_3#timeSinceSwitchAllowed_ms. += encControl->payloadSize_mscxx . . $ $anonymous_type_1138ce94d7cabe34_0#payloadSize_ms.; |
| 542 | } |
| 543 | } |
| 544 | |
| 545 | if( nSamplesIn == 0 ) { |
| 546 | break; |
| 547 | } |
| 548 | } else { |
| 549 | break; |
| 550 | } |
| 551 | curr_block++; |
| 552 | } |
| 553 | |
| 554 | psEnc->nPrevChannelsInternalcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#nPrevChannelsInternal. = encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal.; |
| 555 | |
| 556 | encControl->allowBandwidthSwitchcxx . . $ $anonymous_type_1138ce94d7cabe34_0#allowBandwidthSwitch. = psEnc->allowBandwidthSwitchcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#allowBandwidthSwitch.; |
| 557 | encControl->inWBmodeWithoutVariableLPcxx . . $ $anonymous_type_1138ce94d7cabe34_0#inWBmodeWithoutVariableLP. = psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..fs_kHzcxx . . $ $anonymous_type_c9846ade8c67dd67_7#fs_kHz. == 16 && psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ 0 ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..sLPcxx . . $ $anonymous_type_c9846ade8c67dd67_7#sLP..modecxx . . $ $anonymous_type_c9846ade8c67dd67_2#mode. == 0; |
| 558 | encControl->internalSampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#internalSampleRate. = silk_SMULBBcxx . . $ `external/opusfile/opus/silk/macros.h:70:9`!( psEnc->state_Fxx[ 0 ].sCmn.fs_kHz, 1000 ); |
| 559 | encControl->stereoWidth_Q14cxx . . $ $anonymous_type_1138ce94d7cabe34_0#stereoWidth_Q14. = encControl->toMonocxx . . $ $anonymous_type_1138ce94d7cabe34_0#toMono. ? 0 : psEnc->sStereocxx . . $ $anonymous_type_f1d9da68e5821ba3_3#sStereo..smth_width_Q14cxx . . $ $anonymous_type_c9846ade8c67dd67_4#smth_width_Q14.; |
| 560 | if( prefillFlag ) { |
| 561 | encControl->payloadSize_mscxx . . $ $anonymous_type_1138ce94d7cabe34_0#payloadSize_ms. = tmp_payloadSize_ms; |
| 562 | encControl->complexitycxx . . $ $anonymous_type_1138ce94d7cabe34_0#complexity. = tmp_complexity; |
| 563 | for( n = 0; n < encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal.; n++ ) { |
| 564 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..controlled_since_last_payloadcxx . . $ $anonymous_type_c9846ade8c67dd67_7#controlled_since_last_payload. = 0; |
| 565 | psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[ n ].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..prefillFlagcxx . . $ $anonymous_type_c9846ade8c67dd67_7#prefillFlag. = 0; |
| 566 | } |
| 567 | } |
| 568 | |
| 569 | encControl->signalTypecxx . . $ $anonymous_type_1138ce94d7cabe34_0#signalType. = psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[0].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..indicescxx . . $ $anonymous_type_c9846ade8c67dd67_7#indices..signalTypecxx . . $ $anonymous_type_c9846ade8c67dd67_6#signalType.; |
| 570 | encControl->offsetcxx . . $ $anonymous_type_1138ce94d7cabe34_0#offset. = silk_Quantization_Offsets_Q10cxx . . $ silk_Quantization_Offsets_Q10. |
| 571 | [ psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[0].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..indicescxx . . $ $anonymous_type_c9846ade8c67dd67_7#indices..signalTypecxx . . $ $anonymous_type_c9846ade8c67dd67_6#signalType. >> 1 ] |
| 572 | [ psEnc->state_Fxxcxx . . $ $anonymous_type_f1d9da68e5821ba3_3#state_Fxx.[0].sCmncxx . . $ $anonymous_type_f1d9da68e5821ba3_1#sCmn..indicescxx . . $ $anonymous_type_c9846ade8c67dd67_7#indices..quantOffsetTypecxx . . $ $anonymous_type_c9846ade8c67dd67_6#quantOffsetType. ]; |
| 573 | RESTORE_STACKcxx . . $ `external/opusfile/opus/celt/stack_alloc.h:97:9`!; |
| 574 | return ret; |
| 575 | } |
| 576 |