summaryrefslogtreecommitdiff
path: root/libavcodec/g723_1.c
Commit message (Collapse)AuthorAge
* lavc: G.723.1 encoderMohamed Naufal2015-11-30
| | | | | | Additional improvements by Michael Niedermayer <michaelni@gmx.at>. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* g723_1: Move sharable functions to a separate fileVittorio Giovara2015-11-30
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* g723_1: Rename files to better reflect their purposeVittorio Giovara2015-11-30
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* g723_1: Handle values at the ends of the table in lsp2lpc()Michael Niedermayer2015-11-30
| | | | | | | | Fixes out of array reads. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* lavc: AV-prefix all codec capabilitiesVittorio Giovara2015-07-27
| | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* avcodec: Don't anonymously typedef structsDiego Biurrun2015-02-14
|
* cosmetics: Group .name and .long_name together in codec/format declarationsDiego Biurrun2013-10-03
|
* lavc decoders: work with refcounted frames.Anton Khirnov2013-03-08
|
* g723.1: decode directly to the user-provided AVFrameJustin Ruggles2013-02-12
|
* lavc: add a wrapper for AVCodecContext.get_buffer().Anton Khirnov2012-12-04
| | | | It will be useful in the upcoming transition to refcounted AVFrames.
* Include libavutil/channel_layout.h instead of libavutil/audioconvert.hJustin Ruggles2012-11-11
| | | | Also reorder some other #include when applicable.
* avutil: Move memcpy_backptr() to mem.cDiego Biurrun2012-10-25
| | | | The function is used elsewhere and does not belong with the LZO code.
* g.723.1: add missing CODEC_CAP_DR1Anton Khirnov2012-10-24
|
* avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union memberMartin Storsjö2012-09-04
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* g723_1: add comfort noise generationKostya Shishkov2012-08-30
|
* g723.1: simplify scale_vector()Mans Rullgard2012-08-14
| | | | | | | It is impossible for bits to be 15 here so the special case is not needed. Signed-off-by: Mans Rullgard <mans@mansr.com>
* g723.1: simplify normalize_bits()Mans Rullgard2012-08-14
| | | | | | | | | This function is always called with a non-negative argument, so those special cases are not needed. In the places the argument might be zero, the return value for a zero argument does not matter since it would then be used to scale an array full of zeros. Signed-off-by: Mans Rullgard <mans@mansr.com>
* g723.1: do not pass large structs by valueMans Rullgard2012-08-13
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* g723.1: do not bounce intermediate values via memoryMans Rullgard2012-08-13
| | | | | | | | | Although a reasonable compiler will probably optimise out the actual store and load, this operation still implies a truncation to 16 bits which the compiler will probably not realise is not necessary here. Signed-off-by: Mans Rullgard <mans@mansr.com>
* g723.1: declare a variable in the block it is usedMans Rullgard2012-08-13
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* g723.1: avoid saving/restoring excitationMans Rullgard2012-08-13
| | | | | | | | Writing the scaled excitation to a scratch buffer (borrowing the 'audio' array) instead of modifying it in place avoids the need to save and restore the unscaled values. Signed-off-by: Mans Rullgard <mans@mansr.com>
* g723.1: avoid unnecessary memcpy() in residual_interp()Mans Rullgard2012-08-13
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* g723.1: make postfilter write directly to output bufferMans Rullgard2012-08-13
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* g723.1: drop unnecessary variable buf_ptr in formant_postfilter()Mans Rullgard2012-08-13
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* g723.1: make scale_vector() output to a separate bufferMans Rullgard2012-08-13
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* g723.1: make autocorr_max() work on an arbitrary bufferMans Rullgard2012-08-13
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* g723.1: do not needlessly use int64_tMans Rullgard2012-08-13
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* g723.1: use saturating addition functionsMans Rullgard2012-08-13
| | | | | | | | Use saturating addition functions instead of 64-bit intermediates and separate clipping. This is much faster when dedicated instructions are available. Signed-off-by: Mans Rullgard <mans@mansr.com>
* g723.1: optimise scale_vector()Mans Rullgard2012-08-13
| | | | | | | | | | | | | | Firstly, nothing in this function can overflow 32 bits so the use of a 64-bit type is completely unnecessary. Secondly, the scale is either a power of two or 0x7fff. Doing separate loops for these cases avoids using multiplications. Finally, since only the number of bits, not the actual value, of the maximum value is needed, the bitwise or of all the values serves the purpose while being faster. It is worth noting that even if overflow could happen, it was not handled correctly anyway. Signed-off-by: Mans Rullgard <mans@mansr.com>
* g723.1: remove useless uses of MUL64()Mans Rullgard2012-08-13
| | | | | | | | 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>
* g723.1: remove unnecessary argument 'shift' from dot_product()Mans Rullgard2012-08-13
| | | | | | | 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>
* g723.1: deobfuscate "(x << 4) - x" to "15 * x"Mans Rullgard2012-08-13
| | | | | | The compiler performs this optimisation. Signed-off-by: Mans Rullgard <mans@mansr.com>
* g723.1: fix addition overflowMans Rullgard2012-08-10
| | | | | | | 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>
* g723.1: simplify and fix multiplication overflowMans Rullgard2012-08-10
| | | | | | | | | | 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>
* g723.1: deobfuscate an expressionMans Rullgard2012-08-10
| | | | | | | (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>
* g723.1: remove unused #includesMans Rullgard2012-08-10
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* g723_1: clip argument for 15-bit version of normalize_bits()Kostya Shishkov2012-08-08
| | | | | | 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.
* g723_1: use all LPC vectors in formant postfilterKostya Shishkov2012-08-08
| | | | | Due to some mistake LPC vector for the first subframe was used for all subframes instead of their own LPC vectors.
* Replace all CODEC_ID_* with AV_CODEC_ID_*Anton Khirnov2012-08-07
|
* g723_1: scale output as supposed for the case with postfilter disabledKostya Shishkov2012-08-03
|
* g723_1: increase excitation storage by 4Kostya Shishkov2012-08-03
| | | | | | 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.
* g723_1: fix upper bound parameter from inverse maximum autocorrelationKostya Shishkov2012-08-03
|
* g723_1: make scale_vector() behave like the referenceKostya Shishkov2012-08-03
|
* g723_1: fix off-by-one error in normalize_bits()Kostya Shishkov2012-08-03
|
* g723_1: save/restore excitation with offset to store LPC historyKostya Shishkov2012-08-03
| | | | | The same buffer with saved data is used later in LPC reconstruction, so it should have some head space for LPC history.
* G.723.1 demuxer and decoderMohamed Naufal Basheer2012-07-22
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>