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:
authorMark Harris <mark.hsj@gmail.com>2016-11-02 16:18:25 +0300
committerMark Harris <mark.hsj@gmail.com>2016-11-02 17:19:56 +0300
commit20bf3b33009b85f37bec9c8f4d0e6f6957602d06 (patch)
tree83f0bda22ec13400fd4961c1bd048934ba028b42 /tests
parent1fd53f9a928a7c76d1a89c01f0e8466efaa071bf (diff)
Reduce redundancy when SILK uses too many bits
Fix Hybrid redundancy assertion failure in ec_enc_shrink(), even if SILK produces more than maxBits, by reducing or eliminating redundancy when necessary. Don't reserve space for redundancy that is too small to be used for redundancy. When there is not enough space for redundancy, allow the regular frame to use all the bits.
Diffstat (limited to 'tests')
-rw-r--r--tests/opus_encode_regressions.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/opus_encode_regressions.c b/tests/opus_encode_regressions.c
index 2bc76491..aaeaf1e8 100644
--- a/tests/opus_encode_regressions.c
+++ b/tests/opus_encode_regressions.c
@@ -951,6 +951,38 @@ static int ec_enc_shrink_assert(void)
return 0;
}
+static int ec_enc_shrink_assert2(void)
+{
+ OpusEncoder *enc;
+ int err;
+ int data_len;
+ unsigned char data[2000];
+
+ enc = opus_encoder_create(48000, 1, OPUS_APPLICATION_AUDIO, &err);
+ opus_encoder_ctl(enc, OPUS_SET_COMPLEXITY(6));
+ opus_encoder_ctl(enc, OPUS_SET_SIGNAL(OPUS_SIGNAL_VOICE));
+ opus_encoder_ctl(enc, OPUS_SET_BANDWIDTH(OPUS_BANDWIDTH_FULLBAND));
+ opus_encoder_ctl(enc, OPUS_SET_PACKET_LOSS_PERC(26));
+ opus_encoder_ctl(enc, OPUS_SET_BITRATE(27000));
+ {
+ static const short pcm[960] = { 0 };
+ data_len = opus_encode(enc, pcm, 960, data, 2000);
+ assert(data_len > 0);
+ }
+ opus_encoder_ctl(enc, OPUS_SET_SIGNAL(OPUS_SIGNAL_MUSIC));
+ {
+ static const short pcm[480] =
+ {
+ 32767, 32767, 0, 0, 32767, 32767, 0, 0, 32767, 32767,
+ -32768, -32768, 0, 0, -32768, -32768, 0, 0, -32768, -32768
+ };
+ data_len = opus_encode(enc, pcm, 480, data, 19);
+ assert(data_len > 0);
+ }
+ opus_encoder_destroy(enc);
+ return 0;
+}
+
void regression_test(void)
{
fprintf(stderr, "Running simple tests for bugs that have been fixed previously\n");
@@ -959,4 +991,5 @@ void regression_test(void)
mscbr_encode_fail();
surround_analysis_uninit();
ec_enc_shrink_assert();
+ ec_enc_shrink_assert2();
}