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:
authorTimothy B. Terriberry <tterribe@xiph.org>2011-10-15 00:38:24 +0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2011-10-18 00:03:41 +0400
commit53cc1a033a3183c9d137b03446db58d2e58c0e0a (patch)
tree24476c962dbb081126c89d6f26dd9d02f7bf88e7 /silk/decode_parameters.c
parent7ef6c7c1b465df4ef3b4ece2ecbf9d35c625beb4 (diff)
Fix the side frame conditional coding rules.
b24e5746 introduced changes to LastGainIndex which broke conditional coding for side frames after a mid-only frame (i.e., in a 60 ms frame where the side is coded, not coded, then coded again). These rules were a mess in general, however, because the side channel state kept a different nFramesDecoded count from the mid channel state, and had no way to tell if the prior side frame was coded. This patch attempts to rationalize them by moving the conditional coding decision up to the top level, where all this information is available. The first coded side frame after an uncoded side frame now always uses independent coding. If such a frame is also not the first side frame in an Opus frame, then it doesn't include an LTP scaling parameter (because the LTP state is well-defined).
Diffstat (limited to 'silk/decode_parameters.c')
-rw-r--r--silk/decode_parameters.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/silk/decode_parameters.c b/silk/decode_parameters.c
index ad4788f9..1ab8ed74 100644
--- a/silk/decode_parameters.c
+++ b/silk/decode_parameters.c
@@ -34,7 +34,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* Decode parameters from payload */
void silk_decode_parameters(
silk_decoder_state *psDec, /* I/O State */
- silk_decoder_control *psDecCtrl /* I/O Decoder control */
+ silk_decoder_control *psDecCtrl, /* I/O Decoder control */
+ opus_int condCoding /* I The type of conditional coding to use */
)
{
opus_int i, k, Ix;
@@ -43,7 +44,7 @@ void silk_decode_parameters(
/* Dequant Gains */
silk_gains_dequant( psDecCtrl->Gains_Q16, psDec->indices.GainsIndices,
- &psDec->LastGainIndex, psDec->nFramesDecoded, psDec->nb_subfr );
+ &psDec->LastGainIndex, condCoding == CODE_CONDITIONALLY, psDec->nb_subfr );
/****************/
/* Decode NLSFs */