t = p->sid_gain << shift;
else
t = p->sid_gain >> -shift;
- x = t * cng_filt[0] >> 16;
+ x = av_clipl_int32(t * (int64_t)cng_filt[0] >> 16);
if (x >= cng_bseg[2])
return 0x3F;
off[i * 2 + 1] = ((t >> 1) & 1) + SUBFRAME_LEN;
t >>= 2;
for (j = 0; j < 11; j++) {
- signs[i * 11 + j] = (t & 1) * 2 - 1 << 14;
+ signs[i * 11 + j] = ((t & 1) * 2 - 1) * (1 << 14);
t >>= 1;
}
}
sum = 0;
if (shift < 0) {
for (j = 0; j < SUBFRAME_LEN * 2; j++) {
- t = vector_ptr[j] << -shift;
+ t = vector_ptr[j] * (1 << -shift);
sum += t * t;
tmp[j] = t;
}
if (shift < 0)
x >>= -shift;
else
- x <<= shift;
+ x *= 1 << shift;
x = av_clip(x, -10000, 10000);
for (j = 0; j < 11; j++) {