1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
Commit Graph

102485 Commits

Author SHA1 Message Date
Andreas Rheinhardt
9afb291267 avcodec/vp3: Don't try to decode VP4 when VP4 decoder is disabled
Otherwise decoding will crash lateron; e.g. because dct_tokens
is never set or because a VLC that has not been allocated is used.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 23:11:35 +02:00
Andreas Rheinhardt
af7468a282 avcodec/ttmlenc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 22:12:02 +02:00
Andreas Rheinhardt
8f9a4ae63e avcodec/vmdvideo: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 22:12:02 +02:00
Andreas Rheinhardt
b15fcdfe5c avcodec/vmdvideo: Cleanup generically upon init failure
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 22:12:02 +02:00
Andreas Rheinhardt
8b32a6f1aa avcodec/dnxhdenc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 22:12:02 +02:00
Andreas Rheinhardt
3c1208be02 avcodec/dnxhdenc: Use av_memdup() instead of av_malloc()+memcpy()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 22:12:02 +02:00
Andreas Rheinhardt
eb583b3cb9 avcodec/dnxhdenc: Fix segfault when using too many slice threads
The DNXHD encoder's context contains an array of 32 pointers to
DNXHDEncContexts used in case of slice threading; when trying
to use more than 32 threads with slice threading, the encoder's init
function errors out, but the close function takes avctx->thread_count
at face value and tries to free inexistent elements of the array,
leading to potential crashes.

Fix this by modifying the check used to decide whether the slice
contexts should be freed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 22:12:02 +02:00
Andreas Rheinhardt
b539ed3fd5 avcodec/dnxhddec: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 22:12:02 +02:00
Andreas Rheinhardt
413ec81ba8 avcodec/pngenc: Mark encoders as init-threadsafe
Initializing zlib in the way we do here is threadsafe, see
https://www.zlib.net/zlib_faq.html#faq21

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 22:12:02 +02:00
Andreas Rheinhardt
f100a7de5c avcodec/exrenc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 22:12:02 +02:00
Andreas Rheinhardt
3c3712ee2b avcodec/wmaprodec: Make decoders init-threadsafe
In this case this actually fixes a potential data race: The static VLC
tables were reinitialized every time an AVCodecContext has been
initialized; while the mutex in avcodec_open2() ensured that the VLCs
could not be initialized concurrently by multiple threads, nothing
guaranteed that these VLCs are not read concurrently (when decoding a
packet with an already initialized AVCodecContext) while another thread
initializes them. This is undefined behaviour despite the values being
written coinciding with the earlier values.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 22:12:02 +02:00
Andreas Rheinhardt
a1b0148366 avcodec/wmaprodec: Check ff_mdct_init() for failure
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 22:12:01 +02:00
Andreas Rheinhardt
6fc4f28a11 avcodec/tscc: Mark decoder as init-threadsafe
Initializing zlib in the way we do here is threadsafe, see
https://www.zlib.net/zlib_faq.html#faq21

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 22:12:01 +02:00
Andreas Rheinhardt
54cb70594d avcodec/tscc: Don't free uninitialized z_stream
It is not documented to be safe to call inflateEnd() on a z_stream
that has not been successfully initialized via inflateInit(); so
record whether it has been successfully initialized.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 22:12:01 +02:00
Andreas Rheinhardt
730b8182b1 avcodec/mscc: Mark decoders as init-threadsafe
Initializing zlib in the way we do here is threadsafe, see
https://www.zlib.net/zlib_faq.html#faq21

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 22:12:01 +02:00
Andreas Rheinhardt
37670f7d07 avcodec/vp8: Mark decoders as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 22:12:01 +02:00
Andreas Rheinhardt
e80d35afa8 avcodec/vp9: Mark decoder as init-threadsafe
It only allocates some AVFrames.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 22:12:01 +02:00
Andreas Rheinhardt
4818ea69d2 avcodec/vp9: Inline function with only one caller into it
The split into vp9_decode_init() and init_frames() is a remnant
of using init_thread_copy() for frame-threading; the latter has
been removed, so there is no reason for init_frames() not be part
of vp9_decode_init().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 22:12:01 +02:00
Andreas Rheinhardt
7aa8c95f47 avcodec/vp9: Remove excessive log messages
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 22:12:01 +02:00
Andreas Rheinhardt
3572590e75 avcodec/vp9: Cleanup generically on init failure
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 22:12:01 +02:00
Andreas Rheinhardt
4848a7abff avcodec/rawdec: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-10 22:12:01 +02:00
Andreas Rheinhardt
9e1f7e2086 avcodec/ljpegenc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-05-10 22:12:01 +02:00
Xuewei Meng
f8d910e90f GSoC: Add guided filter
Add examples on how to use this filter, and improve the code style.
Implement the slice-level parallelism for guided filter.
Add the basic version of guided filter.

