| 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 | |
| 32 | #include "main.h"cxx . . $ `<file>/external/opusfile/opus/silk/main.h`/ |
| 33 | #include "control.h"cxx . . $ `<file>/external/opusfile/opus/silk/control.h`/ |
| 34 | #include "errors.h"cxx . . $ `<file>/external/opusfile/opus/silk/errors.h`/ |
| 35 | |
| 36 | /* Check encoder control struct */ |
| 37 | opus_intcxx . . $ `external/opusfile/opus/opus_types.h:36:9`! check_control_inputcxx . . $ check_control_input(4fcd8096fd70892e).( |
| 38 | silk_EncControlStructcxx . . $ silk_EncControlStruct# *encControl /* I Control structure */ |
| 39 | ) |
| 40 | { |
| 41 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( encControl != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! ); |
| 42 | |
| 43 | if( ( ( encControl->API_sampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#API_sampleRate. != 8000 ) && |
| 44 | ( encControl->API_sampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#API_sampleRate. != 12000 ) && |
| 45 | ( encControl->API_sampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#API_sampleRate. != 16000 ) && |
| 46 | ( encControl->API_sampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#API_sampleRate. != 24000 ) && |
| 47 | ( encControl->API_sampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#API_sampleRate. != 32000 ) && |
| 48 | ( encControl->API_sampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#API_sampleRate. != 44100 ) && |
| 49 | ( encControl->API_sampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#API_sampleRate. != 48000 ) ) || |
| 50 | ( ( encControl->desiredInternalSampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#desiredInternalSampleRate. != 8000 ) && |
| 51 | ( encControl->desiredInternalSampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#desiredInternalSampleRate. != 12000 ) && |
| 52 | ( encControl->desiredInternalSampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#desiredInternalSampleRate. != 16000 ) ) || |
| 53 | ( ( encControl->maxInternalSampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#maxInternalSampleRate. != 8000 ) && |
| 54 | ( encControl->maxInternalSampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#maxInternalSampleRate. != 12000 ) && |
| 55 | ( encControl->maxInternalSampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#maxInternalSampleRate. != 16000 ) ) || |
| 56 | ( ( encControl->minInternalSampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#minInternalSampleRate. != 8000 ) && |
| 57 | ( encControl->minInternalSampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#minInternalSampleRate. != 12000 ) && |
| 58 | ( encControl->minInternalSampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#minInternalSampleRate. != 16000 ) ) || |
| 59 | ( encControl->minInternalSampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#minInternalSampleRate. > encControl->desiredInternalSampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#desiredInternalSampleRate. ) || |
| 60 | ( encControl->maxInternalSampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#maxInternalSampleRate. < encControl->desiredInternalSampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#desiredInternalSampleRate. ) || |
| 61 | ( encControl->minInternalSampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#minInternalSampleRate. > encControl->maxInternalSampleRatecxx . . $ $anonymous_type_1138ce94d7cabe34_0#maxInternalSampleRate. ) ) { |
| 62 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( 0 ); |
| 63 | return SILK_ENC_FS_NOT_SUPPORTEDcxx . . $ `external/opusfile/opus/silk/errors.h:49:9`!; |
| 64 | } |
| 65 | if( encControl->payloadSize_mscxx . . $ $anonymous_type_1138ce94d7cabe34_0#payloadSize_ms. != 10 && |
| 66 | encControl->payloadSize_mscxx . . $ $anonymous_type_1138ce94d7cabe34_0#payloadSize_ms. != 20 && |
| 67 | encControl->payloadSize_mscxx . . $ $anonymous_type_1138ce94d7cabe34_0#payloadSize_ms. != 40 && |
| 68 | encControl->payloadSize_mscxx . . $ $anonymous_type_1138ce94d7cabe34_0#payloadSize_ms. != 60 ) { |
| 69 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( 0 ); |
| 70 | return SILK_ENC_PACKET_SIZE_NOT_SUPPORTEDcxx . . $ `external/opusfile/opus/silk/errors.h:52:9`!; |
| 71 | } |
| 72 | if( encControl->packetLossPercentagecxx . . $ $anonymous_type_1138ce94d7cabe34_0#packetLossPercentage. < 0 || encControl->packetLossPercentagecxx . . $ $anonymous_type_1138ce94d7cabe34_0#packetLossPercentage. > 100 ) { |
| 73 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( 0 ); |
| 74 | return SILK_ENC_INVALID_LOSS_RATEcxx . . $ `external/opusfile/opus/silk/errors.h:58:9`!; |
| 75 | } |
| 76 | if( encControl->useDTXcxx . . $ $anonymous_type_1138ce94d7cabe34_0#useDTX. < 0 || encControl->useDTXcxx . . $ $anonymous_type_1138ce94d7cabe34_0#useDTX. > 1 ) { |
| 77 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( 0 ); |
| 78 | return SILK_ENC_INVALID_DTX_SETTINGcxx . . $ `external/opusfile/opus/silk/errors.h:67:9`!; |
| 79 | } |
| 80 | if( encControl->useCBRcxx . . $ $anonymous_type_1138ce94d7cabe34_0#useCBR. < 0 || encControl->useCBRcxx . . $ $anonymous_type_1138ce94d7cabe34_0#useCBR. > 1 ) { |
| 81 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( 0 ); |
| 82 | return SILK_ENC_INVALID_CBR_SETTINGcxx . . $ `external/opusfile/opus/silk/errors.h:70:9`!; |
| 83 | } |
| 84 | if( encControl->useInBandFECcxx . . $ $anonymous_type_1138ce94d7cabe34_0#useInBandFEC. < 0 || encControl->useInBandFECcxx . . $ $anonymous_type_1138ce94d7cabe34_0#useInBandFEC. > 1 ) { |
| 85 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( 0 ); |
| 86 | return SILK_ENC_INVALID_INBAND_FEC_SETTINGcxx . . $ `external/opusfile/opus/silk/errors.h:64:9`!; |
| 87 | } |
| 88 | if( encControl->nChannelsAPIcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsAPI. < 1 || encControl->nChannelsAPIcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsAPI. > ENCODER_NUM_CHANNELScxx . . $ `external/opusfile/opus/silk/define.h:40:9`! ) { |
| 89 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( 0 ); |
| 90 | return SILK_ENC_INVALID_NUMBER_OF_CHANNELS_ERRORcxx . . $ `external/opusfile/opus/silk/errors.h:76:9`!; |
| 91 | } |
| 92 | if( encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal. < 1 || encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal. > ENCODER_NUM_CHANNELScxx . . $ `external/opusfile/opus/silk/define.h:40:9`! ) { |
| 93 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( 0 ); |
| 94 | return SILK_ENC_INVALID_NUMBER_OF_CHANNELS_ERRORcxx . . $ `external/opusfile/opus/silk/errors.h:76:9`!; |
| 95 | } |
| 96 | if( encControl->nChannelsInternalcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsInternal. > encControl->nChannelsAPIcxx . . $ $anonymous_type_1138ce94d7cabe34_0#nChannelsAPI. ) { |
| 97 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( 0 ); |
| 98 | return SILK_ENC_INVALID_NUMBER_OF_CHANNELS_ERRORcxx . . $ `external/opusfile/opus/silk/errors.h:76:9`!; |
| 99 | } |
| 100 | if( encControl->complexitycxx . . $ $anonymous_type_1138ce94d7cabe34_0#complexity. < 0 || encControl->complexitycxx . . $ $anonymous_type_1138ce94d7cabe34_0#complexity. > 10 ) { |
| 101 | celt_assertcxx . . $ `external/opusfile/opus/celt/arch.h:80:9`!( 0 ); |
| 102 | return SILK_ENC_INVALID_COMPLEXITY_SETTINGcxx . . $ `external/opusfile/opus/silk/errors.h:61:9`!; |
| 103 | } |
| 104 | |
| 105 | return SILK_NO_ERRORcxx . . $ `external/opusfile/opus/silk/errors.h:39:9`!; |
| 106 | } |