shithub: opus

Download patch

ref: 6e5f6d048a6369f014baab946a895af73d6cc342
parent: d5c9263724287664bf8631ecaa89a7ae23cc3f6d
author: Jean-Marc Valin <[email protected]>
date: Fri Oct 7 14:08:41 EDT 2011

Prevents a SILK stereo encoding-side desync

We now make sure that side is given >0 bits when it isn't disabled.

--- a/silk/stereo_LR_to_MS.c
+++ b/silk/stereo_LR_to_MS.c
@@ -168,6 +168,11 @@
         width_Q14 = state->smth_width_Q14;
     }
 
+    if (*mid_only_flag == 0 && mid_side_rates_bps[ 1 ] < 1)
+    {
+        mid_side_rates_bps[ 1 ] = 1;
+        mid_side_rates_bps[ 0 ] = silk_max_int( 1, total_rate_bps - mid_side_rates_bps[ 1 ]);
+    }
 #if 0
     DEBUG_STORE_DATA( midside.dat, &mid_side_rates_bps[ 0 ], 8 );
     DEBUG_STORE_DATA( norms0.pcm, &state->mid_side_amp_Q0[0], 8 );