ref: 6f9cb7aac39a2d1b363355cdc58445bdad2618c7
parent: 734aed05d09af3d2690f8cb5aafa97f052746daf
author: Jean-Marc Valin <jeanmarcv@google.com>
date: Fri Jan 24 05:38:36 EST 2025
C90 fixes: Removing declarations after statement
--- a/silk/x86/NSQ_del_dec_avx2.c
+++ b/silk/x86/NSQ_del_dec_avx2.c
@@ -106,6 +106,7 @@
static OPUS_INLINE opus_int64 silk_sar_round_smulww(opus_int32 a, opus_int32 b, int bits)
{
+ opus_int64 t;
silk_assert(bits > 0 && bits < 63);
#ifdef OPUS_CHECK_ASM
return silk_RSHIFT_ROUND(silk_SMULWW(a, b), bits);
@@ -112,7 +113,7 @@
#else
/* This code is more correct, but it won't overflow like the C code in some rare cases. */
silk_assert(bits > 0 && bits < 63);
- opus_int64 t = ((opus_int64)a) * ((opus_int64)b);
+ t = ((opus_int64)a) * ((opus_int64)b);
bits += 16;
t += 1ull << (bits-1);
return t >> bits;
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -1562,6 +1562,7 @@
unsigned char *curr_data;
int tmp_len;
int dtx_count = 0;
+ int bak_to_mono;
if (st->mode == MODE_SILK_ONLY)
{
@@ -1606,7 +1607,7 @@
opus_repacketizer_init(rp);
- int bak_to_mono = st->silk_mode.toMono;
+ bak_to_mono = st->silk_mode.toMono;
if (bak_to_mono)
st->force_channels = 1;
else
--- a/src/repacketizer.c
+++ b/src/repacketizer.c
@@ -158,10 +158,10 @@
/* incorporate any extensions from the repacketizer padding */
for (i=begin;i<end;i++)
{
- int j;
+ int j, ret;
opus_int32 frame_ext_count;
frame_ext_count = total_ext_count - ext_count;
- int ret = opus_packet_extensions_parse(rp->paddings[i], rp->padding_len[i],
+ ret = opus_packet_extensions_parse(rp->paddings[i], rp->padding_len[i],
&all_extensions[ext_count], &frame_ext_count, rp->padding_nb_frames[i]);
if (ret<0)
{
--
⑨