summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2018-05-24 13:15:39 -0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2018-05-24 13:15:39 -0400
commit287cb030ab8a59dcecbb7ab8ea689f6dd5eb38b8 (patch)
tree54342924de3d64f139224985e0249134e0bb0b42
parented7283089cd1b6e8e3913bcfa310647a7797c288 (diff)
downloadopus-exp_bandwidth_fix4.tar.gz
Switch from narrowband to wideband at 9 kb/s, don't use mediumbandexp_bandwidth_fix4
-rw-r--r--src/opus_encoder.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/opus_encoder.c b/src/opus_encoder.c
index 47b586a1..bdbedec5 100644
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -123,26 +123,26 @@ struct OpusEncoder {
middle (memoriless) threshold. The second column is the hysteresis
(difference with the middle) */
static const opus_int32 mono_voice_bandwidth_thresholds[8] = {
- 10000, 1000, /* NB<->MB */
- 11000, 1000, /* MB<->WB */
+ 9000, 700, /* NB<->MB */
+ 9000, 700, /* MB<->WB */
13500, 1000, /* WB<->SWB */
14000, 2000, /* SWB<->FB */
};
static const opus_int32 mono_music_bandwidth_thresholds[8] = {
- 9000, 1000, /* NB<->MB */
- 10000, 1000, /* MB<->WB */
+ 9000, 700, /* NB<->MB */
+ 9000, 700, /* MB<->WB */
11000, 1000, /* WB<->SWB */
12000, 2000, /* SWB<->FB */
};
static const opus_int32 stereo_voice_bandwidth_thresholds[8] = {
- 10000, 1000, /* NB<->MB */
- 11000, 1000, /* MB<->WB */
+ 9000, 700, /* NB<->MB */
+ 9000, 700, /* MB<->WB */
13500, 1000, /* WB<->SWB */
14000, 2000, /* SWB<->FB */
};
static const opus_int32 stereo_music_bandwidth_thresholds[8] = {
- 9000, 1000, /* NB<->MB */
- 10000, 1000, /* MB<->WB */
+ 9000, 700, /* NB<->MB */
+ 9000, 700, /* MB<->WB */
11000, 1000, /* WB<->SWB */
12000, 2000, /* SWB<->FB */
};
@@ -1487,6 +1487,10 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
if (equiv_rate >= threshold)
break;
} while (--bandwidth>OPUS_BANDWIDTH_NARROWBAND);
+ /* We don't use mediumband anymore, except when explicitly requested or during
+ mode transitions. */
+ if (bandwidth == OPUS_BANDWIDTH_MEDIUMBAND)
+ bandwidth = OPUS_BANDWIDTH_WIDEBAND;
st->bandwidth = st->auto_bandwidth = bandwidth;
/* Prevents any transition to SWB/FB until the SILK layer has fully
switched to WB mode and turned the variable LP filter off */