Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2011-10-31 22:35:44 +0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2011-10-31 22:36:31 +0400
commitabaa348901c668542cf730e466b2c4f5e7c7c888 (patch)
treedfdaa62f7db32a47b88ca49ec706d741dd6df922 /src/opus_demo.c
parent917cd6e6ae4a00c8f63368b5b249cc793b96bb20 (diff)
Adds -random_fec option to randomly add FEC to some frames.
Undocumented for now
Diffstat (limited to 'src/opus_demo.c')
-rw-r--r--src/opus_demo.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/opus_demo.c b/src/opus_demo.c
index 7c161600..f97648c0 100644
--- a/src/opus_demo.c
+++ b/src/opus_demo.c
@@ -142,6 +142,7 @@ int main(int argc, char *argv[])
int sweep_bps = 0;
int random_framesize=0, newsize=0, delayed_celt=0;
int sweep_max=0, sweep_min=0;
+ int random_fec=0;
if (argc < 5 )
{
@@ -297,6 +298,10 @@ int main(int argc, char *argv[])
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 ) {
+ check_encoder_option(decode_only, "-random_fec");
+ random_fec = 1;
+ args++;
} else {
printf( "Error: unrecognized setting: %s\n\n", argv[ args ] );
print_usage( argv );
@@ -431,6 +436,10 @@ int main(int argc, char *argv[])
frame_size = newsize;
}
}
+ if (random_fec && rand()%30==0)
+ {
+ opus_encoder_ctl(enc, OPUS_SET_INBAND_FEC(rand()%4==0));
+ }
if (decode_only)
{
unsigned char ch[4];