diff options
author | Timothy B. Terriberry <tterribe@xiph.org> | 2011-10-14 13:38:24 -0700 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2011-10-17 16:03:41 -0400 |
commit | 53cc1a033a3183c9d137b03446db58d2e58c0e0a (patch) | |
tree | 24476c962dbb081126c89d6f26dd9d02f7bf88e7 /silk/main.h | |
parent | 7ef6c7c1b465df4ef3b4ece2ecbf9d35c625beb4 (diff) | |
download | opus-53cc1a033a3183c9d137b03446db58d2e58c0e0a.tar.gz |
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/main.h')
-rw-r--r-- | silk/main.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/silk/main.h b/silk/main.h index 85423ab6..1f2f01a7 100644 --- a/silk/main.h +++ b/silk/main.h @@ -377,7 +377,8 @@ opus_int silk_decode_frame( ec_dec *psRangeDec, /* I/O Compressor data structure */ opus_int16 pOut[], /* O Pointer to output speech frame */ opus_int32 *pN, /* O Pointer to size of output frame */ - opus_int lostFlag /* I 0: no loss, 1 loss, 2 decode fec */ + opus_int lostFlag, /* I 0: no loss, 1 loss, 2 decode fec */ + opus_int condCoding /* I The type of conditional coding to use */ ); /* Decode LBRR side info and excitation */ @@ -391,13 +392,15 @@ void silk_decode_indices( silk_decoder_state *psDec, /* I/O State */ ec_dec *psRangeDec, /* I/O Compressor data structure */ opus_int FrameIndex, /* I Frame number */ - opus_int decode_LBRR /* I Flag indicating LBRR data is being decoded */ + opus_int decode_LBRR, /* I Flag indicating LBRR data is being decoded */ + opus_int condCoding /* I The type of conditional coding to use */ ); /* 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 */ ); /* Core decoder. Performs inverse NSQ operation LTP + LPC */ @@ -439,7 +442,8 @@ void silk_encode_indices( silk_encoder_state *psEncC, /* I/O Encoder state */ ec_enc *psRangeEnc, /* I/O Compressor data structure */ opus_int FrameIndex, /* I Frame number */ - opus_int encode_LBRR /* I Flag indicating LBRR data is being encoded */ + opus_int encode_LBRR, /* I Flag indicating LBRR data is being encoded */ + opus_int condCoding /* I The type of conditional coding to use */ ); #endif |