Commit Graph

17 Commits

Author SHA1 Message Date
Michael Niedermayer
7ccb576191 avcodec/xvididct: Fix integer overflow in MULT()
Fixes: signed integer overflow: 23170 * 95058 cannot be represented in type 'int'
Fixes: 20295/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_fuzzer-5800212870463488

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-04-07 18:24:14 +02:00
Ronald S. Bultje
32baeafeee jrev/xvid: hardcode use of C put/add_pixels_clamped.
This removes the last use of the ff_put/add_pixels_clamped global
function pointers, and as such they are removed.

This patch has a negative effect on performance on MIPS, since there's
a SIMD-optimized put/add_pixels_clamped, but no xvid or jrev. From a
code maintenance point of view, that is probably acceptable.

Because the global function pointers are removed, this fixes the following
tsan warnings when running e.g. fate-dnxhr-parse:

WARNING: ThreadSanitizer: data race (pid=29917)
  Write of size 8 at 0x0000025b12d8 by thread T2 (mutexes: write M1543):
    #0 ff_idctdsp_init src/libavcodec/idctdsp.c:313 (ffmpeg+0x00000044b68e)
[..]
  Previous write of size 8 at 0x0000025b12d8 by thread T1 (mutexes: write M1541):
    #0 ff_idctdsp_init src/libavcodec/idctdsp.c:313 (ffmpeg+0x00000044b68e)
2017-04-06 10:03:28 -04:00
James Almer
5a49097b42 Merge commit '2ec9fa5ec60dcd10e1cb10d8b4e4437e634ea428'
* commit '2ec9fa5ec60dcd10e1cb10d8b4e4437e634ea428':
  idct: Change type of array stride parameters to ptrdiff_t

Merged-by: James Almer <jamrial@gmail.com>
2017-03-21 14:29:52 -03:00
Diego Biurrun
2ec9fa5ec6 idct: Change type of array stride parameters to ptrdiff_t
ptrdiff_t is the correct type for array strides and similar.
2016-09-29 14:48:03 +02:00
周晓勇
b50910e9a9 avcodec: loongson optimize xvid idct with mmi
Signed-off-by: ZhouXiaoyong <zhouxiaoyong@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-21 14:48:23 +02:00
Michael Niedermayer
5b58d79a99 Merge commit '7a1d6ddd2c6b2d66fbc1afa584cf506930a26453'
* commit '7a1d6ddd2c6b2d66fbc1afa584cf506930a26453':
  xvid: Add C IDCT

Conflicts:
	libavcodec/dct-test.c
	libavcodec/xvididct.c

See: 298b3b6c1f
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-03 04:09:38 +02:00
Pascal Massimino
7a1d6ddd2c xvid: Add C IDCT
Thanks to Pascal Massimino and Michael Militzer for relicensing as LGPL.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-02 14:41:13 -07:00
Michael Niedermayer
b3b05a11d3 Merge commit 'dcb7c868ec7af7d3a138b3254ef2e08f074d8ec5'
* commit 'dcb7c868ec7af7d3a138b3254ef2e08f074d8ec5':
  cosmetics: Make naming scheme of Xvid IDCT consistent with other IDCTs

Conflicts:
	libavcodec/mpeg4videodec.c
	libavcodec/x86/Makefile
	libavcodec/x86/dct-test.c
	libavcodec/x86/xvididct_sse2.c
	libavcodec/xvididct.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-27 21:09:30 +02:00
Diego Biurrun
dcb7c868ec cosmetics: Make naming scheme of Xvid IDCT consistent with other IDCTs 2014-08-27 04:54:05 -07:00
James Almer
a8592db9bb avcodec/idctdsp: make add/put_pixels_clamped_c internal functions
This reduces code duplication and differences with the fork.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-13 01:44:41 +02:00
Pascal Massimino
298b3b6c1f avcodec: add C xvid IDCT support
Thanks to Pascal Massimino and Michael Militzer for permission to use under LGPL

The xvid idct code is from xvid, and nearly unchanged to make future syncing easy
the integration into ffmpeg is done by the commiter
the commit message is written by the commiter
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-12 21:58:45 +02:00
Michael Niedermayer
3841f2ae66 Merge commit 'd35b94fbabd8beb5d566c0b5d01688aff62c3b36'
* commit 'd35b94fbabd8beb5d566c0b5d01688aff62c3b36':
  avcodec: Rename xvidmmx IDCT to xvid

Conflicts:
	doc/APIchanges
	libavcodec/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-09 12:11:13 +02:00
Michael Niedermayer
0dcebb9f63 Merge commit '84d173d3de97c753234ab0c0b50551d51413d663'
* commit '84d173d3de97c753234ab0c0b50551d51413d663':
  xvididct: Ensure that the scantable permutation is always set correctly

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 22:17:04 +02:00
Diego Biurrun
d35b94fbab avcodec: Rename xvidmmx IDCT to xvid
The Xvid IDCT is not MMX-specific.
2014-08-08 11:13:30 -07:00
Diego Biurrun
84d173d3de xvididct: Ensure that the scantable permutation is always set correctly
This fixes cases where the scantable permuation would get overwritten by
the general idctdsp initialization.
2014-08-08 11:13:29 -07:00
Michael Niedermayer
f54e01c24e Merge commit 'a786c8259dafeca9744252230b5d78f67810770c'
* commit 'a786c8259dafeca9744252230b5d78f67810770c':
  idct: Split off Xvid IDCT

Conflicts:
	libavcodec/Makefile
	libavcodec/mpeg4videodec.c
	libavcodec/x86/Makefile
	libavcodec/x86/idctdsp_init.c

This split is somewhat restructured leaving the xvid IDCT available
outside mpeg4 if manually selected.

The code also could not be merged unchanged as it conflicted with a
bugfix in FFmpeg

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-01 16:21:52 +02:00
Diego Biurrun
a786c8259d idct: Split off Xvid IDCT
The Xvid IDCT is only required to decode some Xvid-encoded MPEG-4 files,
so there is no point in having it as an unconditional part of idctdsp.
2014-08-01 01:25:18 -07:00