Signed-off-by: Xuewei Meng <xwmeng96@gmail.com>
Reviewed-by: Steven Liu <liuqi05@kuaishou.com>
2021-05-10 13:34:29 +08:00
Gyan Doshi
8649f5dca6 doc/muxers: note movie_timescale option in movenc 2021-05-09 15:03:39 +05:30
Anton Khirnov
c6ae560a18 lavf/framecrcenc: do not hash side data
There are no guarantees that all side data types have the same
representation on all platforms.

Tests that change output due to this:

id3v2-priv-remux, cover-art-mp3-id3v2-remux, gapless-mp3: SKIP_SAMPLES,
which is tested by fate-gapless-mp3-side-data

matroska-vp8-alpha-remux: MATROSKA_BLOCKADDITIONAL, which is tested by
remux itself (side data is written into output)

matroska-mastering-display-metadata: MASTERING_DISPLAY_METADATA and
CONTENT_LIGHT_LEVEL, which are tested by ffprobe invocation in the same
test

matroska-spherical-mono-remux: STEREO3D and SPHERICAL, which are tested
by ffprobe invocation in the same test

segment-mp4-to-ts: MPEGTS_STREAM_ID, which is tested by ts remuxing
tests

webm-webvtt-remux: WEBVTT_IDENTIFIER/SETTINGS, which is tested by the
ffprobe invocation in the same test

mxf-d10-user-comments: CPB_PROPERTIES, which is tested by mxf-probe-d10

mov-cover-image: SKIP_SAMPLES, which is tested for mov by
mov-aac-2048-priming

