Eliminate redundant redundancy code.

The redundancy_bytes<0 test always fails because of the ec_tell(&dec)+29 test above.
This commit is contained in:
Gregory Maxwell 2011-10-03 13:07:17 -04:00
parent 9c93763121
commit 4cc9a459e8

View file

@ -322,17 +322,8 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
if (redundancy) if (redundancy)
{ {
celt_to_silk = ec_dec_bit_logp(&dec, 1); celt_to_silk = ec_dec_bit_logp(&dec, 1);
if (mode == MODE_HYBRID) /*Due to the ec_tell check above redundancy_bytes will be at least two for hybrid*/
redundancy_bytes = 2 + ec_dec_uint(&dec, 256); redundancy_bytes = mode==MODE_HYBRID ? ec_dec_uint(&dec, 256)+2 : len-((ec_tell(&dec)+7)>>3);
else {
redundancy_bytes = len - ((ec_tell(&dec)+7)>>3);
/* Can only happen on an invalid packet */
if (redundancy_bytes<0)
{
redundancy_bytes = 0;
redundancy = 0;
}
}
len -= redundancy_bytes; len -= redundancy_bytes;
if (len<0) if (len<0)
{ {