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
path: root/tests
diff options
context:
space:
mode:
authorFelicia Lim <flim@google.com>2016-10-28 03:03:36 +0300
committerJean-Marc Valin <jmvalin@jmvalin.ca>2016-10-28 06:36:57 +0300
commit0962cbe2ae535f8432fec37461ca006f113f200d (patch)
tree337b810987a11ab0bd59d3043775f3d9714fc651 /tests
parent8bca154ba09d6cf10f0c92e1acca303f76a66b04 (diff)
Support encoding 80/100/120 ms frame lengths
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_opus_api.c9
-rw-r--r--tests/test_opus_encode.c18
2 files changed, 25 insertions, 2 deletions
diff --git a/tests/test_opus_api.c b/tests/test_opus_api.c
index 489052d2..1d009505 100644
--- a/tests/test_opus_api.c
+++ b/tests/test_opus_api.c
@@ -1383,6 +1383,15 @@ opus_int32 test_enc_api(void)
err=opus_encoder_ctl(enc,OPUS_SET_EXPERT_FRAME_DURATION(OPUS_FRAMESIZE_60_MS));
if(err!=OPUS_OK)test_failed();
cfgs++;
+ err=opus_encoder_ctl(enc,OPUS_SET_EXPERT_FRAME_DURATION(OPUS_FRAMESIZE_80_MS));
+ if(err!=OPUS_OK)test_failed();
+ cfgs++;
+ err=opus_encoder_ctl(enc,OPUS_SET_EXPERT_FRAME_DURATION(OPUS_FRAMESIZE_100_MS));
+ if(err!=OPUS_OK)test_failed();
+ cfgs++;
+ err=opus_encoder_ctl(enc,OPUS_SET_EXPERT_FRAME_DURATION(OPUS_FRAMESIZE_120_MS));
+ if(err!=OPUS_OK)test_failed();
+ cfgs++;
CHECK_SETGET(OPUS_SET_EXPERT_FRAME_DURATION(i),OPUS_GET_EXPERT_FRAME_DURATION(&i),0,-1,
OPUS_FRAMESIZE_60_MS,OPUS_FRAMESIZE_ARG,
" OPUS_SET_EXPERT_FRAME_DURATION ............... OK.\n",
diff --git a/tests/test_opus_encode.c b/tests/test_opus_encode.c
index c49a2adf..a7439254 100644
--- a/tests/test_opus_encode.c
+++ b/tests/test_opus_encode.c
@@ -128,6 +128,12 @@ int get_frame_size_enum(int frame_size, int sampling_rate)
frame_size_enum = OPUS_FRAMESIZE_40_MS;
else if(frame_size==3*sampling_rate/50)
frame_size_enum = OPUS_FRAMESIZE_60_MS;
+ else if(frame_size==4*sampling_rate/50)
+ frame_size_enum = OPUS_FRAMESIZE_80_MS;
+ else if(frame_size==5*sampling_rate/50)
+ frame_size_enum = OPUS_FRAMESIZE_100_MS;
+ else if(frame_size==6*sampling_rate/50)
+ frame_size_enum = OPUS_FRAMESIZE_120_MS;
else
test_failed();
@@ -189,14 +195,16 @@ void fuzz_encoder_settings(const int num_encoders, const int num_setting_changes
int use_vbr[3] = {0, 1, 1};
int vbr_constraints[3] = {0, 1, 1};
int complexities[11] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
- int max_bandwidths[6] = {OPUS_BANDWIDTH_NARROWBAND, OPUS_BANDWIDTH_MEDIUMBAND, OPUS_BANDWIDTH_WIDEBAND, OPUS_BANDWIDTH_SUPERWIDEBAND, OPUS_BANDWIDTH_FULLBAND, OPUS_BANDWIDTH_FULLBAND};
+ int max_bandwidths[6] = {OPUS_BANDWIDTH_NARROWBAND, OPUS_BANDWIDTH_MEDIUMBAND,
+ OPUS_BANDWIDTH_WIDEBAND, OPUS_BANDWIDTH_SUPERWIDEBAND,
+ OPUS_BANDWIDTH_FULLBAND, OPUS_BANDWIDTH_FULLBAND};
int signals[4] = {OPUS_AUTO, OPUS_AUTO, OPUS_SIGNAL_VOICE, OPUS_SIGNAL_MUSIC};
int inband_fecs[3] = {0, 0, 1};
int packet_loss_perc[4] = {0, 1, 2, 5};
int lsb_depths[2] = {8, 24};
int prediction_disabled[3] = {0, 0, 1};
int use_dtx[2] = {0, 1};
- int frame_sizes_ms_x2[6] = {5, 10, 20, 40, 80, 120}; /* x2 to avoid 2.5 ms */
+ int frame_sizes_ms_x2[9] = {5, 10, 20, 40, 80, 120, 160, 200, 240}; /* x2 to avoid 2.5 ms */
char debug_info[512];
for (i=0; i<num_encoders; i++) {
@@ -228,6 +236,12 @@ void fuzz_encoder_settings(const int num_encoders, const int num_setting_changes
int frame_size_enum = get_frame_size_enum(frame_size, sampling_rate);
force_channel = IMIN(force_channel, num_channels);
+ /* Todo: remove when a fix is available for coding SILK in DTX mode for >60 ms.
+ * Currently, SILK may internally adjust the bandwidth leading to mismatching
+ * bandwidths within a packet. */
+ if (frame_size_ms_x2 > 120)
+ dtx = 0;
+
sprintf(debug_info,
"fuzz_encoder_settings: %d kHz, %d ch, application: %d, "
"%d bps, force ch: %d, vbr: %d, vbr constraint: %d, complexity: %d, "