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

104950 Commits

Author SHA1 Message Date
Andreas Rheinhardt
16b1df7541 avformat/wvenc: Make init function out of write_header
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-20 14:29:01 +01:00
Andreas Rheinhardt
ba27e248cf avformat/crcenc: Make init function out of write_header
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-20 14:29:01 +01:00
Andreas Rheinhardt
631e31773b avformat/sdp: Fix use of uninitialised value
Fixes Coverity ticket #1495831.
Regression since fe31708eaa.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-20 02:37:08 +01:00
Aman Karmani
9c590b76f4 avutil: add objc.h to SKIPHEADERS
Signed-off-by: Aman Karmani <aman@tmm1.net>
2021-12-19 09:41:16 -08:00
Aman Karmani
11aa9ca153 configure: fix metal detection and respect explicit disable
Signed-off-by: Aman Karmani <aman@tmm1.net>
2021-12-19 08:29:00 -08:00
Haihao Xiang
bbe9faa01c lavc/qsvenc: dump parameters for mjpeg encoding in verbose mode
Signed-off-by: Zhong Li <zhongli_dev@126.com>
2021-12-19 22:25:31 +08:00
Haihao Xiang
45801af11f lavc/qsvenc: dump parameters for VP9 encoding in verbose mode
Signed-off-by: Zhong Li <zhongli_dev@126.com>
2021-12-19 22:16:39 +08:00
Haihao Xiang
2544f709ba lavc/qsvenc: add VP9 profiles
Signed-off-by: Zhong Li <zhongli_dev@126.com>
2021-12-19 22:16:21 +08:00
Haihao Xiang
50c38e1a44 lavc/qsvenc: define profile array per codec
The SDK defines HEVC, VP9 and AV1 profiles in the same values
e.g.
MFX_PROFILE_HEVC_MAIN             =1,
MFX_PROFILE_VP9_0                 =1,
MFX_PROFILE_AV1_MAIN              =1,

To avoid potential errors when adding VP9, AV1 profiles later,
this patch defines profile array per codec.

Signed-off-by: Zhong Li <zhongli_dev@126.com>
2021-12-19 22:14:51 +08:00
Haihao Xiang
3857ecbe70 lavc/qsvenc: remove VC1 profiles
The SDK doesn't support VC1 encoding. In addition, both
MFX_PROFILE_VC1_SIMPLE and MFX_PROFILE_HEVC_MAIN are 1 in the SDK, HEVC
main profile is recognized as simple profile in the verbose output if
don't remove VC1 profiles.

$ ffmpeg -v verbose -qsv_device /dev/dri/renderD129 -f lavfi -i
yuvtestsrc -c:v hevc_qsv -f null -

[hevc_qsv @ 0x55bdf7eb4eb0] profile: simple; level: 21

Signed-off-by: Zhong Li <zhongli_dev@126.com>
2021-12-19 22:13:58 +08:00
Andreas Rheinhardt
98f87c3d29 avcodec/ffv1dec: Don't copy unused field
The decoder always uses AVCodecContext.bits_per_raw_sample.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-19 01:18:47 +01:00
Andreas Rheinhardt
485121b92c avcodec/ffv1, ffv1dec: Add const where appropriate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-19 01:18:07 +01:00
Andreas Rheinhardt
17605d1a4a avcodec/ffv1dec: Remove redundant writes, fix races
Every modification of the data that is copied in update_thread_context()
is a data race if it happens after ff_thread_finish_setup. ffv1dec's
update_thread_context() simply uses memcpy for updating the new context,
so that every modification of the src's context is a race.
Some of these modifications are unnecessary: picture_number is write-only
for the decoder and cur will be reset when decoding the next frame anyway.
So remove them. And while just at it, also don't set cur for the slice
contexts as this variable is write-only.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-19 01:14:39 +01:00
Sebastian Kirmayer
dfd06ee710 avutil/twofish: Fixed decryption
The previous implementation swapped the two halves of the plaintext. The
existing tests only decrypted data with a plaintext of all zeroes, which is
not affected by swapping the halves. Tests which detect the old buggy behavior
have been added.

