1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-05 07:48:07 +02:00
Commit Graph

28 Commits

Author SHA1 Message Date
Andreas Rheinhardt
a247ac640d avcodec: Constify AVCodecs
Given that the AVCodec.next pointer has now been removed, most of the
AVCodecs are not modified at all any more and can therefore be made
const (as this patch does); the only exceptions are the very few codecs
for external libraries that have a init_static_data callback.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:15 -03:00
Andreas Rheinhardt
74bffc00c5 avcodec: Constify some AVPackets
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-09 13:41:22 +01:00
Paul B Mahol
bc86629842 avcodec/pixlet: postprocess luma using precalculated lut
Realtime decoding speed raises from 1.08 to 1.84 for
1504x846, 25391 kb/s, 24 fps video.
2020-09-06 13:58:09 +02:00
Michael Niedermayer
bd0f81526d avcodec/pixlet: Fix log(0) check
Fixes: passing zero to clz(), which is not a valid argument
Fixes: 23337/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PIXLET_fuzzer-5179131989065728

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-06-14 18:20:37 +02:00
Anton Khirnov
1f4cf92cfb pthread_frame: merge the functionality for normal decoder init and init_thread_copy
The current design, where
- proper init is called for the first per-thread context
- first thread's private data is copied into private data for all the
  other threads
- a "fixup" function is called for all the other threads to e.g.
  allocate dynamically allocated data
is very fragile and hard to follow, so it is abandoned. Instead, the
same init function is used to init each per-thread context. Where
necessary, AVCodecInternal.is_copy can be used to differentiate between
the first thread and the other ones (e.g. for decoding the extradata
just once).
2020-04-10 15:24:54 +02:00
Clément Bœsch
d1aef7d08a lavc/pixlet: remove unecessary intermediate nb_levels variable
This is a change imported from Libav.
2017-10-13 00:25:14 +02:00
Clément Bœsch
368fb74831 lavc/pixlet: reduce diff with Libav (cosmetics only) 2017-10-13 00:25:14 +02:00
Michael Niedermayer
8754ccd3b3 avcodec/pixlet: Fixes: undefined shift in av_mod_uintp2()
Fixes: runtime error: shift exponent 4294967289 is too large for 32-bit type 'int'
Fixes: 3030/clusterfuzz-testcase-minimized-4649809254285312

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-20 21:14:47 +02:00
Michael Niedermayer
cadab5a2a7 avcodec/pixlet: fixes integer overflow in read_highpass()
Fixes: runtime error: negation of -2147483648 cannot be represented in type 'int32_t' (aka 'int'); cast to an unsigned type to negate this value to itself
Fixes: 2879/clusterfuzz-testcase-minimized-6317542639403008

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-18 11:34:01 +02:00
Michael Niedermayer
aeddb3607b avcodec/pixlet: Simplify nbits computation
Fixes multiple integer overflows
Fixes: runtime error: signed integer overflow: 1 + 2147483647 cannot be represented in type 'int'

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-07-28 03:35:22 +02:00
Michael Niedermayer
77d9889821 avcodec/pixlet: Fix runtime error: signed integer overflow: 2147483647 + 32 cannot be represented in type 'int'
Fixes: 1829/clusterfuzz-testcase-minimized-5527165321871360

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-27 13:04:23 +02:00
Michael Niedermayer
d32ebce8fd avcodec/pixlet: Fix reading invalid numbers of bits
Fixes: asertion failure
Fixes: 1664/clusterfuzz-testcase-minimized-6587801187385344

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-18 18:08:23 +02:00
Michael Niedermayer
a453f5549a avcodec/pixlet: Fixes: runtime error: signed integer overflow: 9203954323419769657 + 29897660706736950 cannot be represented in type 'long'
Fixes: 1569/clusterfuzz-testcase-minimized-6328690508038144

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-14 17:03:30 +02:00
Michael Niedermayer
60765cc42e avcodec/pixlet: Fix runtime error: signed integer overflow: 436207616 * -5160230545260541 cannot be represented in type 'long'
Fixes: 1462/clusterfuzz-testcase-minimized-6558894463647744

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-11 00:02:41 +02:00
Michael Niedermayer
1f5b6c7e1e avcodec/pixlet: Fix shift exponent 4294967268 is too large for 32-bit type 'int'
Fixes: 1336/clusterfuzz-testcase-minimized-4761381930795008

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-05 13:36:52 +02:00
Michael Niedermayer
c94d551ea7 avcodec/pixlet: Reorder rlen check
This changes nothing but is nicer looking as this checks rlen

Maybe this helps coverity remove CID1397743

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-10 13:11:15 +02:00
Clément Bœsch
549045254c Fix all -Wformat warnings raised by DJGPP 2017-03-29 14:49:29 +02:00
Vittorio Giovara
a6b1180e39 avcodec/pixlet: fix architecture-dependent code and values
The constants used in the decoder used floating point precision,
and this caused different values to be generated on different
architectures.

So, eradicate floating point numbers and use fixed point (32.32)
arithmetics everywhere, replacing constants with precomputed integer
values.

Signed-off-by: Vittorio Giovara <vittorio.giovara at gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-03-07 14:04:01 +01:00
Paul B Mahol
0fe50e56e9 avcodec/pixlet: use av_clip_uintp2_c explicitly
Found-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-01-19 13:32:21 +01:00
Paul B Mahol
a340987e37 avcodec/pixlet: use av_clip_uintp2()
Found-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-01-19 13:19:10 +01:00
Paul B Mahol
be46eb7101 avcodec/pixlet: clip chroma before shifting
Fixes artifacts.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-01-19 12:49:41 +01:00
Paul B Mahol
25c4035529 avcodec/pixlet: simplify lowpass_prediction() function
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-12-24 16:42:00 +01:00
Paul B Mahol
6cedd20b97 avcodec/pixlet: make sure scaling factors are not zero
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-12-24 10:31:43 +01:00
Paul B Mahol
ab31b46b89 avcodec/pixlet: avoid some overflows
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-12-24 10:26:27 +01:00
Paul B Mahol
43cd33be16 avcodec/pixlet: fix undefined behaviour in postprocess_chroma
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-12-24 10:22:39 +01:00
Paul B Mahol
51ed1a7dd4 avcodec/pixlet: check out of bounds pfx value
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-12-23 09:41:06 +01:00
James Almer
41de965e31 avcodec/pixlet: remove unnecessary double to float conversion
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-23 09:19:34 +01:00
Paul B Mahol
73651090ca avcodec: add Apple Pixlet decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-12-22 22:47:06 +01:00