1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

44477 Commits

Author SHA1 Message Date
Ricardo Monteiro
a0949d0bcb avcodec/nvenc: don't disable b-frames by default
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-02-22 16:35:08 +01:00
Anton Khirnov
1c36e7c1a5 lavc/ac3enc: rename variable to avoid shadowing
Harmless, but confusing.
2021-02-22 11:12:10 +01:00
Paul B Mahol
8651bf8a2e avcodec: add Simbiosis IMX video decoder 2021-02-20 17:42:00 +01:00
Andreas Rheinhardt
5a4f0d9b94 avcodec/cpia: Mark decoder as init-threadsafe
Reviewed-by: Stephan Hilb <stephan@ecshi.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-20 15:44:44 +01:00
Andreas Rheinhardt
980b5c3bb5 avcodec/dirac_vlc: Make ff_dirac_golomb_lut static
Only used here.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-20 14:46:42 +01:00
Andreas Rheinhardt
d0d96674ec avcodec/ac3tab: Move ff_ac3_enc_channel_map to its only user
and make it static.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-20 14:46:25 +01:00
Michael Niedermayer
89fe1935b1 avcodec/hapdec: Change compressed_offset to unsigned 32bit
Fixes: out of array access
Fixes: 29345/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HAP_fuzzer-5401813482340352
Fixes: 30745/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HAP_fuzzer-5762798221131776

Suggested-by: Anton
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>
2021-02-20 14:16:00 +01:00
Wonkap Jang
029e3c1c70 avcodec/libvpxenc: optimize parsing vpx_svc_ref_frame_config
Getting rid of unnecessary use of AVDictionary object in parsing
vpx_svc_ref_frame_config.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Zern <jzern@google.com>
2021-02-19 13:54:07 -08:00
Paul B Mahol
82472afe18 avcodec/cfhdenc: use pts instead of frame number
Makes encodes bitexact with different number of threads.
2021-02-19 21:15:35 +01:00
Paul B Mahol
59dd702990 avcodec/indeo3: add support for more dimensions
Fixes #6581
2021-02-19 21:15:08 +01:00
Josh Dekker
7ac41e0db2 lavc/aarch64: add HEVC sao_band NEON
Only works for 8x8.

Signed-off-by: Josh Dekker <josh@itanimul.li>
2021-02-18 14:12:01 +01:00
Josh Dekker
75c2ddfa61 lavc/aarch64: add HEVC idct_dc NEON
Signed-off-by: Josh Dekker <josh@itanimul.li>
2021-02-18 14:12:01 +01:00
Reimar Döffinger
00c916ef61 lavc/aarch64: port HEVC add_residual NEON
Speedup is fairly small, around 1.5%, but these are fairly simple.

Signed-off-by: Josh Dekker <josh@itanimul.li>
2021-02-18 14:11:57 +01:00
Reimar Döffinger
30f80d855b lavc/aarch64: port HEVC SIMD idct NEON
Makes SIMD-optimized 8x8 and 16x16 idcts for 8 and 10 bit depth
available on aarch64.
For a UHD HDR (10 bit) sample video these were consuming the most time
and this optimization reduced overall decode time from 19.4s to 16.4s,
approximately 15% speedup.
Test sample was the first 300 frames of "LG 4K HDR Demo - New York.ts",
running on Apple M1.

Signed-off-by: Josh Dekker <josh@itanimul.li>
2021-02-18 14:11:53 +01:00
Paul B Mahol
67c8c863c7 avcodec: add initial exr image encoder 2021-02-18 13:00:40 +01:00
KM
fbe9b0c8f3 lavc/aacdec_template: Fix 7.1 decoding with default strictness.
Broken in 4d9b9c5e
Fixes ticket #9057.
2021-02-16 23:37:31 +01:00
Andreas Rheinhardt
15cb5d00d9 avcodec/frame_thread_encoder: Use more natural types
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-16 22:11:53 +01:00
Andreas Rheinhardt
739175bfe5 avcodec/frame_thread_encoder: Reduce amount of code guarded by mutex
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-16 22:11:53 +01:00
Andreas Rheinhardt
74b0af998a avcodec/frame_thread_encoder: Avoid FIFO
It can be replaced by a simple counter.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-16 22:11:53 +01:00
Andreas Rheinhardt
de1b20a82b avcodec/frame_thread_encoder: Avoid allocations of AVFrames
Up until now, when using frame threaded encoding, an AVFrame would be
allocated for every frame to be encoded. These AVFrames would reach the
worker threads via a FIFO of tasks, a structure which contained the
AVFrame as well as an index into an array which gives the place where
the worker thread shall put the returned packet; in addition to that,
said structure also contained several unused fields.

