diff options
author | Jean-Marc Valin <jmvalin@amazon.com> | 2022-12-21 11:30:31 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@amazon.com> | 2023-06-16 20:01:26 +0300 |
commit | 8bbfb2ec479624f80c60a3fc1b0180f0bf36a922 (patch) | |
tree | a17417af6cda5a8abd9de34e2550ebb3d4b85906 /src/opus_demo.c | |
parent | 6b124314887b7b02d2f128ce4126ee0dc29da25d (diff) |
Controlling DRED on the encode side
Diffstat (limited to 'src/opus_demo.c')
-rw-r--r-- | src/opus_demo.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/opus_demo.c b/src/opus_demo.c index 50a66db3..af5e30f3 100644 --- a/src/opus_demo.c +++ b/src/opus_demo.c @@ -64,6 +64,7 @@ void print_usage( char* argv[] ) fprintf(stderr, "-dtx : enable SILK DTX\n" ); fprintf(stderr, "-loss <perc> : optimize for loss percentage and simulate packet loss, in percent (0-100); default: 0\n" ); fprintf(stderr, "-lossfile <file> : simulate packet loss, reading loss from file\n" ); + fprintf(stderr, "-dred <frames> : add Deep REDundancy (in units of 10-ms frames)\n" ); } static void int_to_char(opus_uint32 i, unsigned char ch[4]) @@ -266,6 +267,7 @@ int main(int argc, char *argv[]) int ret = EXIT_FAILURE; int lost_count=0; FILE *packet_loss_file=NULL; + int dred_duration=0; if (argc < 5 ) { @@ -431,6 +433,9 @@ int main(int argc, char *argv[]) exit(1); } args += 2; + } else if( strcmp( argv[ args ], "-dred" ) == 0 ) { + dred_duration = atoi( argv[ args + 1 ] ); + args += 2; } else if( strcmp( argv[ args ], "-sweep" ) == 0 ) { check_encoder_option(decode_only, "-sweep"); sweep_bps = atoi( argv[ args + 1 ] ); @@ -546,6 +551,10 @@ int main(int argc, char *argv[]) opus_encoder_ctl(enc, OPUS_GET_LOOKAHEAD(&skip)); opus_encoder_ctl(enc, OPUS_SET_LSB_DEPTH(16)); opus_encoder_ctl(enc, OPUS_SET_EXPERT_FRAME_DURATION(variable_duration)); + if (dred_duration > 0) + { + opus_encoder_ctl(enc, OPUS_SET_DRED_DURATION(dred_duration)); + } } if (!encode_only) { |