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

105822 Commits

Author SHA1 Message Date
Andreas Schneider
59c647bcf3 avcodec/exif: Don't include tiff.h in exif.h
The exif.h header doesn't use anything from tiff.h. We also just need
to include tiff_common.h in .c files where it actually used.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-14 11:33:53 +01:00
Andreas Schneider
cf535d6d51 avcodec/exif: Include bytestream.h for GetByteContext
bytestream.h should be directly included for GetByteContext and not
rely on other headers to include it. It could be removed from there.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-14 11:32:08 +01:00
Andreas Rheinhardt
71547cb7b3 avcodec/pthread_frame: Remove nonsense error message
If a frame-threaded decoder with inter-frame dependencies
returns an error when decoding a frame and the returned frame
isn't clean, an error message is emitted claiming that this
is a bug. This seems to be based upon the thinking that
in this case a ThreadFrame has not been properly unreferenced.
Yet this is wrong, as decoders with inter-frame dependencies
don't use the frame for output for synchronization and therefore
don't use ThreadFrames at all for this. So unreferencing
this frame generically is fine and not a bug.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-14 10:13:37 +01:00
Andreas Rheinhardt
1b6b110f2f avcodec/vc1: Fix indentation
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-14 10:13:16 +01:00
Andreas Rheinhardt
c38a8576fe avcodec/8bps: Mark decoder as init-threadsafe
The only unorthodox thing that this codec's init function does
is calling ff_get_format(). Yet this is supposed to be save,
as any get_format callback already has to deal with the scenario
of different AVCodecContext's calling it simultaneously.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-14 10:12:31 +01:00
Limin Wang
d15f65c469 avcodec/videotoolbox: add internal.h for header depenedency
Fixes build failures for videotoolbox

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-14 09:19:27 +01:00
Andreas Rheinhardt
71d3e717fb avcodec/mpegvideo_xvmc: Add missing mpegvideodec.h inclusion
Forgotten in 965cfc6684.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-14 09:16:36 +01:00
Stephen Hutchinson
da9cc25c88 configure: check avisynth header version
The headers from version 3.7.1 are needed in order to support
parsing of frame properties. avs/version.h has been generated
as part of the AviSynth+ build process for a long time, but was
never installed with the includes until version 3.7.1a. Checking
for the presence of avs/version.h might have been sufficient,
but a version check mechanism might be useful in the future.

This does not change the version compatibility with the library
itself; previous 3.x versions of AviSynth+ as well as AviSynth 2.6
can still be used with the demuxer.

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
2022-02-13 18:24:42 -05:00
Stephen Hutchinson
af69e4c241 avisynth: use AviSynth+'s frame properties to set various fields
* Field Order
* Chroma Location
* Color Transfer Characteristics
* Color Range
* Color Primaries
* Matrix Coefficients

The existing TFF/BFF detection is retained as a fallback for
older versions of AviSynth that can't access frame properties.
The other properties have no legacy equivalent to detect them.

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
2022-02-13 18:24:37 -05:00
emcodem
05c492eeb0 avisynth: corrected interlace detection
AviSynth works on frame-based video by default, which can
be either progressive or interlaced. Some filters can break
frames into half-height fields, at which point it considers
the clip to be field-based (avs_is_field_based can be used
to check for this situation).

