| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
| |
The operands in both cases are 16-bit so cannot overflow a 32-bit
destination. In gain_scale() the inputs are reduced to 14-bit,
so even the shift cannot overflow.
Signed-off-by: Mans Rullgard <mans@mansr.com>
|
|
|
|
|
|
|
| |
The 'shift' argument is always 1 so there is no need to pass it
explicitly in every call.
Signed-off-by: Mans Rullgard <mans@mansr.com>
|
|
|
|
|
|
| |
The compiler performs this optimisation.
Signed-off-by: Mans Rullgard <mans@mansr.com>
|
|
|
|
|
|
|
| |
This addition must be done as 64-bit to avoid overflow and for
the subsequent clipping to be meaningful.
Signed-off-by: Mans Rullgard <mans@mansr.com>
|
|
|
|
|
|
|
|
|
|
| |
In 16-bit arithmetic, x * 0xffffc is simply x * -4 with extra overflows,
(and the constant was probably meant to be 0xfffc). Combined with the
shift, this simplifies to -x >> 1. Finally, clearing the low two bits
with a 32-bit mask and switching to a 32-bit type allows more efficient
code on 32-bit machines.
Signed-off-by: Mans Rullgard <mans@mansr.com>
|
|
|
|
|
|
|
| |
(x << 2) - x is just an optimisation of 3 * x the compiler is
perfectly capable of doing on its own.
Signed-off-by: Mans Rullgard <mans@mansr.com>
|
|
|
|
| |
Signed-off-by: Mans Rullgard <mans@mansr.com>
|
|
|
|
|
|
| |
It expects maximum value to be 32767 but calculations in scale_vector()
which uses this function can give it ABS(-32768) which leads to wrong
result and thus clipping is needed.
|
|
|
|
|
| |
Due to some mistake LPC vector for the first subframe was used for all
subframes instead of their own LPC vectors.
|
| |
|
| |
|
|
|
|
|
|
| |
Fixed codebook mode in 5300 rate may write up to SUBFRAME_LEN + 4 and
that is considered normal by the reference decoder. Without that additional
padding it might overwrite first elements of LPC history.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The same buffer with saved data is used later in LPC reconstruction, so
it should have some head space for LPC history.
|
|
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
|