This commit changes this: The AVFrames are now allocated during init in
the array that is up until now only used to return the packets. The
contents to be encoded are put into the AVFrame in the same array
element that is also used to return the packets.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-16 22:11:53 +01:00
Andreas Rheinhardt
76d428e090 avcodec/frame_thread_encoder: Avoid creating reference to frame
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-16 22:11:53 +01:00
Andreas Rheinhardt
fbf242a51d avcodec/frame_thread_encoder: Avoid allocations of AVPackets, fix deadlock
Up until now, when doing frame thread encoding, each worker thread
tried to allocate an AVPacket for every AVFrame to be encoded; said
packets would then be handed back to the main thread, where the content
of said packet is copied into the packet actually destined for output;
the temporary AVPacket is then freed.

Besides being wasteful this also has another problem: There is a risk of
deadlock, namely if no AVPacket can be allocated at all. The user
doesn't get an error at all in this case and the worker threads will
simply try to allocate a packet again and again. If the user has
supplied enough frames, the user's thread will block until a task has
been completed, which just doesn't happen if no packet can ever be
allocated.

This patch instead modifies the code to allocate the packets during
init; they are then reused again and again.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-16 22:11:53 +01:00
Andreas Rheinhardt
2ccbc40eef avcodec/frame_thread_encoder: Fix segfault on allocation error
Fixes a segfault from av_fifo_size(NULL) that happens in
ff_frame_thread_encoder_free if the fifo couldn't be allocted;
furthermore the mutexes and conditions that are destroyed in
ff_frame_thread_encoder_free are not even initialized at this point,
so don't call said function.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-16 22:11:53 +01:00
Andreas Rheinhardt
e0f5086fab avcodec/frame_thread_encoder: Improve type safety
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-16 22:11:53 +01:00
Michael Niedermayer
6a797ceafe avcodec/vp8: Move end check into MB loop in vp78_decode_mv_mb_modes()
Fixes: Timeout (long -> 5sec)
Fixes: 30269/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP7_fuzzer-5430325004075008

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-16 19:02:24 +01:00
Paul B Mahol
8d209eb33c avcodec/exr: export any unknown header string variable to metadata
And properly skip preview type in header.
2021-02-16 14:39:43 +01:00
Paul B Mahol
f5dde8089d avcodec/exr: refactor GetByteContext usage 2021-02-16 13:58:48 +01:00
Paul B Mahol
3ea660c78a avcodec/exr: correctly calculate display window 2021-02-16 13:58:48 +01:00
Paul B Mahol
b1eb15c1cf avcodec/exr: add multipart support 2021-02-16 03:51:07 +01:00
Paul B Mahol
6941d93faa avcodec/setts_bsf: add sample rate for expressions 2021-02-15 20:52:44 +01:00
Paul B Mahol
5f0e3b549a avcodec/exr: unbreak parsing sample aspect ratio 2021-02-15 17:39:35 +01:00
Paul B Mahol
98191135e0 avcodec/exr: read fps from metadata too 2021-02-15 17:39:35 +01:00
Carl Eugen Hoyos
ca781761d6 lavc/pnm: Allow decoding gray float pfm images. 2021-02-15 00:01:07 +01:00
Michael Niedermayer
b24d3bfe66 avcodec/fmvc: avoid copying uninitialized data
Fixes: Timeout
Fixes: 30049/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FMVC_fuzzer-5986909455253504

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-14 19:55:02 +01:00
Michael Niedermayer
c000a91288 avcodec/fits: Check gcount and pcount being non negative
Fixes: signed integer overflow: 9223372036854775807 - -30069403896 cannot be represented in type 'long'
Fixes: 30046/clusterfuzz-testcase-minimized-ffmpeg_dem_FITS_fuzzer-5807144773484544

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-14 19:55:02 +01:00
Paul B Mahol
505d6ed475 avcodec/apedec: export bits_per_raw_sample
Fixes #4717
2021-02-14 18:59:28 +01:00
Paul B Mahol
5d9f44da46 avcodec/pngenc: remove monowhite from apng formats
Monowhite pixel format is not supported, and it does not make sense
to add support for it.