copy-trac3074: AUDIO_SERVICE_TYPE, which is tested by fate-hls-fmp4_ac3
2021-05-09 11:07:20 +02:00
Anton Khirnov
4d28a6756c fate: drop the vp8-alpha test
It is redundant with matroska-vp8-alpha-remux.
2021-05-09 11:07:20 +02:00
Anton Khirnov
af607a8838 fate-run.sh: print stream side data in probeaudiostream()
Adds a test for reading AUDIO_SERVICE_TYPE in fate-hls-fmp4_ac3
2021-05-09 11:07:20 +02:00
Anton Khirnov
1b3bd52e54 fate-webm-webvtt-remux: print packet side data in ffprobe output 2021-05-09 11:07:20 +02:00
Anton Khirnov
958bea5248 fate/demux: convert flv-demux to ffprobe
It can handle side data cleanly.
2021-05-09 11:07:20 +02:00
Anton Khirnov
471a9e706b fate-ts-demux: convert to ffprobe
It can handle side data cleanly.
2021-05-09 11:07:20 +02:00
Anton Khirnov
c89460f096 fate-ts-opus-demux: convert to ffprobe
It can handle side data cleanly.
2021-05-09 11:07:20 +02:00
Anton Khirnov
99fb6ffd82 fate-ts-small-demux: convert to ffprobe
It can handle side data cleanly.
2021-05-09 11:07:19 +02:00
Anton Khirnov
40b33ee693 fate/gapless: add a test for skip samples side data 2021-05-09 11:07:17 +02:00
Anton Khirnov
b8041fb838 fate-oggopus-demux: convert to ffprobe
It can print side data cleanly.
2021-05-09 10:59:21 +02:00
Anton Khirnov
677a030b26 ffprobe: support printing more packet side data types
Specifically WebVTT subtitle data, CPB properties, audio service type
and mpegts stream id.
2021-05-09 10:59:21 +02:00
Anton Khirnov
544631cab1 ffprobe: only hash extradata when it is present
Passing zero-sized/NULL buffers to av_hash_update() is invalid and may
crash with certain hashes.
2021-05-09 10:59:21 +02:00
Matthias Troffaes
13180968f8 configure: fix some filter dependencies
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2021-05-09 10:17:49 +02:00
Cameron Cawley
bc86515c4f
avformat/rpl: Support files containing Replay IMA ADPCM audio
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-05-09 17:01:34 +10:00
Cameron Cawley
5c7313c740
avcodec: Implement Acorn Replay IMA ADPCM decoder
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-05-09 17:01:27 +10:00
James Almer
b4e7fc4b4b avcodec/avpacket: use av_malloc() to allocate an AVPacket
av_mallocz() is superfluous as get_packet_defaults() is called immediately
after it's allocated, which will initialize the entire struct to default
values.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-08 18:36:31 -03:00
James Almer
0a029906b2 avcodec/avpacket: always initialize the new packet in avpriv_packet_list_put()
If a copy callback is provided by the caller, the packet passed to it
was zeroed instead of initialized with default values.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-08 18:31:56 -03:00
Jan Ekström
ffd1316e44 avformat/matroskadec: remove special handling of av1c extradata
Libavcodec can now handle the standard AV1CodecConfigurationRecord
extradata as-is.
2021-05-08 15:27:00 +03:00
Jan Ekström
45e3b6a68b avformat/mov: remove special handling of av1c extradata
Libavcodec can now handle the AV1CodecConfigurationRecord structure
as-is when passed as extradata, so the standard behavior of
read-box-into-extradata should suffice, just like with AVC and HEVC.
2021-05-08 15:27:00 +03:00
Andreas Rheinhardt
e2301feabc avcodec/h263, h263data: Move ff_h263_init_rl_inter to h263.c
The SVQ1 decoder does not need mpegvideo or rl.c, but it uses stuff
from h263data.c. But since 61fe481586
h263data.c called ff_rl_init() and this of course led to build errors
when the SVQ1 decoder is enabled and mpegvideo disabled.

Fix this by moving ff_h263_init_rl_inter() to h263.c.
Fixes ticket #9224.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-07 21:33:35 +02:00
Andreas Rheinhardt
8f588eea8e configure: Add missing mpegvideo dependency for IPU decoder
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-07 21:33:35 +02:00
James Almer
5b5398722e avcodec: be more explicit about the buffer size in get_encode_buffer documentation
Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-07 13:16:14 -03:00
Michael Niedermayer
f7987ce966 avcodec/alsdec: Fix decoding error with mono audio files
highest_decoded_channel is modified to serve as meant.

Reported-by: Noboru Harada <noboru@ieee.org>

Regression since: a11aa5f3ed
Fixes: Sin48k16bit1ch.mp4
Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-05-07 17:53:46 +02:00
Shiyou Yin
ab04fedaaa mips: Fix potential illegal instruction error.
MSA2 optimizations are attached to MSA macros in generic_macros_msa.h.
It's difficult to do runtime check for them. Remove this part of code
can make it more robust. H264 1080p decoding: 5.13x==>5.12x.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-05-07 17:53:23 +02:00
gxw
464d28c070 avcodec/mips: Refine ff_h264_h_lpf_luma_inter_msa
Using mask to avoid judgment, H264 4K decoding speed
improved about 0.1fps tested on 3A4000

Signed-off-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-05-07 17:53:23 +02:00
gxw
6458c6bdb4 avcodec/mips: Optimize function ff_h264_loop_filter_strength_msa.
Speed of decoding H264 1080P: 5.05x ==> 5.13x

Signed-off-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-05-07 17:53:23 +02:00