From 62b88c3b28abd2896adef63382fe1c19bd42e0e7 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Thu, 3 Feb 2011 11:34:43 -0500 Subject: [PATCH] Some more hybrid tuning (mostly for CBR) --- src/opus_encoder.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/opus_encoder.c b/src/opus_encoder.c index 28317b99..fafb5191 100644 --- a/src/opus_encoder.c +++ b/src/opus_encoder.c @@ -113,18 +113,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 + 14000 ) * 2 ) / 3; + st->silk_mode.bitRate = ( ( st->silk_mode.bitRate + 14000 - ( 1 - st->use_vbr ) * 10000 ) * 2 ) / 3; } else { /* 24 kHz, 20 ms */ - st->silk_mode.bitRate = ( ( st->silk_mode.bitRate + 10000 ) * 2 ) / 3; + st->silk_mode.bitRate = ( ( st->silk_mode.bitRate + 12000 - ( 1 - st->use_vbr ) * 10000 ) * 2 ) / 3; } } else { if( st->Fs == 100 * frame_size ) { /* 48 kHz, 10 ms */ - st->silk_mode.bitRate = ( st->silk_mode.bitRate + 18000 ) / 2; + st->silk_mode.bitRate = ( st->silk_mode.bitRate + 16000 - ( 1 - st->use_vbr ) * 8000 ) / 2; } else { /* 48 kHz, 20 ms */ - st->silk_mode.bitRate = ( st->silk_mode.bitRate + 16000 ) / 2; + st->silk_mode.bitRate = ( st->silk_mode.bitRate + 14000 - ( 1 - st->use_vbr ) * 5000 ) / 2; } } }