Fixes #7989
2021-02-14 17:23:24 +01:00
sfan5
6f80953554 avcodec/mediacodecdec: do not abort when H264/HEVC extradata extraction fails
Although rare, extradata can be present but empty and extraction will fail.
However Android also supports passing codec-specific data inline and
will likely play such a stream anyway. So there's no reason to abort
initialization before we know for sure.
2021-02-14 13:38:46 +02:00
Paul B Mahol
63231fa8d3 avcodec/pngdec: fix possible race condition with APNG decoding
Fixes #9017
2021-02-13 13:24:45 +01:00
Michael Niedermayer
5314a4996c avcodec/pnm_parser: Check av_image_get_buffer_size() for failure
Fixes: out of array access
Fixes: 30135/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PBM_fuzzer-4997145650397184
Fixes: 30208/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGMYUV_fuzzer-5605891665690624.fuzz

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>
2021-02-12 23:42:16 +01:00
Paul B Mahol
d1802e263c avcodec/dpx: add support for other single component 8bit files 2021-02-12 20:43:51 +01:00
Paul B Mahol
68fa294bf8 avcodec/dpx: add float support for single components and rgb(a) 2021-02-12 20:43:51 +01:00
Paul B Mahol
48a0eb21aa avcodec: add setts bitstream filter 2021-02-12 19:50:07 +01:00
James Almer
000b25096b avcodec/hevcdec: fix a return error value
Signed-off-by: James Almer <jamrial@gmail.com>
2021-02-12 10:36:59 -03:00
James Almer
22edf7463c avcodec/hevcdec: add some missing allocation checks
Signed-off-by: James Almer <jamrial@gmail.com>
2021-02-11 13:51:25 -03:00
James Almer
089706e009 avcodec/hevcdec: check that the local context list was allocated before dereferencing it
Since the decoder is not flagged as init cleanup capable, hevc_decode_free()
is being called manually if the hevc_decode_extradata() call fails at the end
of hevc_decode_init().
In a frame threading scenario, however, if AVCodec->init() returns an error,
ff_frame_thread_free() will be called regardless of the above flag being set
or not, resulting in hevc_decode_free() being called a second time for the
same context.

Workaround this by ensuring pointers are not dereferenced if they are NULL,
and set the decoder as init cleanup capable while at it.

Fixes ticket #9099.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-02-11 13:15:45 -03:00
Andreas Rheinhardt
a5daadd3a9 avcodec/mpegvideo_motion: Remove unnecessary headers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-11 09:07:10 +01:00
Andreas Rheinhardt
9c321b0e94 avcodec/mpegvideo_motion: Reindentation
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-11 09:07:10 +01:00
Andreas Rheinhardt
b681680d29 avcodec/mpegvideo_motion: Improve check to remove dead code
Several compile-time checks can be improved because mcsel is not used
for MPEG-1/2 (it is only used for MPEG-4) and because MPEG-1/2 is the
only user of ff_mpv_motion that uses MV_TYPE_16X8 and MV_TYPE_DMV.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-11 09:07:10 +01:00
Michael Niedermayer
2a2082a41b avcodec/jpeg2000dec: Check atom_size in jp2_find_codestream()
Fixes: Infinite loop
Fixes: 29722/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-6412228041506816

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-10 12:28:30 +01:00