To properly detect the field order of a typical video clip,
the frame needs to have been weaved back together already,
so avs_is_field_based should actually report 'false' when
checked.

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
2022-02-13 18:24:33 -05:00
Andreas Rheinhardt
66d4c72162 avcodec/mpegpicture: Constify src parameter of ff_update_picture_tables
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:49:30 +01:00
Andreas Rheinhardt
8b856a9e53 avcodec/motion_est: Constify mv-table parameters where possible
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:49:29 +01:00
Andreas Rheinhardt
32ce3b7168 avcodec/mpegutils.h: Move DELAYED_PIC_REF macro to h264dec.h
It is only used by the H.264 decoder (as well as the dirac decoder,
which already uses a local copy).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:49:29 +01:00
Andreas Rheinhardt
629259bdb5 avcodec/mpegpicture: Don't check for DELAYED_PIC_REF
It is not set any more by any user of mpegvideo/mpegpicture.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:49:29 +01:00
Andreas Rheinhardt
c3e780c39b avcodec/mpegvideo_enc: Remove unused parameter from encode_mb_hq()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:49:29 +01:00
Andreas Rheinhardt
cbf6cd91e6 avcodec/mpegvideo_enc: Remove unused function parameters
Seems to have been always unused since these functions were introduced
in 1f0cd30fd9.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:49:29 +01:00
Andreas Rheinhardt
314e0a821e avcodec/mpegvideo: Constify src of ff_update_duplicate_context()
Also do the same for update_duplicate_context_after_me()
in mpegvideo_enc.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:49:29 +01:00
Andreas Rheinhardt
6d39f5ffb0 avcodec/mpegvideo_dec: Remove commented-out cruft
This piece of code has been added in an already commented-out state
in commit 158c7f059c. It certainly
doesn't make sense now (if ever) because new_picture_ptr it used
has been removed in 6571e41dcd
(and new_picture is only used for encoding).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:49:29 +01:00
Andreas Rheinhardt
18e75f493d avcodec/mpegvideo: Remove write-only [fb]_code
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:49:29 +01:00
Andreas Rheinhardt
6c2ce16954 avcodec/mpegvideo_enc: Don't set picture_in_gop_number for slice threads
They don't ever read this value.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:49:29 +01:00
Andreas Rheinhardt
7a774a4e93 avcodec/mpegvideo_enc: Don't find encoder by ID
mpegvideo-based encoders supporting bframes implement this
by opening encoders of their own to test how long the chains
of bframes are supposed to be. The needed AVCodec was obtained
via avcodec_find_encoder(). This is complicated, as the current
encoder can be directly obtained. And it also is not guaranteed
that one actually gets the current encoder or not another encoder
for the same codec ID (the latter does not seem to be the case now).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:49:29 +01:00
Andreas Rheinhardt
965cfc6684 avcodec/mpegvideo: Move decoder-only stuff to a new header
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:49:29 +01:00
Andreas Rheinhardt
746e7102be avcodec/mpegvideo: Move encoder-only stuff to a new header
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:49:29 +01:00
Andreas Rheinhardt
9fa4e0e555 avcodec/rv10.h: Split header into decoder- and encoder-only parts
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:49:29 +01:00
Andreas Rheinhardt
9856f6a443 avcodec/mpeg12.h: Move encoder-only stuff into a new header
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:49:29 +01:00
Andreas Rheinhardt
977d8b6297 avcodec/mpeg12.h: Move decoder-only stuff to a new header
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:49:29 +01:00
Andreas Rheinhardt
f78ffe382c avcodec/flv.h: Split header into encoder-only and decoder-only headers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:45:39 +01:00
Andreas Rheinhardt
876d0afe1f avcodec/mpeg4video.h: Move encoder-only parts in a new file
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:41:57 +01:00
Andreas Rheinhardt
1187765f3b avcodec/mpeg4video.h: Move decoder-only parts to a new header
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:41:57 +01:00
Andreas Rheinhardt
20d74fb09d avcodec/h263.h: Move encoder-only stuff to a new header h263enc.h
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:41:43 +01:00
Andreas Rheinhardt
20033c7da4 avcodec/msmpegenc: Add MSMPEG4EncContext and move ac_stats to it
Also avoid the allocation by making it part of the context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:36:50 +01:00
Andreas Rheinhardt
e2cf60f040 avcodec/msmpeg4.h: Move decoder-only parts to a new header
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 19:35:58 +01:00
Andreas Rheinhardt
9f2b566301 avcodec/msmpeg4.h: Move encoder-only stuff to a new header
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 15:28:49 +01:00
Andreas Rheinhardt
78087da47c avcodec/wmv2.h: Move encoder- and decoder-only parts to new headers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 15:28:17 +01:00
Andreas Rheinhardt
cc90478967 avcodec/wmv2: Split Wmv2Context into decoder and encoder context
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 15:27:48 +01:00
Andreas Rheinhardt
584f26db0d avcodec/wmv2: Move initializing abt_scantables to the decoder
They are not used by the encoder at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 15:27:25 +01:00
Andreas Rheinhardt
b81a29d180 avcodec/idctdsp: Constify the permutation parameter of ff_init_scantable
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 15:25:41 +01:00
Andreas Rheinhardt
e911f5546f avcodec/h261enc: Pass PutBitContext directly in h261_encode_motion()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 15:25:13 +01:00
Andreas Rheinhardt
8401b94602 avcodec/h261: Move encoder-only stuff to a new header
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 15:19:43 +01:00
Andreas Rheinhardt
d5e87df902 avcodec/h261: Separate decode and encode contexts
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 15:18:24 +01:00
Andreas Rheinhardt
725e2300af avcodec/mpegvideo: Enable private contexts
MpegEncContext is used by many different codecs and
every one of these uses just a subset of its fields.
If one tries to separate this and e.g. add a real MpegContext
and extension structures (say MpegDecContext and MpegEncContext),
one runs into two difficulties:

