summaryrefslogtreecommitdiff
path: root/libavcodec/celp_filters.c
Commit message (Collapse)AuthorAgeFilesLines
* all: Replace if (ARCH_FOO) checks by #if ARCH_FOOAndreas Rheinhardt2022-06-151-2/+3
| | | | | | | | | | | | | | | | | | This is more spec-compliant because it does not rely on dead-code elimination by the compiler. Especially MSVC has problems with this, as can be seen in https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/296373.html or https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/297022.html This commit does not eliminate every instance where we rely on dead code elimination: It only tackles branching to the initialization of arch-specific dsp code, not e.g. all uses of CONFIG_ and HAVE_ checks. But maybe it is already enough to compile FFmpeg with MSVC with whole-programm-optimizations enabled (if one does not disable too many components). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Remove/replace some unnecessary avcodec.h inclusionsAndreas Rheinhardt2021-07-221-2/+3
| | | | | | | Also remove other unnecessary headers and include headers directly while at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/celp_filters: Avoid invalid negation in ff_celp_lp_synthesis_filter()Michael Niedermayer2020-10-101-3/+3
| | | | | | | | Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself Fixes: 25675/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G729_fuzzer-4786580731199488 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/celp_filters: Fix runtime error: signed integer overflow: 1892453989 ↵Michael Niedermayer2017-05-231-1/+1
| | | | | | | | | + 381702783 cannot be represented in type 'int' Fixes: 1766/clusterfuzz-testcase-minimized-6562020075765760 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* ff_celp_lp_synthesis_filterf: change loop end checkMichael Niedermayer2012-10-131-1/+1
| | | | | | | | This makes no difference for supported input but avoids a out of array read with input that is never passed in currently Fixes CID717919 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* ff_celp_lp_synthesis_filterf: check that filter_length is within the ↵Michael Niedermayer2012-10-131-0/+3
| | | | | | supported range Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-08-161-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: Fix even more missing includes after the common.h removal build: Factor out rangecoder dependencies to CONFIG_RANGECODER build: Factor out error resilience dependencies to CONFIG_ERROR_RESILIENCE x86: avcodec: Consistently name all init files Add more missing includes after removing the implicit common.h Add some more missing includes after removing the implicit common.h Don't include common.h from avutil.h rtmp: Automatically compute the hash for SWFVerification Conflicts: configure doc/APIchanges doc/examples/decoding_encoding.c libavcodec/Makefile libavcodec/assdec.c libavcodec/audio_frame_queue.c libavcodec/avpacket.c libavcodec/dv_profile.c libavcodec/dwt.c libavcodec/libtheoraenc.c libavcodec/rawdec.c libavcodec/rv40dsp.c libavcodec/tiff.c libavcodec/tiffenc.c libavcodec/v210dec.h libavcodec/vc1dsp.c libavcodec/x86/Makefile libavfilter/asrc_anullsrc.c libavfilter/avfilter.c libavfilter/buffer.c libavfilter/formats.c libavfilter/vf_ass.c libavfilter/vf_drawtext.c libavfilter/vf_fade.c libavfilter/vf_select.c libavfilter/video.c libavfilter/vsrc_testsrc.c libavformat/version.h libavutil/audioconvert.c libavutil/error.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Don't include common.h from avutil.hMartin Storsjö2012-08-151-0/+1
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-08-131-8/+7
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (22 commits) g723.1: do not pass large structs by value g723.1: do not bounce intermediate values via memory g723.1: declare a variable in the block it is used g723.1: avoid saving/restoring excitation g723.1: avoid unnecessary memcpy() in residual_interp() g723.1: make postfilter write directly to output buffer g723.1: drop unnecessary variable buf_ptr in formant_postfilter() g723.1: make scale_vector() output to a separate buffer g723.1: make autocorr_max() work on an arbitrary buffer g723.1: do not needlessly use int64_t g723.1: use saturating addition functions g723.1: optimise scale_vector() g723.1: remove useless uses of MUL64() g723.1: remove unnecessary argument 'shift' from dot_product() g723.1: deobfuscate "(x << 4) - x" to "15 * x" celp: optimise ff_celp_lp_synthesis_filter() libavutil: add saturating addition functions cllc: Implement ARGB support cllc: Add support for QRGB cllc: Rename some funcs to represent what they actually do ... Conflicts: LICENSE libavcodec/g723_1.c libavcodec/x86/Makefile Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * celp: optimise ff_celp_lp_synthesis_filter()Mans Rullgard2012-08-131-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Adding instead of subtracting the products in the loop allows the compiler to generate more efficient multiply-accumulate instructions when 16-bit multiply-subtract is not available. ARM has only multiply-accumulate for 16-bit operands. In general, if only one variant exists, it is usually accumulate rather than subtract. In the same spirit, using the dedicated saturation function enables use of any special optimised versions of this. Signed-off-by: Mans Rullgard <mans@mansr.com>
| * Add a shift parameter to celp_lp_synthesis_filter()Mohamed Naufal Basheer2012-07-221-2/+2
| | | | | | | | | | | | This is intended for reuse by the G.723.1 decoder Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
* | Optimization of AMR NB and WB decoders for MIPSNedeljko Babic2012-06-111-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AMR NB and WB decoders are optimized for MIPS architecture. Appropriate Makefiles are changed accordingly. Cnfigure script is changed in order to support optimizations. Optimizations are enabled by default when compiling is done for mips architecture. Appropriate cflags are automatically set. Support for several mips CPUs is added in configure script. New ffmpeg options are added for disabling optimizations. The FFMPEG option --disable-mipsfpu disables MIPS floating point optimizations. The FFMPEG option --disable-mips32r2 disables MIPS32R2 optimizations. The FFMPEG option --disable-mipsdspr1 disables MIPS DSP ASE R1 optimizations. The FFMPEG option --disable-mipsdspr2 disables MIPS DSP ASE R2 optimizations. Signed-off-by: Nedeljko Babic <nbabic@mips.com> Reviewed-by: Vitor Sessak <vitor1001@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-05-051-3/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: tests: Refactor rotozoom/videogen common code into a separate file. tests: Mark some file-internal symbols as static. build: Drop leftover .exp pattern from LIBSUFFIXES list. vsrc_buffer: return EAGAIN if no frame is available. WMAL: Shift output samples by the specified number of padding zeroes. WMAL: Restore removed code in mclms_predict() rtpdec_h264: Remove a useless ifdef rtpdec_h264: Remove outdated/useless/incorrect comments rtpdec_h264: Remove useless memory corruption checks rtpdec_h264: Return proper error codes rtpdec_h264: Check the available data length before reading rtpdec_h264: Add input size checks png: check bit depth for PAL8/Y400A pixel formats. ea: check chunk_size for validity. celp filters: Do not read earlier than the start of the 'out' vector. Conflicts: libavcodec/pngdec.c libavfilter/src_buffer.c tests/rotozoom.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * celp filters: Do not read earlier than the start of the 'out' vector.Alex Converse2012-05-041-3/+1
| | | | | | | | CC: libav-stable@libav.org
| * Remove unused variablesMans Rullgard2011-06-021-2/+1
| |
| * Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-191-4/+4
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* | Add a shift parameter to celp_lp_synthesis_filter for reuse by the G.723.1 ↵Mohamed Naufal Basheer2011-09-291-2/+2
| | | | | | | | decoder
* | Fix various unused variable warningsClément Bœsch2011-05-301-2/+1
|/ | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Fix spelling in commentVitor Sessak2010-03-011-1/+1
| | | | Originally committed as revision 22137 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add commented-out unoptimized code to improve readabilityVitor Sessak2010-03-011-0/+8
| | | | Originally committed as revision 22136 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Cosmetics: make celp_filters.* formatting more consistent with the rest ofVitor Sessak2009-12-161-18/+9
| | | | | | FFmpeg Originally committed as revision 20885 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Optimize ff_celp_lp_synthesis_filterf(). 50% faster in my tests.Vitor Sessak2009-12-161-1/+96
| | | | Originally committed as revision 20884 to svn://svn.ffmpeg.org/ffmpeg/trunk
* And on the sixth day, God gave us the <= operand, which makes the loopRonald S. Bultje2009-11-091-12/+3
| | | | | | | | "for (i = 1; i < num + 1; i++)" look like "for (i = 1; i <= num; i++)". Programmers worldwide rejoiced and used the operand, e.g. in the thread "[PATCH] remove ugliness in cel_filters.c", and He saw that it was good. Originally committed as revision 20489 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add ff_celp_circ_addf() function to be used for sparse vector circularColin McQuillan2009-08-121-0/+10
| | | | | | | | | | convolution in the upcoming AMR-NB floating point decoder. The function scales and adds a vector, that is lagged by some offset, to another vector with the same number of elements. Patch by Colin McQuillan ( m.niloc googlemail com ) Originally committed as revision 19634 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Correct the sign of the arithmetic in ff_celp_lp_zero_synthesis_filterf()Colin McQuillan2009-08-031-1/+1
| | | | | | Patch by Colin McQuillan ( m.niloc googlemail com ) Originally committed as revision 19574 to svn://svn.ffmpeg.org/ffmpeg/trunk
* cosmetics: K&R coding styleDiego Biurrun2009-08-021-43/+33
| | | | Originally committed as revision 19561 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add LP zero synthesis filter. Patch by Kenan Gillet.Kenan Gillet2009-04-181-0/+20
| | | | Originally committed as revision 18616 to svn://svn.ffmpeg.org/ffmpeg/trunk
* [COSMETIC] Correct a minor nit. Should be clearer now.Reynaldo H. Verdejo Pinochet2009-04-151-2/+2
| | | | Originally committed as revision 18529 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Fix possibly harmful outbound addressing. Patch by Kenan Gillet.Kenan Gillet2009-04-151-6/+4
| | | | Originally committed as revision 18528 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Change sign in ff_celp_lp_synthesis_filterf(). This makes this functionKenan Gillet2009-02-231-1/+1
| | | | | | | | useful for AMR and RA144. Patch by Kenan Gillet Originally committed as revision 17546 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add a LPC filterKenan Gillet2008-10-301-0/+21
| | | | | | Part of the QCELP patch by Kenan Gillet, kenan.gillet gmail com Originally committed as revision 15754 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Split off celp_filters.[ch] from acelp_filters.[ch] for the QCELP decoder.Kenan Gillet2008-10-241-0/+86
patch by Kenan Gillet, kenan.gillet gmail com Originally committed as revision 15680 to svn://svn.ffmpeg.org/ffmpeg/trunk