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-09-16 12:12:00 +0300
committerJean-Marc Valin <jmvalin@jmvalin.ca>2016-09-16 15:39:08 +0300
commitc305b824e936f18b486c055bdfbe125197cdb3ec (patch)
tree1f098ddbdba300bd1c7ccf99366fe11946b34cc3 /tests
parentf4dcc09f629ccf9694e1da3c605add01a95ae73e (diff)
Remove float ops from encoder settings fuzzer test
Diffstat (limited to 'tests')
-rw-r--r--tests/test_opus_encode.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_opus_encode.c b/tests/test_opus_encode.c
index 32040e60..4e7ccf7d 100644
--- a/tests/test_opus_encode.c
+++ b/tests/test_opus_encode.c
@@ -196,7 +196,7 @@ void fuzz_encoder_settings(const int num_encoders, const int num_setting_changes
int lsb_depths[2] = {8, 24};
int prediction_disabled[3] = {0, 0, 1};
int use_dtx[2] = {0, 1};
- float frame_sizes_ms[6] = {2.5, 5, 10, 20, 40, 60};
+ int frame_sizes_ms_x2[6] = {5, 10, 20, 40, 80, 120}; /* x2 to avoid 2.5 ms */
char debug_info[512];
for (i=0; i<num_encoders; i++) {
@@ -223,8 +223,8 @@ void fuzz_encoder_settings(const int num_encoders, const int num_setting_changes
int lsb_depth = RAND_SAMPLE(lsb_depths);
int pred_disabled = RAND_SAMPLE(prediction_disabled);
int dtx = RAND_SAMPLE(use_dtx);
- float frame_size_ms = RAND_SAMPLE(frame_sizes_ms);
- int frame_size = (int)(frame_size_ms*sampling_rate/1000);
+ int frame_size_ms_x2 = RAND_SAMPLE(frame_sizes_ms_x2);
+ int frame_size = frame_size_ms_x2*sampling_rate/2000;
int frame_size_enum = get_frame_size_enum(frame_size, sampling_rate);
force_channel = IMIN(force_channel, num_channels);
@@ -232,10 +232,10 @@ void fuzz_encoder_settings(const int num_encoders, const int num_setting_changes
"fuzz_encoder_settings: %d kHz, %d ch, application: %d, "
"%d bps, force ch: %d, vbr: %d, vbr constraint: %d, complexity: %d, "
"max bw: %d, signal: %d, inband fec: %d, pkt loss: %d%%, lsb depth: %d, "
- "pred disabled: %d, dtx: %d, %.1f ms\n",
+ "pred disabled: %d, dtx: %d, (%d/2) ms\n",
sampling_rate/1000, num_channels, application, bitrate,
force_channel, vbr, vbr_constraint, complexity, max_bw, sig, inband_fec,
- pkt_loss, lsb_depth, pred_disabled, dtx, frame_size_ms);
+ pkt_loss, lsb_depth, pred_disabled, dtx, frame_size_ms_x2);
if(opus_encoder_ctl(enc, OPUS_SET_BITRATE(bitrate)) != OPUS_OK) test_failed();
if(opus_encoder_ctl(enc, OPUS_SET_FORCE_CHANNELS(force_channel)) != OPUS_OK) test_failed();