Converting some silk_assert()s into hardening celt_assert()s
Only converted the ones that are really sure (not signal-dependent) and that shouldn't add much run-time complexity
This commit is contained in:
parent
69bcb28d3d
commit
7e3352ef51
29 changed files with 96 additions and 96 deletions
|
@ -38,7 +38,7 @@ opus_int check_control_input(
|
|||
silk_EncControlStruct *encControl /* I Control structure */
|
||||
)
|
||||
{
|
||||
silk_assert( encControl != NULL );
|
||||
celt_assert( encControl != NULL );
|
||||
|
||||
if( ( ( encControl->API_sampleRate != 8000 ) &&
|
||||
( encControl->API_sampleRate != 12000 ) &&
|
||||
|
@ -59,46 +59,46 @@ opus_int check_control_input(
|
|||
( encControl->minInternalSampleRate > encControl->desiredInternalSampleRate ) ||
|
||||
( encControl->maxInternalSampleRate < encControl->desiredInternalSampleRate ) ||
|
||||
( encControl->minInternalSampleRate > encControl->maxInternalSampleRate ) ) {
|
||||
silk_assert( 0 );
|
||||
celt_assert( 0 );
|
||||
return SILK_ENC_FS_NOT_SUPPORTED;
|
||||
}
|
||||
if( encControl->payloadSize_ms != 10 &&
|
||||
encControl->payloadSize_ms != 20 &&
|
||||
encControl->payloadSize_ms != 40 &&
|
||||
encControl->payloadSize_ms != 60 ) {
|
||||
silk_assert( 0 );
|
||||
celt_assert( 0 );
|
||||
return SILK_ENC_PACKET_SIZE_NOT_SUPPORTED;
|
||||
}
|
||||
if( encControl->packetLossPercentage < 0 || encControl->packetLossPercentage > 100 ) {
|
||||
silk_assert( 0 );
|
||||
celt_assert( 0 );
|
||||
return SILK_ENC_INVALID_LOSS_RATE;
|
||||
}
|
||||
if( encControl->useDTX < 0 || encControl->useDTX > 1 ) {
|
||||
silk_assert( 0 );
|
||||
celt_assert( 0 );
|
||||
return SILK_ENC_INVALID_DTX_SETTING;
|
||||
}
|
||||
if( encControl->useCBR < 0 || encControl->useCBR > 1 ) {
|
||||
silk_assert( 0 );
|
||||
celt_assert( 0 );
|
||||
return SILK_ENC_INVALID_CBR_SETTING;
|
||||
}
|
||||
if( encControl->useInBandFEC < 0 || encControl->useInBandFEC > 1 ) {
|
||||
silk_assert( 0 );
|
||||
celt_assert( 0 );
|
||||
return SILK_ENC_INVALID_INBAND_FEC_SETTING;
|
||||
}
|
||||
if( encControl->nChannelsAPI < 1 || encControl->nChannelsAPI > ENCODER_NUM_CHANNELS ) {
|
||||
silk_assert( 0 );
|
||||
celt_assert( 0 );
|
||||
return SILK_ENC_INVALID_NUMBER_OF_CHANNELS_ERROR;
|
||||
}
|
||||
if( encControl->nChannelsInternal < 1 || encControl->nChannelsInternal > ENCODER_NUM_CHANNELS ) {
|
||||
silk_assert( 0 );
|
||||
celt_assert( 0 );
|
||||
return SILK_ENC_INVALID_NUMBER_OF_CHANNELS_ERROR;
|
||||
}
|
||||
if( encControl->nChannelsInternal > encControl->nChannelsAPI ) {
|
||||
silk_assert( 0 );
|
||||
celt_assert( 0 );
|
||||
return SILK_ENC_INVALID_NUMBER_OF_CHANNELS_ERROR;
|
||||
}
|
||||
if( encControl->complexity < 0 || encControl->complexity > 10 ) {
|
||||
silk_assert( 0 );
|
||||
celt_assert( 0 );
|
||||
return SILK_ENC_INVALID_COMPLEXITY_SETTING;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue