Commit Graph

18 Commits

Author SHA1 Message Date
Katerina Barone-Adesi
e50ae60d46 avcodec/fate-idct8x8: Defined behavior: eliminate negative left-shifts.
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
2014-05-20 04:21:06 +02:00
Michael Niedermayer
0371eaebcd Merge commit 'aba70bb5387f12dfa5e6cd8cb861c9c7e668151f'
* commit 'aba70bb5387f12dfa5e6cd8cb861c9c7e668151f':
  Add missing headers to make template files compile (more) standalone

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-26 14:50:55 +01:00
Diego Biurrun
aba70bb538 Add missing headers to make template files compile (more) standalone 2014-03-26 04:31:27 -07:00
Michael Niedermayer
4b0cad6596 avcodec/simple_idct_template: fix rounding of the special DC case for 10bit
MSE doesnt change for the test as the code only triggers
for very sparse matrixes

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-14 15:58:59 +01:00
Michael Niedermayer
a7ea733b72 avcodec/simple_idct_template: fix row rounder
MSE changes from 0.04890000 to 0.02969844

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-14 15:58:59 +01:00
Michael Niedermayer
cca2772e16 avcodec/simple_idct_template: change the idct coefficients so that they 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>
2014-01-14 15:58:58 +01:00
Michael Niedermayer
529540759f avcodec/simple_idct_template: adjust coeffs for 12bit idct
This prevents overflows with 12bit jpegs
Fixes Ticket2952

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-15 03:21:03 +02:00
Michael Niedermayer
ae57e82469 avcodec/dsputil: add 12bit simple idct
Will be needed for jpeg

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-06 01:19:37 +02:00
Michael Niedermayer
ac8987591f Merge commit '88bd7fdc821aaa0cbcf44cf075c62aaa42121e3f'
* 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>
2013-01-23 17:44:56 +01:00
Diego Biurrun
88bd7fdc82 Drop DCTELEM typedef
It does not help as an abstraction and adds dsputil dependencies.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2013-01-22 18:32:56 -08:00
Michael Niedermayer
6df42f9874 Merge remote-tracking branch 'qatar/master'
* 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>
2012-03-07 03:22:49 +01:00
Ronald S. Bultje
c23acbaed4 Don't use ff_cropTbl[] for IDCT.
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
2012-03-06 10:47:42 -08:00
Michael Niedermayer
9096a2760f simpleidct: fix project name.
"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>
2012-02-01 04:43:06 +01:00
Ronald S. Bultje
f78cd0c243 prores-idct: fix overflow in c code.
Fix the fate ref for prores-422_proxy by reverting the changes to it
in commit f492df0927

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2011-10-14 21:34:20 +02:00
Mans Rullgard
2cc4f3b21f simple_idct: whitespace cosmetics
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-21 12:49:51 +01:00
Mans Rullgard
a402f10959 simple_idct: make repeated code a macro
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-21 12:49:51 +01:00
Mans Rullgard
e7bcc5baf7 simple_idct: change 10-bit add/put stride from pixels to bytes
This matches other dsputil functions and simplifies calls.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-21 09:26:37 +01:00
Mans Rullgard
e7a972e113 simple_idct: add 10-bit version
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-20 17:49:48 +01:00