Mans Rullgard
1eb1f6f281
g723.1: remove useless uses of MUL64()
...
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>
13 years ago
Mans Rullgard
5a43eba956
g723.1: remove unnecessary argument 'shift' from dot_product()
...
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>
13 years ago
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>
13 years ago
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>
13 years ago
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>
13 years ago
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>
13 years ago
Mans Rullgard
e2b7c5783d
g723.1: remove unused #includes
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
13 years ago
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.
13 years ago
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.
13 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
13 years ago
Michael Niedermayer
70bcdfb39f
g732_1: reduce difference to qatar
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Kostya Shishkov
d3e0766fc0
g723_1: scale output as supposed for the case with postfilter disabled
13 years ago
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.
13 years ago
Kostya Shishkov
802bcdcb2f
g723_1: fix upper bound parameter from inverse maximum autocorrelation
13 years ago
Kostya Shishkov
8ddadea171
g723_1: make scale_vector() behave like the reference
13 years ago
Kostya Shishkov
8772d2511a
g723_1: fix off-by-one error in normalize_bits()
13 years ago
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.
13 years ago
Michael Niedermayer
62514ca012
g723.1dec: Make postfilter user switchable
...
Code from qatar (55c3a4f617
)
Author of the code was probably Mohamed or Kostya
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
1eb1392690
g723.1: various cosmetics and changes that should have no user vissible effect.
...
code from qatar (55c3a4f617
)
Author of the code was probably Mohamed or Kostya
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Mohamed Naufal Basheer
55c3a4f617
G.723.1 demuxer and decoder
...
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
13 years ago
Paul B Mahol
60351ec13c
g723_1: add CODEC_CAP_DR1
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 years ago
Michael Niedermayer
1ebf6f941e
g723_1: change to encode2()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
a407baba85
g723_1: Fix "libavcodec/g723_1.c:988:8: warning: assignment from incompatible pointer type [enabled by default]"
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Paul B Mahol
69d766daa0
lavc: replace rest of deprecated SAMPLE_FMT_* with AV_SAMPLE_FMT_*
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
eac5987c4f
g723_1dec: update to new API
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
5174032953
g723.1: use memmove() where overlapping src and dst can happen.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Mohamed Naufal
ef64c45c94
g723.1 encoder
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Reimar Döffinger
812010c17e
Remove unused variable.
...
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
13 years ago
Michael Niedermayer
04b4353f07
g723.1: very minor simplify of gen_acb_excitation()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
631eee6e90
g723.1: use MULL(a,b,15) for MULL2()
...
idea by vitor
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
cb58adaaa3
g723.1: simplify scale_vector()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
431f8af824
g723.1: replace loop of normalize_bits( by av_log2()
...
idea by vitor
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Vitor Sessak
6e505547f1
g723.1: cleanup square_root()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
c02c52f7b2
g723.1_ use skip_bits1()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
fac3ac3970
g723.1: use get_bits1()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
11512367d3
celp_math: cleanup ff_dot_product()
...
based on code & idea by vitor
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Mohamed Naufal Basheer
f990dc374e
Add the G723.1 demuxer and decoder
13 years ago