diff --git a/lpcnet b/lpcnet index 3ac930e9b78edbf350f5efadb486a6214b5f189f..2f719a503d284fb4f05d097d95a85c496473f5a1 160000 --- a/lpcnet +++ b/lpcnet @@ -1 +1 @@ -Subproject commit 3ac930e9b78edbf350f5efadb486a6214b5f189f +Subproject commit 2f719a503d284fb4f05d097d95a85c496473f5a1 diff --git a/silk/dred_coding.c b/silk/dred_coding.c index 56d8961f7419ed2b6b397f19795e559b6e93d5ae..687eb0559af4cf390cdec142face9bb16b2a58b6 100644 --- a/silk/dred_coding.c +++ b/silk/dred_coding.c @@ -121,7 +121,7 @@ void dred_decode_state(ec_enc *dec, float *x) { { norm += (float) iy[k] * iy[k]; } - norm = 1 / sqrtf(norm); + norm = 1.f / sqrtf(norm); for (k = 0; k < PVQ_DIM; k++) { x[k] = iy[k] * norm; diff --git a/silk/dred_decoder.c b/silk/dred_decoder.c index d010f91ac6ee1f9e4c521d8d60baa46fb2d7774b..c25f44cf172e2c7658bea46d4f10dec74b8236a1 100644 --- a/silk/dred_decoder.c +++ b/silk/dred_decoder.c @@ -63,7 +63,7 @@ int dred_ec_decode(OpusDRED *dec, const opus_uint8 *bytes, int num_bytes, int mi /* FIXME: Figure out how to avoid missing a last frame that would take up < 8 bits. */ if (8*num_bytes - ec_tell(&ec) <= 7) break; - q_level = (int) round(DRED_ENC_Q0 + 1.f * (DRED_ENC_Q1 - DRED_ENC_Q0) * i / (DRED_NUM_REDUNDANCY_FRAMES - 2)); + q_level = (int) floor(.5 + DRED_ENC_Q0 + 1.f * (DRED_ENC_Q1 - DRED_ENC_Q0) * i / (DRED_NUM_REDUNDANCY_FRAMES - 2)); offset = q_level * DRED_LATENT_DIM; dred_decode_latents( &ec, diff --git a/src/opus_decoder.c b/src/opus_decoder.c index 7e1f2d3221e5dd6885369cae748f8b788af9ceac..4346130f2ca10335e7706c5ff87029bb05c03d6c 100644 --- a/src/opus_decoder.c +++ b/src/opus_decoder.c @@ -1157,12 +1157,12 @@ static int dred_find_payload(const unsigned char *data, opus_int32 len, const un { const unsigned char *data0; int len0; - *payload = NULL; int frame = 0; int ret; const unsigned char *frames[48]; opus_int16 size[48]; + *payload = NULL; /* Get the padding section of the packet. */ ret = opus_packet_parse_impl(data, len, 0, NULL, frames, size, NULL, NULL, &data0, &len0); if (ret < 0)