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:
authorKarsten Vandborg Sorensen <karsten.vandborg.sorensen@skype.net>2011-02-03 17:36:59 +0300
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>2011-02-03 17:36:59 +0300
commit7805475b7b4b92907e46939906385373df7213ef (patch)
treec865639dc395dc46fc72fa24cc58d185818da5f9
parent8f67b20a8fe3bc3299b02c00fb3b88d7034ff63b (diff)
Hybrid mode tuning
m---------celt12
-rw-r--r--src/opus_encoder.c23
2 files changed, 23 insertions, 12 deletions
diff --git a/celt b/celt
-Subproject 9a7540b673ccd96dbfb0ee3f8ce41efd76a88d3
+Subproject ff4116ccb5e771c84c8963c954a595407a95391
diff --git a/src/opus_encoder.c b/src/opus_encoder.c
index a6fda2ec..28317b99 100644
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -107,13 +107,26 @@ int opus_encode(OpusEncoder *st, const short *pcm, int frame_size,
ec_enc_init(&enc,&buf);
/* SILK processing */
- if (st->mode != MODE_CELT_ONLY)
- {
+ if (st->mode != MODE_CELT_ONLY) {
st->silk_mode.bitRate = st->bitrate_bps - 8*st->Fs/frame_size;
if( st->mode == MODE_HYBRID ) {
- /* FIXME: Tune this offset */
- st->silk_mode.bitRate = (st->silk_mode.bitRate + 12000) / 2;
- /* FIXME: Adjust for 10 ms frames */
+ if( st->bandwidth == BANDWIDTH_SUPERWIDEBAND ) {
+ if( st->Fs == 100 * frame_size ) {
+ /* 24 kHz, 10 ms */
+ st->silk_mode.bitRate = ( ( st->silk_mode.bitRate + 14000 ) * 2 ) / 3;
+ } else {
+ /* 24 kHz, 20 ms */
+ st->silk_mode.bitRate = ( ( st->silk_mode.bitRate + 10000 ) * 2 ) / 3;
+ }
+ } else {
+ if( st->Fs == 100 * frame_size ) {
+ /* 48 kHz, 10 ms */
+ st->silk_mode.bitRate = ( st->silk_mode.bitRate + 18000 ) / 2;
+ } else {
+ /* 48 kHz, 20 ms */
+ st->silk_mode.bitRate = ( st->silk_mode.bitRate + 16000 ) / 2;
+ }
+ }
}
st->silk_mode.payloadSize_ms = 1000 * frame_size / st->Fs;