Commit Graph

15 Commits

Author SHA1 Message Date
Mans Rullgard 8b0de73464 g723.1: deobfuscate "(x << 4) - x" to "15 * x"
The compiler performs this optimisation.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 01:03:25 +01:00
Mans Rullgard 05c36e0e5f g723.1: fix addition overflow
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>
2012-08-10 12:18:38 +01:00
Mans Rullgard 52aa3015a3 g723.1: simplify and fix multiplication overflow
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>
2012-08-10 12:18:38 +01:00
Mans Rullgard e141cf2c57 g723.1: deobfuscate an expression
(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>
2012-08-10 12:18:38 +01:00
Mans Rullgard e2b7c5783d g723.1: remove unused #includes
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-10 12:18:38 +01:00
Kostya Shishkov e78e6c37ef g723_1: clip argument for 15-bit version of normalize_bits()
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.
2012-08-08 13:24:19 +02:00
Kostya Shishkov f86b2f3661 g723_1: use all LPC vectors in formant postfilter
Due to some mistake LPC vector for the first subframe was used for all
subframes instead of their own LPC vectors.
2012-08-08 13:23:22 +02:00
Anton Khirnov 36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Kostya Shishkov d3e0766fc0 g723_1: scale output as supposed for the case with postfilter disabled 2012-08-03 07:07:07 +02:00
Kostya Shishkov 94bfdfd6f0 g723_1: increase excitation storage by 4
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.
2012-08-03 07:07:07 +02:00
Kostya Shishkov 802bcdcb2f g723_1: fix upper bound parameter from inverse maximum autocorrelation 2012-08-03 07:07:07 +02:00
Kostya Shishkov 8ddadea171 g723_1: make scale_vector() behave like the reference 2012-08-03 07:07:07 +02:00
Kostya Shishkov 8772d2511a g723_1: fix off-by-one error in normalize_bits() 2012-08-03 07:07:07 +02:00
Kostya Shishkov 7f92db14f9 g723_1: save/restore excitation with offset to store LPC history
The same buffer with saved data is used later in LPC reconstruction, so
it should have some head space for LPC history.
2012-08-03 07:07:06 +02:00
Mohamed Naufal Basheer 55c3a4f617 G.723.1 demuxer and decoder
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-07-22 07:58:54 +02:00