Signed-off-by: Sebastian Kirmayer <ffmpeg@kirmayer.eu>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-19 01:02:59 +01:00
Andreas Rheinhardt
bb69b734c7 avformat/mxfenc: Avoid allocation for timecode track
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-19 01:01:47 +01:00
Andreas Rheinhardt
25ddf888d8 avformat/mxfenc: Use smaller types to make struct smaller
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-19 00:49:33 +01:00
Andreas Rheinhardt
c26730ed8f tests/dnn: Make DNN tests regular libavfilter tests
They test libavfilter internal API, so they should be libavfilter
test programs (which implies: linked statically to libavfilter
to access internal APIs and linked normally (statically or dynamically
depending upon the build configuration) against all the other libs).

Right now, they are always linked statically against all libs,
which is a significant size waste compared to shared libs as all
of libavcodec has been pulled in despite not being really used.
This also leads to linking failures on systems for which av_export_avutil
is intended: libavcodec does not expect to be linked statically
against the library providing avpriv_(cga|vga16)_font in this case.
This is fixed by this commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-19 00:46:29 +01:00
Andreas Rheinhardt
69a45b8a49 avcodec/Makefile: Remove superfluous avformat->DNXHD dependencies
There is no mxfenc dependency any more since commit
b9a26b9d55.
Also remove a dnxhddata.h inclusion in mxfenc that was forgotten
in the very same commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-19 00:46:16 +01:00
Aman Karmani
4ac869ca2a avfilter: add vf_yadif_videotoolbox
deinterlaces CVPixelBuffers, i.e. AV_PIX_FMT_VIDEOTOOLBOX frames

for example, an interlaced mpeg2 video can be decoded by avcodec,
uploaded into a CVPixelBuffer, deinterlaced by Metal, and then
encoded to h264 by VideoToolbox as follows:

    ffmpeg \
           -init_hw_device videotoolbox \
           -i interlaced.ts \
           -vf hwupload,yadif_videotoolbox \
           -c:v h264_videotoolbox \
           -b:v 2000k \
           -c:a copy \
           -y progressive.ts

(note that uploading AVFrame into CVPixelBuffer via hwupload
 requires 504c60660d)

this work is sponsored by Fancy Bits LLC

