ref: d76bc917e5ccd281e1fdc893a765bc44944fbcf5
parent: 5f089d224d599613dd19294e3919f4bb1ba72246
author: Jean-Marc Valin <[email protected]>
date: Tue Sep 6 21:37:58 EDT 2011
Prevents the SILK encoder from failing below 600 kb/s stereo. Not that it actually reaches the target, but it should no longer cause a range coder mismatch
--- a/silk/silk_stereo_LR_to_MS.c
+++ b/silk/silk_stereo_LR_to_MS.c
@@ -96,6 +96,8 @@
/* Determine bitrate distribution between mid and side, and possibly reduce stereo width */
total_rate_bps -= is10msFrame ? 1200 : 600; /* Subtract approximate bitrate for coding stereo parameters */
+ if (total_rate_bps < 1)
+ total_rate_bps = 1;
min_mid_rate_bps = SKP_SMLABB( 2000, fs_kHz, 900 );
SKP_assert( min_mid_rate_bps < 32767 );
/* Default bitrate distribution: 8 parts for Mid and (5+3*frac) parts for Side. so: mid_rate = ( 8 / ( 13 + 3 * frac ) ) * total_ rate */