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:
authorKoen Vos <koen.vos@skype.net>2011-02-04 08:49:48 +0300
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>2011-02-04 08:49:48 +0300
commit5ad41a36d37b43281cba14070cf88e5599057ffb (patch)
treef587e198141d5d88d7204ba746052b551b974c67
parent2c8b29806b96058d756340d9664e14848edbcfb8 (diff)
Tuning the hybrid bit-rate split
m---------celt29
-rw-r--r--src/opus_encoder.c10
2 files changed, 10 insertions, 29 deletions
diff --git a/celt b/celt
-Subproject a093f4df740b7680443e938775b4db2b0fa2484
+Subproject 4305ab6bfbd23dcf83ca40af67ef7542fa63f71
diff --git a/src/opus_encoder.c b/src/opus_encoder.c
index 2fe0f5dd..c911e7b5 100644
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -111,18 +111,18 @@ int opus_encode(OpusEncoder *st, const short *pcm, int frame_size,
if( st->bandwidth == BANDWIDTH_SUPERWIDEBAND ) {
if( st->Fs == 100 * frame_size ) {
/* 24 kHz, 10 ms */
- st->silk_mode.bitRate = ( ( st->silk_mode.bitRate + 12000 - ( 1 - st->use_vbr ) * 10000 ) * 2 ) / 3;
+ st->silk_mode.bitRate = ( ( st->silk_mode.bitRate + 2000 + st->use_vbr * 1000 ) * 2 ) / 3;
} else {
/* 24 kHz, 20 ms */
- st->silk_mode.bitRate = ( ( st->silk_mode.bitRate + 8000 - ( 1 - st->use_vbr ) * 7000 ) * 2 ) / 3;
+ st->silk_mode.bitRate = ( ( st->silk_mode.bitRate + 1000 + st->use_vbr * 1000 ) * 2 ) / 3;
}
} else {
if( st->Fs == 100 * frame_size ) {
/* 48 kHz, 10 ms */
- st->silk_mode.bitRate = ( st->silk_mode.bitRate + 16000 - ( 1 - st->use_vbr ) * 8000 ) / 2;
+ st->silk_mode.bitRate = ( st->silk_mode.bitRate + 8000 + st->use_vbr * 3000 ) / 2;
} else {
/* 48 kHz, 20 ms */
- st->silk_mode.bitRate = ( st->silk_mode.bitRate + 14000 - ( 1 - st->use_vbr ) * 5000 ) / 2;
+ st->silk_mode.bitRate = ( st->silk_mode.bitRate + 9000 + st->use_vbr * 1000 ) / 2;
}
}
}
@@ -194,7 +194,7 @@ int opus_encode(OpusEncoder *st, const short *pcm, int frame_size,
len = (ec_tell(&enc)+7)>>3;
if( st->use_vbr ) {
- nb_compr_bytes = len + (st->bitrate_bps - 12000) * frame_size / (2 * 8 * st->Fs);
+ nb_compr_bytes = len + bytes_target - (st->silk_mode.bitRate * frame_size) / (8 * st->Fs);
} else {
/* check if SILK used up too much */
nb_compr_bytes = len > bytes_target ? len : bytes_target;