Reviewed-by: Ridley Combs <rcombs@rcombs.me>
Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Aman Karmani <aman@tmm1.net>
2021-12-18 11:57:31 -08:00
Aman Karmani
ecee6af8bd avfilter: add metal utilities
Reviewed-by: Ridley Combs <rcombs@rcombs.me>
Signed-off-by: Aman Karmani <aman@tmm1.net>
2021-12-18 11:55:47 -08:00
Aman Karmani
edca1fa17c avutil: add obj-c helpers into header-only include
Reviewed-by: Ridley Combs <rcombs@rcombs.me>
Signed-off-by: Aman Karmani <aman@tmm1.net>
2021-12-18 11:55:47 -08:00
Aman Karmani
c975946577 build: detect Metal.framework and build .metal files
Reviewed-by: Ridley Combs <rcombs@rcombs.me>
Signed-off-by: Aman Karmani <aman@tmm1.net>
2021-12-18 11:55:47 -08:00
Aman Karmani
ad3c19dc9e avfilter/vf_yadif_cuda: simplify filter definition
Signed-off-by: Aman Karmani <aman@tmm1.net>
Signed-off-by: Philip Langdale <philipl@overt.org>
2021-12-18 11:55:47 -08:00
Pierre-Anthony Lemieux
c8b5f2848d
avformat/aviobuf: ffio_copy_url_options
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-12-19 00:35:24 +10:00
Paul B Mahol
a8a7c5d502 avcodec/thd: fix special stereo support 2021-12-18 10:20:24 +01:00
Paul B Mahol
8718f8cfaf avcodec/cdgraphics: fix transparency handling 2021-12-18 10:20:24 +01:00
Paul B Mahol
1c49d74fad avcodec/cdgraphics: unbreak rendering of vertical scrolling 2021-12-18 10:20:24 +01:00
Michael Niedermayer
68457c1e85 avcodec/alacdsp: fix integer overflow in decorrelate_stereo()
Fixes: signed integer overflow: -16777216 * 131 cannot be represented in type 'int'
Fixes: 23835/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5669943160078336
Fixes: 41101/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-4636330705944576

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-17 16:15:20 +01:00
Anton Khirnov
b780b6db64 lavc/encode: set frame_number for encoders using receive_packet()
It is currently set in encode_simple_internal(), which is only called
for encoders using the "simple" encoding API.
2021-12-17 10:24:34 +01:00
Anton Khirnov
67aceaf4ad lavc/encode: improve the empty frame check
Test for buf[0] rather than data[0] (which is broken for some hwaccel
formats).
2021-12-17 10:24:28 +01:00
Anton Khirnov
fe31708eaa lavf/sdp: add more thorough error handling
Return error codes when constructing a stream config fails, rather than
just disregarding the failure and continuing.
Propagate the error codes from av_sdp_create().
2021-12-17 10:23:07 +01:00
Anton Khirnov
b0518f9977 lavf/sdp: reindent switch() according to our conventions 2021-12-17 10:22:46 +01:00
Anton Khirnov
230646751d lavf/sdp: add const qualifiers where appropriate
Declares that these structs are read-only for this code.
2021-12-17 10:22:41 +01:00
Andreas Rheinhardt
3c9778d342 avcodec/mpegvideo_enc: Reindent after the previous commit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-17 02:54:52 +01:00
Andreas Rheinhardt
a595717d21 avcodec/mpegvideo_enc: Remove some impossible branches
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-17 02:54:52 +01:00
Andreas Rheinhardt
9f906f3114 avcodec/mpegvideo_enc: Combine some checks
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-17 02:54:52 +01:00
Andreas Rheinhardt
090cd1394f avcodec/mpegvideo: Reindentation
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-17 02:54:52 +01:00
Andreas Rheinhardt
f860dfe555 avcodec/h263: Remove declaration of inexistent function
Forgotten in c46eeae2a8.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-17 02:54:52 +01:00
Andreas Rheinhardt
9088cc6df9 avcodec/mpegvideo: Allocate several buffers jointly
Reduces the amount of allocations and frees.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-17 02:54:52 +01:00
Andreas Rheinhardt
2ac3e32802 avcodec/mpegvideo: Don't allocate encoder-only buffers when decoding
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-17 02:54:52 +01:00
Andreas Rheinhardt
b72723d415 avcodec/mpegvideo_enc, vc1dec: Remove always-false check
Mpeg1EncContext.droppable is only nonzero for the FLV decoder.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-17 02:54:45 +01:00
Andreas Rheinhardt
0abdf63ae7 avcodec/mpegvideo: Don't update encoder-only fields for decoders
ff_mpeg_update_thread_context() is only used by decoders.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-17 01:53:50 +01:00
Andreas Rheinhardt
81c6b8ffe8 avcodec/mpegvideo: Move closed_gop to Mpeg1Context
Only used there and only by the main thread.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-17 01:53:50 +01:00
Michael Niedermayer
dd94912479 avformat/4xm: Check for duplicate track ids
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-16 22:31:13 +01:00
Michael Niedermayer
0dcd95ef8a avformat/4xm: Consider max_streams on reallocating tracks array
Fixes: OOM
Fixes: 41595/clusterfuzz-testcase-minimized-ffmpeg_dem_FOURXM_fuzzer-6355979363549184

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-16 22:31:13 +01:00
Michael Niedermayer
e22ec484aa avformat/cinedec: Avoid repeatedly allocating packets beyond the input
Fixes: Timeout
Fixes: 41025/clusterfuzz-testcase-minimized-ffmpeg_dem_CINE_fuzzer-5540848285122560

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-16 22:31:13 +01:00
Michael Niedermayer
8e96410e1b avcodec/speexdec: Avoid violating the vector_fmul_scalar() API
Fixes: out of array access
Fixes: 40054/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEX_fuzzer-6713285764841472

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-16 22:31:13 +01:00
Michael Niedermayer
562021e2fd avformat/mov: Check next offset in mov_read_dref()
Fixes: signed integer overflow: 9223372036200463215 + 1109914409 cannot be represented in type 'long'
Fixes: 41480/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6553086177443840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-16 22:31:13 +01:00
Michael Niedermayer
bf1e93bdc9 avformat/vivo: Favor setting fps from explicit fractions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-16 22:31:13 +01:00
Michael Niedermayer
7b24615565 avformat/vivo: Do not use the general expression evaluator for parsing a floating point value
Fixes: Timeout
Fixes: 41564/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVO_fuzzer-6309014024093696

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