1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-18 03:19:31 +02:00
Commit Graph

100733 Commits

Author SHA1 Message Date
Paul B Mahol
97bc6900e6 avfilter/vf_readeia608: add support for commands 2020-11-24 22:34:18 +01:00
Musee Ullah
7bb8b81955 avfilter/vf_xfade: ensure metadata is copied to transition frames
I was having an issue where, using a filter chain of xfade -> ass, the
colors on the subtitles were incorrect only on the frames where xfade
was being used. This resolves that issue for me.

Signed-off-by: Musee Ullah <lae@lae.is>
2020-11-24 14:35:41 +01:00
Paul B Mahol
c6a7ca271b avfilter/af_biquads: make sure that biquad filter still works 2020-11-24 14:26:47 +01:00
Paul B Mahol
040e989223 avfilter/af_biquads: do not abort filtering on bogus options
Instead, continue returning unfiltered input.
2020-11-24 12:03:23 +01:00
Andreas Rheinhardt
08a992e018 avcodec/mlpdec: Avoid code duplication when initializing VLCs
Reviewed-by: Jai Luthra <me@jailuthra.in>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:04 +01:00
Andreas Rheinhardt
34aa85cd91 avcodec/mlpdec: Make decoders init-threadsafe
Reviewed-by: Jai Luthra <me@jailuthra.in>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:04 +01:00
Andreas Rheinhardt
1f0e27dd66 avcodec/mlp: Make initializing CRCs thread-safe
Reviewed-by: Jai Luthra <me@jailuthra.in>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
79ab46ac6e avcodec/mpegaudiodec_template: Don't use unnecessarily many VLC bits
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
37f510d3f4 avcodec/mv30: Don't check for errors for complete VLCs
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
50d50653d1 avcodec/imm4: Don't use too big VLC table
Using more bits than the longest code has makes no sense.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
195d8ce85e avcodec/aac*: Make initializing ff_aac_pow*sf_tab thread-safe
This table is currently initialized up to three times: Once by the
encoder and twice by the decoders (once by the fixed and once by the
floating-point decoder); each of these initializations is guarded by an
AVOnce, yet the fact that there are three of them implies that there
might be data races (the fact that each entry is only written to once
(to its final value) when initializing means that this is safe in
practice, yet it is still undefined behaviour). Fix this by only
initializing the table from one place that is guarded by a single AVOnce.
This also avoids unnecessary duplications of the init code.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
c4b4cd775a avcodec/aactab: Fix conflicting types for ff_aac_codebook*
The header missed that these are arrays of const pointers (to const
data).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
b81e6437ca avcodec/qdmc: Don't check for errors for complete VLCs
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
e68247d5cf avcodec/hqx: Don't check for errors for complete VLCs
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
a03caa384f avcodec/hqx: Inline constants
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
b1af617f51 avcodec/intrax8: Make ff_intrax8_common_init() thread-safe
In particular, don't reinitialize VLCs every time an IntraX8Context is
initialized.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
802baf212d avcodec/intrax8: Replace always-false check by assert
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
164ce14e5c avcodec/atrac9tab: Add missing static to internal table
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
6612d6d62e avcodec/atrac9dec: Replace av_free() by av_freep() in close function
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
659c61ba7c avcodec/atrac9dec: Don't use unnecessarily large VLC tables
Using more bits for a VLC than the longest code has has no advantage.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
4a9ffce91c avcodec/atrac9dec: Use least max_depth in calls to get_vlc2()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
92209cf4c9 avcodec/atrac9dec: Don't confuse max_depth of VLC with max codelength
The whole point of VLCs with their tables is to read more than one bit
at a time; therefore max_depth, the number of times one has to
(maximally) read further bits is given by ceil(max_code_length / table_bits)
which in the case of ATRAC9's coefficient VLCs gives an upper bound of
two. Instead the maximum length of a code of the given VLC has been used
(which is not even a compile-time constant). Use two instead.