a) Some code is shared between decoder and encoder of
the same format and they therefore use the same contexts,
either MpegEncContext itself or identical extensions thereof.
The latter is the case for H.261 as well as WMV2.
b) In case of slice threading, the generic code can only allocate
and initialize the structure it knows about; right now this is
an MpegEncContext. If the codec has an even more extensive structure,
it is only available for the main thread's MpegEncContext.
Fixing this would involve making ff_mpv_common_init() aware
of the size the size of slice context to allocate and would be
part of separating the main thread's context from the slice contexts
in general.

This commit only intends to tackle the first issue by adding
a pointer to MpegEncContext that codecs can set to a common
context so that the aforementioned codecs can use this context
(together with the MpegEncContext) in their common code.
This will allow to move fields only used by the main thread
to more specialized contexts.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 15:16:28 +01:00
Danny Wu
68595b46cb fftools/ffmpeg: Restore DTS correction for VP9 copies
Fixes ticket 9086.

Since early 2021, some of YouTube's VP9 encodes have non-monotonous DTS.
This makes ffmpeg fatally fail when trying to copy or encode the V9 video.

ffmpeg already includes functionality to correct this, however it was
disabled without explanation for VP9 stream copies in
2e6636aa87

This patch restores the DTS correction logic, and allows ffmpeg to correctly
encode (invalid) videos produced by youtube.com. I have verified that frames
are NOT being cut (so it does not re-introduce 4313).

Reviwed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-02-13 10:46:47 -03:00
Andreas Rheinhardt
2233ef1db9 avcodec/exr: Mark decoder as init-threadsafe
This decoder does not initialize any static data in its init function.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 12:36:05 +01:00
Andreas Rheinhardt
2d29058fb2 avcodec/amrwbdec: Mark decoder as init-threadsafe
It performs no initialization of static data in its init function.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 12:35:59 +01:00
Andreas Rheinhardt
903e871858 avcodec/amrnbdec: Mark decoder as init-threadsafe
It performs no initialization of static data during its init function.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 12:35:39 +01:00
Andreas Rheinhardt
b45060114d avcodec/vp[56]: Mark decoders as init-threadsafe
Nothing with static storage duration is initialized by these codecs.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 12:35:30 +01:00
Andreas Rheinhardt
ac6c1080cd avcodec/vp56: Avoid functions with only one caller
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 12:35:16 +01:00
Andreas Rheinhardt
ac9f8d7c02 avcodec/vp6: Avoid code duplication when initializing VP56 contexts
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 12:34:55 +01:00
Andreas Rheinhardt
3cbef22f8f avcodec/vp6: Avoid allocation for alpha_context
Reviewed-by: Peter Ross <pross@xvid.org>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 12:26:18 +01:00
Andreas Rheinhardt
55379dac53 avcodec/vp56: Cleanup generically in case of init failure
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13 12:26:12 +01:00