ref: 2967d4e220ffe5805c833252861ad2a9c3f7d113
parent: daa416700c3c289a13484b769083d41343687dc7
author: Gregory Maxwell <[email protected]>
date: Thu May 17 16:04:42 EDT 2012
Remove unnecessary and not-very-portable opus_demo case insensitivity.
--- a/src/opus_demo.c
+++ b/src/opus_demo.c
@@ -63,13 +63,6 @@
fprintf(stderr, "-loss <perc> : simulate packet loss, in percent (0-100); default: 0\n" );
}
-#ifdef _WIN32
-# define STR_CASEINSENSITIVE_COMPARE(x, y) _stricmp(x, y)
-#else
-# include <strings.h>
-# define STR_CASEINSENSITIVE_COMPARE(x, y) strcasecmp(x, y)
-#endif
-
static void int_to_char(opus_uint32 i, unsigned char ch[4])
{
ch[0] = i>>24;
@@ -318,11 +311,11 @@
while( args < argc - 2 ) {
/* process command line options */
- if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-cbr" ) == 0 ) {
+ if( strcmp( argv[ args ], "-cbr" ) == 0 ) {
check_encoder_option(decode_only, "-cbr");
use_vbr = 0;
args++;
- } else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-bandwidth" ) == 0 ) {
+ } else if( strcmp( argv[ args ], "-bandwidth" ) == 0 ) {
check_encoder_option(decode_only, "-bandwidth");
if (strcmp(argv[ args + 1 ], "NB")==0)
bandwidth = OPUS_BANDWIDTH_NARROWBAND;
@@ -341,7 +334,7 @@
return EXIT_FAILURE;
}
args += 2;
- } else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-framesize" ) == 0 ) {
+ } else if( strcmp( argv[ args ], "-framesize" ) == 0 ) {
check_encoder_option(decode_only, "-framesize");
if (strcmp(argv[ args + 1 ], "2.5")==0)
frame_size = sampling_rate/400;
@@ -362,80 +355,80 @@
return EXIT_FAILURE;
}
args += 2;
- } else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-max_payload" ) == 0 ) {
+ } else if( strcmp( argv[ args ], "-max_payload" ) == 0 ) {
check_encoder_option(decode_only, "-max_payload");
max_payload_bytes = atoi( argv[ args + 1 ] );
args += 2;
- } else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-complexity" ) == 0 ) {
+ } else if( strcmp( argv[ args ], "-complexity" ) == 0 ) {
check_encoder_option(decode_only, "-complexity");
complexity = atoi( argv[ args + 1 ] );
args += 2;
- } else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-inbandfec" ) == 0 ) {
+ } else if( strcmp( argv[ args ], "-inbandfec" ) == 0 ) {
use_inbandfec = 1;
args++;
- } else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-forcemono" ) == 0 ) {
+ } else if( strcmp( argv[ args ], "-forcemono" ) == 0 ) {
check_encoder_option(decode_only, "-forcemono");
forcechannels = 1;
args++;
- } else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-cvbr" ) == 0 ) {
+ } else if( strcmp( argv[ args ], "-cvbr" ) == 0 ) {
check_encoder_option(decode_only, "-cvbr");
cvbr = 1;
args++;
- } else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-dtx") == 0 ) {
+ } else if( strcmp( argv[ args ], "-dtx") == 0 ) {
check_encoder_option(decode_only, "-dtx");
use_dtx = 1;
args++;
- } else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-loss" ) == 0 ) {
+ } else if( strcmp( argv[ args ], "-loss" ) == 0 ) {
check_decoder_option(encode_only, "-loss");
packet_loss_perc = atoi( argv[ args + 1 ] );
args += 2;
- } else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-sweep" ) == 0 ) {
+ } else if( strcmp( argv[ args ], "-sweep" ) == 0 ) {
check_encoder_option(decode_only, "-sweep");
sweep_bps = atoi( argv[ args + 1 ] );
args += 2;
- } else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-random_framesize" ) == 0 ) {
+ } else if( strcmp( argv[ args ], "-random_framesize" ) == 0 ) {
check_encoder_option(decode_only, "-random_framesize");
random_framesize = 1;
args++;
- } else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-sweep_max" ) == 0 ) {
+ } else if( strcmp( argv[ args ], "-sweep_max" ) == 0 ) {
check_encoder_option(decode_only, "-sweep_max");
sweep_max = atoi( argv[ args + 1 ] );
args += 2;
- } else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-random_fec" ) == 0 ) {
+ } else if( strcmp( argv[ args ], "-random_fec" ) == 0 ) {
check_encoder_option(decode_only, "-random_fec");
random_fec = 1;
args++;
- } else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-silk8k_test" ) == 0 ) {
+ } else if( strcmp( argv[ args ], "-silk8k_test" ) == 0 ) {
check_encoder_option(decode_only, "-silk8k_test");
mode_list = silk8_test;
nb_modes_in_list = 8;
args++;
- } else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-silk12k_test" ) == 0 ) {
+ } else if( strcmp( argv[ args ], "-silk12k_test" ) == 0 ) {
check_encoder_option(decode_only, "-silk12k_test");
mode_list = silk12_test;
nb_modes_in_list = 8;
args++;
- } else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-silk16k_test" ) == 0 ) {
+ } else if( strcmp( argv[ args ], "-silk16k_test" ) == 0 ) {
check_encoder_option(decode_only, "-silk16k_test");
mode_list = silk16_test;
nb_modes_in_list = 8;
args++;
- } else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-hybrid24k_test" ) == 0 ) {
+ } else if( strcmp( argv[ args ], "-hybrid24k_test" ) == 0 ) {
check_encoder_option(decode_only, "-hybrid24k_test");
mode_list = hybrid24_test;
nb_modes_in_list = 4;
args++;
- } else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-hybrid48k_test" ) == 0 ) {
+ } else if( strcmp( argv[ args ], "-hybrid48k_test" ) == 0 ) {
check_encoder_option(decode_only, "-hybrid48k_test");
mode_list = hybrid48_test;
nb_modes_in_list = 4;
args++;
- } else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-celt_test" ) == 0 ) {
+ } else if( strcmp( argv[ args ], "-celt_test" ) == 0 ) {
check_encoder_option(decode_only, "-celt_test");
mode_list = celt_test;
nb_modes_in_list = 32;
args++;
- } else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-celt_hq_test" ) == 0 ) {
+ } else if( strcmp( argv[ args ], "-celt_hq_test" ) == 0 ) {
check_encoder_option(decode_only, "-celt_hq_test");
mode_list = celt_hq_test;
nb_modes_in_list = 4;