Furthermore, given that this was the only usage of the field containing
the maximum of all the code lengths of a given VLC the field has been
removed from its containing struct.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
0339af05a4 avcodec/truemotion2: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
73b3ea5728 avcodec/g2meet: Use least max_depth in get_vlc2()
The longest AC codes of the standard JPEG tables are 16 bits long; for
the DC tables, the maximum is 11, so using max_depth of two is
sufficient.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
e74621b0a8 avcodec/sheervideo: Add av_cold to build_vlc()
It is an init function even when called from decode_frame().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
f1919dc8fa avcodec/mss4: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
9a61326b0f avcodec/rv40vlc2: Make VLC smaller
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
278a27f651 avcodec/qdm2: Remove outdated comment
Forgotten in f054e309c5.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
16bb8247b4 avcodec/mpegaudiodsp: Make initializing synth windows thread-safe
These arrays are used by the Musepack decoders, the MPEG audio decoders
as well as qdm2 and up until now, these arrays might be initialized more
than once, leading to potential data races as well as unnecessary
initializations. Therefore this commit ensures that each array will only
be initialized once.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
ead3134150 avcodec/mpegaudiodsp: Make ff_mpadsp_init() thread-safe
The only thing missing for this is to make ff_mpadsp_init_x86()
thread-safe; it currently isn't because a static table is initialized
every time ff_mpadsp_init() is called (when ARCH_X86 is true). Solve
this by initializing this table only once, namely together with the
ordinary not-arch specific tables. This also allows to reuse their AVOnce.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
b9c1ab8907 avcodec/fft_template, fft_init_table: Make ff_fft_init() thread-safe
Commit 1af615683e put initializing
the ff_fft_offsets_lut (which is typically used if FFT_FIXED_32)
behind an ff_thread_once() to make ff_fft_init() thread-safe; yet
there is a second place where said table may be initialized which
is not guarded by this AVOnce: ff_fft_init_mips(). MIPS uses this LUT
even for ordinary floating point FFTs, so that ff_fft_init() is not
thread-safe (on MIPS) for both 32bit fixed-point as well as
floating-point FFTs; e.g. ff_mdct_init() inherits this flaw and
therefore initializing e.g. the AAC decoders is not thread-safe (on
MIPS) despite them having FF_CODEC_CAP_INIT_CLEANUP set.

This commit fixes this by moving the AVOnce to fft_init_table.c and
using it to guard all initializations of ff_fft_offsets_lut.

(It is not that bad in practice, because every entry of
ff_fft_offsets_lut is never read during initialization and is only once
ever written to (namely to its final value); but even these are
conflicting actions which are (by definition) data races and lead to
undefined behaviour.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
5c45f7e156 avcodec/mpegaudiodsp: Combine initializing float and int tables
This avoids code duplication in the functions used to initialize them
and allows to remove an AVOnce.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
af7acbb4b8 avcodec/motionpixels: Make decoder init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
cc18bcdd52 avcodec/motionpixels: Use symbols table
If allows us to directly store the deltas in the VLC table and therefore
avoids a level of indirection.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
d3fba74803 avcodec/motionpixels: Don't check for errors for complete VLC
The algorithm used here always creates a complete VLC, so it is
unnecessary to check this again.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
3d95b1a828 avcodec/motionpixels: Be more strict when parsing Huffman trees
This ensures that the number of leafs in the Huffman tree equals the
number it is supposed to be and therefore ensures that the VLC tree is
complete, allowing us to remove checks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
e246ea2535 avcodec/motionpixels: Only create VLC iff it is going to be used
If the Huffman tree consists of only one entry (which has length zero),
no tree is used at all for parsing as the VLC API currently can't handle
this. So it makes no sense to create a VLC in this case.

Commit 41b7389cad added a check for
whether creating the VLC should be skipped, but it also skipped decoding
the packet and it used the wrong check: It checked max_codes_bits,
the maximum length of a code; but this value is only updated iff there is
more than one Huffman entry. So if there is only one Huffman entry, and
there was a previous frame with more than one entry, then a VLC was
created unnecessarily; yet if there was no previous frame with more than
one entry, then this frame will be skipped which is probably
spec-incompliant. I have no sample for the latter.

This commit improves the check to create a VLC iff it is going to be
used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
97da1b4341 avcodec/mimic: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
3066b243e9 avcodec/mimic: Cleanup generically upon init failure
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
e9d06fef62 avcodec/rv10: Make initializing static RV10 VLCs thread-safe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
1463f9edcb avcodec/smacker: Mark decoders as init-threadsafe
Both Smacker audio and video decoders don't use/modify any global state.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
a6423412c1 avcodec/tscc2: Mark tscc2 decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:02 +01:00
Paul B Mahol
68429b9465 avfilter/af_adenorm: add timeline and slice threading support 2020-11-24 11:32:19 +01:00
Paul B Mahol
ee8ecc2730 avfilter/af_asubboost: add timeline and slice threading support 2020-11-24 10:19:04 +01:00
Jean-Baptiste Kempf
052a5993ad avcodec: add SpeedHQ encoder 2020-11-24 09:38:35 +01:00
Jan Ekström
4688017d9a avformat/av1: add support for passing through MP4/Matroska av1c 2020-11-24 10:13:55 +02:00
Jan Ekström
8fbc139e61 avcodec/av1{dec,parser}: move to ff_cbs_read_extradata_from_codec
This lets us re-utilize the extradata-related checks in the CBS
to add support for passing the AV1CodecConfigurationRecord
as extradata as-is without further filtering.
2020-11-24 10:13:55 +02:00
Jan Ekström
a66d1779bb avcodec/cbs_av1: add support for standard MP4/Matroska extradata
This way API clients can just pass the AV1CodecConfigurationRecord
as extradata as-is without further filtering.
2020-11-24 10:13:55 +02:00
Mark Thompson
7bacf60ae5 cbs: Add function to read extradata from an AVCodecContext
This is useful in decoders and parsers, matching the way that bitstream
filters read extradata from AVCodecParameters.
2020-11-24 10:13:55 +02:00
Limin Wang
01eb05207c avdevice/decklink_dec: fix warning for unused variable
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-11-23 16:18:57 +08:00