summaryrefslogtreecommitdiff
path: root/libavcodec/simple_idct_template.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/simple_idct_template: fix integer overflowPaul B Mahol2019-12-141-1/+1
|
* avcodec/simple_idct_template: Fix integer overflow in idctSparseColAdd()Michael Niedermayer2019-07-081-9/+9
| | | | | | | | Fixes: signed integer overflow: 1106434976 + 1041773512 cannot be represented in type 'int' Fixes: 15421/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV2_fuzzer-5669209314426880 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/simple_idct_template: Fix integer overflow in idctSparseCol()Michael Niedermayer2019-07-081-9/+9
| | | | | | | | Fixes: signed integer overflow: -1027919784 + -1120041624 cannot be represented in type 'int' Fixes: 15406/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3_fuzzer-5700646528876544 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/simple_idct_template: Fix several integer overflowsMichael Niedermayer2018-08-041-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: simple_idct_template.c:184:30: runtime error: signed integer overflow: -1065517056 - 1392182838 cannot be represented in type 'int' Fixes: simple_idct_template.c:269:21: runtime error: signed integer overflow: 16384 * 259254 cannot be represented in type 'int' Fixes: simple_idct_template.c:164:17: runtime error: signed integer overflow: 21407 * 210162 cannot be represented in type 'int' Fixes: simple_idct_template.c:167:17: runtime error: signed integer overflow: 21407 * 210162 cannot be represented in type 'int' Fixes: simple_idct_template.c:169:19: runtime error: signed integer overflow: 22725 * 259190 cannot be represented in type 'int' Fixes: simple_idct_template.c:171:19: runtime error: signed integer overflow: 19265 * 259190 cannot be represented in type 'int' Fixes: simple_idct_template.c:173:19: runtime error: signed integer overflow: 12873 * 259190 cannot be represented in type 'int' Fixes: simple_idct_template.c:183:28: runtime error: signed integer overflow: 1860878336 + 585177665 cannot be represented in type 'int' Fixes: simple_idct_template.c:159:17: runtime error: signed integer overflow: 16384 * 189520 cannot be represented in type 'int' Fixes: simple_idct_template.c:170:22: runtime error: signed integer overflow: 19265 * 130147 cannot be represented in type 'int' Fixes: simple_idct_template.c:174:23: runtime error: signed integer overflow: -22725 * 130147 cannot be represented in type 'int' Fixes: simple_idct_template.c:183:20: runtime error: signed integer overflow: 16384 * -175206 cannot be represented in type 'int' Fixes: simple_idct_template.c:184:22: runtime error: signed integer overflow: -16384 * -175206 cannot be represented in type 'int' Fixes: simple_idct_template.c:185:22: runtime error: signed integer overflow: -16384 * -175206 cannot be represented in type 'int' Fixes: simple_idct_template.c:186:20: runtime error: signed integer overflow: 16384 * -175206 cannot be represented in type 'int' Fixes: simple_idct_template.c:195:26: runtime error: signed integer overflow: 19265 * 150747 cannot be represented in type 'int' Fixes: simple_idct_template.c:198:27: runtime error: signed integer overflow: -22725 * 150747 cannot be represented in type 'int' Fixes: simple_idct_template.c:184:37: runtime error: signed integer overflow: 21407 * -171941 cannot be represented in type 'int' Fixes: simple_idct_template.c:185:37: runtime error: signed integer overflow: 21407 * -171941 cannot be represented in type 'int' Fixes: simple_idct_template.c:192:27: runtime error: signed integer overflow: -12873 * 206341 cannot be represented in type 'int' Fixes: simple_idct_template.c:185:30: runtime error: signed integer overflow: 1196441600 + 1703756981 cannot be represented in type 'int' Fixes: simple_idct_template.c:176:23: runtime error: signed integer overflow: -12873 * 168461 cannot be represented in type 'int' Fixes: simple_idct_template.c:191:27: runtime error: signed integer overflow: -22725 * -140062 cannot be represented in type 'int' Fixes: simple_idct_template.c:197:26: runtime error: signed integer overflow: 19265 * -140062 cannot be represented in type 'int' Fixes: simple_idct_template.c:183:34: runtime error: signed integer overflow: 8867 * -243046 cannot be represented in type 'int' Fixes: simple_idct_template.c:186:34: runtime error: signed integer overflow: 8867 * -243046 cannot be represented in type 'int' Fixes: simple_idct_template.c:186:28: runtime error: signed integer overflow: -816234496 - 2139878414 cannot be represented in type 'int' Fixes: simple_idct_template.c:188:26: runtime error: signed integer overflow: 12873 * -239872 cannot be represented in type 'int' Fixes: simple_idct_template.c:165:16: runtime error: signed integer overflow: 8867 * -260084 cannot be represented in type 'int' Fixes: simple_idct_template.c:166:16: runtime error: signed integer overflow: 8867 * -260084 cannot be represented in type 'int' Fixes: 9135/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-6324422955761664 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* simple_idct: Template functions to support an input bitdepth parameterKieran Kunhya2018-04-021-15/+29
|
* Merge commit '2ec9fa5ec60dcd10e1cb10d8b4e4437e634ea428'James Almer2017-03-211-4/+4
|\ | | | | | | | | | | | | * commit '2ec9fa5ec60dcd10e1cb10d8b4e4437e634ea428': idct: Change type of array stride parameters to ptrdiff_t Merged-by: James Almer <jamrial@gmail.com>
| * idct: Change type of array stride parameters to ptrdiff_tDiego Biurrun2016-09-291-4/+4
| | | | | | | | ptrdiff_t is the correct type for array strides and similar.
* | avcodec/simple_idct_template: Fix several integer overflowsMichael Niedermayer2017-03-161-18/+18
| | | | | | | | | | | | | | | | | | | | | | Benchmarks with START_TIMER indicate that the code is faster with unsigned, (that is with the patch), there was quite some fluctuation in the numbers so this may be just random Fixes: 811/clusterfuzz-testcase-6465493076541440 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '283226e11ccf50a71d25d150fbbf1743f74c6c49'Clément Bœsch2016-06-211-1/+1
|\ \ | |/ | | | | | | | | | | | | | | * commit '283226e11ccf50a71d25d150fbbf1743f74c6c49': simple_idct_template: Fix strict aliasing violation See 5df703aa1b03814e9cd216ab703501481166b3bb Merged-by: Clément Bœsch <u@pkh.me>
| * simple_idct_template: Fix strict aliasing violationMichael Niedermayer2016-05-101-8/+10
| | | | | | | | | | | | | | This fixes fate-wmv8-intrax8 in certain configurations, e.g. gcc 4.4. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch2016-06-211-4/+2
|\ \ | |/ | | | | | | | | | | * commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-041-4/+2
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
| * idct8x8: Fix undefined negative shiftsKaterina Barone-Adesi2016-03-051-5/+5
| | | | | | | | | | | | | | | | | | | | | | The original code left-shifts negative values, which is undefined in the C99 specification (the one used during normal Libav compilation). This change multiplies by (1 << shift), which is functionally equivalent, but has defined behavior. With this change, fate-idct8x8 compiled with --fsanitize=undefined works. Bug-Id: 686
* | avcodec/simple_idct_template: Fix strict aliasing violationMichael Niedermayer2016-05-081-8/+10
| | | | | | | | | | | | Fixes intrax8 test Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/simple_idct10: improve precisionChristophe Gisquet2015-10-131-14/+31
| | | | | | | | | | | | | | | | | | | | | | omse goes from 0.03060703 (which fails for dct-test) to 0.01663750. This also actually improve the error of decoding the sample generated by fate-vsynth3-dnxhd1080i-10bit using simple_idct10 to FAANI, which goes (when resampled to yuv422p) from: stddev: 0.06 PSNR: 72.28 MAXDIFF: 1 to identical. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/fate-idct8x8: Defined behavior: eliminate negative left-shifts.Katerina Barone-Adesi2014-05-201-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The original code left-shifts negative values, which is undefined in the C99 specification (the one used during normal FFmpeg compilation). This change multiplies by (1 << shift), which is functionally equivalent, but has defined behavior. With this change, fate-idct8x8 compiled with --fsanitize=undefined works. Bug-Id: 686 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> The assembly generated by gcc is unchanged by this commit
* | Merge commit 'aba70bb5387f12dfa5e6cd8cb861c9c7e668151f'Michael Niedermayer2014-03-261-0/+2
|\ \ | |/ | | | | | | | | | | * commit 'aba70bb5387f12dfa5e6cd8cb861c9c7e668151f': Add missing headers to make template files compile (more) standalone Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Add missing headers to make template files compile (more) standaloneDiego Biurrun2014-03-261-0/+2
| |
* | avcodec/simple_idct_template: fix rounding of the special DC case for 10bitMichael Niedermayer2014-01-141-4/+4
| | | | | | | | | | | | | | MSE doesnt change for the test as the code only triggers for very sparse matrixes Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/simple_idct_template: fix row rounderMichael Niedermayer2014-01-141-1/+1
| | | | | | | | | | | | MSE changes from 0.04890000 to 0.02969844 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/simple_idct_template: change the idct coefficients so that they ↵Michael Niedermayer2014-01-141-7/+7
| | | | | | | | | | | | | | | | | | | | | | match the x86 code no changes in either standard deviation or PSNR is seen in any of the changed fate cases MSE changes from 0.05012422 to 0.04890000 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/simple_idct_template: adjust coeffs for 12bit idctMichael Niedermayer2013-09-151-3/+11
| | | | | | | | | | | | | | This prevents overflows with 12bit jpegs Fixes Ticket2952 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/dsputil: add 12bit simple idctMichael Niedermayer2013-09-061-1/+7
| | | | | | | | | | | | Will be needed for jpeg Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '88bd7fdc821aaa0cbcf44cf075c62aaa42121e3f'Michael Niedermayer2013-01-231-7/+7
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '88bd7fdc821aaa0cbcf44cf075c62aaa42121e3f': Drop DCTELEM typedef Conflicts: libavcodec/alpha/dsputil_alpha.h libavcodec/alpha/motion_est_alpha.c libavcodec/arm/dsputil_init_armv6.c libavcodec/bfin/dsputil_bfin.h libavcodec/bfin/pixels_bfin.S libavcodec/cavs.c libavcodec/cavsdec.c libavcodec/dct-test.c libavcodec/dnxhdenc.c libavcodec/dsputil.c libavcodec/dsputil.h libavcodec/dsputil_template.c libavcodec/eamad.c libavcodec/h264_cavlc.c libavcodec/h264idct_template.c libavcodec/mpeg12.c libavcodec/mpegvideo.c libavcodec/mpegvideo.h libavcodec/mpegvideo_enc.c libavcodec/ppc/dsputil_altivec.c libavcodec/proresdsp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Drop DCTELEM typedefDiego Biurrun2013-01-221-7/+7
| | | | | | | | | | | | It does not help as an abstraction and adds dsputil dependencies. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-03-071-18/+16
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: SBR DSP: fix SSE code to not use SSE2 instructions. cpu: initialize mask to -1, so that by default, optimizations are used. error_resilience: initialize s->block_index[]. svq3: protect against negative quantizers. Don't use ff_cropTbl[] for IDCT. swscale: make filterPos 32bit. FATE: add CPUFLAGS variable, mapping to -cpuflags avconv option. avconv: add -cpuflags option for setting supported cpuflags. cpu: add av_set_cpu_flags_mask(). libx264: Allow overriding the sliced threads option avconv: fix counting encoded video size. Conflicts: doc/APIchanges doc/fate.texi doc/ffmpeg.texi ffmpeg.c libavcodec/h264idct_template.c libavcodec/svq3.c libavutil/avutil.h libavutil/cpu.c libavutil/cpu.h libswscale/swscale.c tests/Makefile tests/fate-run.sh tests/regression-funcs.sh Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Don't use ff_cropTbl[] for IDCT.Ronald S. Bultje2012-03-061-18/+16
| | | | | | | | | | | | | | | | Results of IDCT can by far outreach the range of ff_cropTbl[], leading to overreads and potentially crashes. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
* | simpleidct: fix project name.Michael Niedermayer2012-02-011-4/+4
|/ | | | | | | "Copyright (c) 2001 Michael Niedermayer" and "part of Libav" is not likely not only am i not a libav developer there also was no libav in 2001 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* prores-idct: fix overflow in c code.Ronald S. Bultje2011-10-141-14/+24
| | | | | | | Fix the fate ref for prores-422_proxy by reverting the changes to it in commit f492df0927c42da174edb674857670fc50abc5dc Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* simple_idct: whitespace cosmeticsMans Rullgard2011-07-211-124/+124
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* simple_idct: make repeated code a macroMans Rullgard2011-07-211-144/+53
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* simple_idct: change 10-bit add/put stride from pixels to bytesMans Rullgard2011-07-211-0/+6
| | | | | | This matches other dsputil functions and simplifies calls. Signed-off-by: Mans Rullgard <mans@mansr.com>
* simple_idct: add 10-bit versionMans Rullgard2011-07-201-0/+401
Signed-off-by: Mans Rullgard <mans@mansr.com>