Commit Graph

109391 Commits

Author SHA1 Message Date
Andreas Rheinhardt 0d84725cb9 avcodec/sei: Add tag to SEI enumeration
This makes it a usable type.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:00:40 +01:00
Andreas Rheinhardt 4d9c0b3efa configure: Add (h264|hevc)_sei subsystems
Currently, several components select atsc_a53, despite
not using anything from it themselves. They only select
it because parsing SEI messages adds an indirect dependency.
But using direct dependencies is more natural, so add
dedicated subsystems for them.

It already allows to remove a superfluous dependency of
the HEVC QSV encoder on hevc_sei and atsc_a53.

Adding new subsystems only becomes effective after a reconfiguration.
In order to force this, some needed headers (which are only included
implicitly before this commit) were included explicitly in
libavformat/allformats.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:00:40 +01:00
Andreas Rheinhardt adf3b01158 avcodec/h264_sei: Don't use GetBit-API for byte-aligned reads
SEI NALUs and several SEI messages are naturally byte-aligned,
so reading them via the bytestream-API is more natural.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:00:40 +01:00
Haihao Xiang 0ae459176b lavfi/vf_vpp_qsv: scale_mode can be applied to color conversion
Reviewed-by: Soft Works <softworkz@hotmail.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-12-01 09:40:40 +08:00
Haihao Xiang 7a856588dc lavfi/qsvvpp: provide a default framerate if needed
VPP in the SDK requires the frame rate to be set to a valid value,
otherwise init will fail, so always set a default framerate when the
input link doesn't have a valid framerate.

Reviewed-by: Soft Works <softworkz@hotmail.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-12-01 09:40:31 +08:00
Haihao Xiang 51bad2e6a7 lavfi/qsvvpp: avoid overriding the returned value
It means more than one output is ready when
MFXVideoVPP_RunFrameVPPAsync() returns MFX_ERR_MORE_SURFACE [1].
Currently the returned value from MFXVideoVPP_RunFrameVPPAsync() might
be overridden, so the check of 'ret == MFX_ERR_MORE_SURFACE' is always
false when MFX_ERR_MORE_SURFACE is returned from
MFXVideoVPP_RunFrameVPPAsync()

[1] https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#video-processing-procedures

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-12-01 09:39:32 +08:00
Chen,Wenbin 50575e24be lavfi/qsvvpp: change the output frame's width and height
Make sure the size of the output frame always matches the agreed upon
image size.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2022-12-01 09:39:32 +08:00
Haihao Xiang 7cfc3c0d26 lavc/qsvenc_h264: don't support P010 format
The SDK will return error if feeding h264_qsv encoder p010 input.

$ ffmpeg -f lavfi -i testsrc -vf "format=p010" -c:v h264_qsv -f null -
[...]
[h264_qsv @ 0x55584888b080] Current pixel format is unsupported
[h264_qsv @ 0x55584888b080] some encoding parameters are not supported
by the QSV runtime. Please double check the input parameters.
Error initializing output stream 0:0 -- Error while opening encoder for
output stream #0:0 - maybe incorrect parameters such as bit_rate, rate,
width or height

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-12-01 09:38:30 +08:00
Wenbin Chen 47fff1eda1 libavcodec/qsvenc.c: Enable MFX_GOP_STRICT when adpative gop is disabled
adaptive_i and adaptive_b cannot work with MFX_GOP_STRICT,
so only enable MFX_GOP_STRICT when these features are disabled.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2022-12-01 09:37:35 +08:00
Haihao Xiang 71cded6aa3 lavc/qsvdec: update HDR side data on output AVFrame
The SDK may provides HDR metadata for HDR streams via mfxExtBuffer
attached on output mfxFrameSurface1

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-12-01 09:36:58 +08:00
Paul B Mahol f52963b48e avcodec/cfhdenc: readjust packet allocation 2022-12-01 00:46:19 +01:00
Paul B Mahol 6a7c70fd8b avcodec/smcenc: fix encoding of width not multiple of 4 2022-11-30 23:59:02 +01:00
Paul B Mahol 14e6ca17e1 avfilter/af_astats: do not give output for 0 samples 2022-11-30 21:19:49 +01:00
Paul B Mahol 569b1a24cd avfilter/avf_showcwt: add yet another mode variant 2022-11-30 20:08:18 +01:00
Paul B Mahol 7d20635aeb avfilter/avf_showcwt: add frame slide mode 2022-11-30 18:06:42 +01:00
Paul B Mahol bcb5ef667d avfilter/avf_showcwt: add some small optimizations 2022-11-30 18:06:42 +01:00
Paul B Mahol d7a5f068c2 avfilter/avf_showcwt: add thread jobs for forward fft per channel 2022-11-29 22:26:56 +01:00
Paul B Mahol 9d717cb846 avfilter/avf_showcwt: flush frames at EOF 2022-11-29 22:26:55 +01:00
Paul B Mahol a08a508105 avfilter/avf_showcwt: refactor code into function 2022-11-29 22:26:55 +01:00
Paul B Mahol 634e29f3c0 avfilter/avf_showcwt: always consume some available samples
Stop waiting for big cache of samples.
2022-11-29 22:26:55 +01:00
James Almer 39dc9a7421 avcodec/libfdk-aacenc: fix version check for the new channel layouts
Signed-off-by: James Almer <jamrial@gmail.com>
2022-11-29 14:56:40 -03:00
James Almer 3d96775f9e avcodec/libfdk-aacenc: add support for 6.1(back) channel layout
Signed-off-by: James Almer <jamrial@gmail.com>
2022-11-29 09:06:21 -03:00
James Almer bb45f41a6b avcodec/libfdk-aacenc: add support for 7.1(top) channel layout
Signed-off-by: James Almer <jamrial@gmail.com>
2022-11-29 09:06:21 -03:00
Sasi Inguva 9d8d7bdffb avformat/mov: Set duration to zero if the duration is UINT_MAX
Fixes some MP4F files which have duration in mdhd set to UINT_MAX instead of zero.

Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-11-29 08:39:32 -03:00
Paul B Mahol d34c1b389e avfilter: add showcwt multimedia filter 2022-11-28 23:18:03 +01:00
Michael Niedermayer 93810a625c
avcodec/mobiclip: Check input size before (re)allocation
Fixes: Timeout
Fixes: 52566/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOBICLIP_fuzzer-4913160050311168

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-11-28 21:20:56 +01:00
Michael Niedermayer a798af91d7
avformat/id3v2: Check taglen in read_uslt()
Fixes: Timeout (read mostly the same data repeatly)
Fixes: 52457/clusterfuzz-testcase-minimized-ffmpeg_dem_ALP_fuzzer-6610706313379840
Fixes: 53098/clusterfuzz-testcase-minimized-ffmpeg_dem_SOL_fuzzer-6481382981632000

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-11-28 21:20:56 +01:00
Michael Niedermayer 65ce417828
avcodec/tiff: Ignore tile_count
Fixes: out of array access
Fixes: 52427/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4849108968144896

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-11-28 21:20:56 +01:00
Michael Niedermayer b32316923d
avcodec/h263dec: Avoid parsing extradata repeatedly
Fixes: Timeout
Fixes: 52329/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-4716563886637056

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-11-28 21:20:56 +01:00
Michael Niedermayer ff2d1bbe73
avcodec/tiff: Avoid 0.0/0.0 in camera_xyz_coeff()
Fixes: division by zero
Fixes: 52230/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5922608915021824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-11-28 21:20:56 +01:00
Michael Niedermayer b2c1a0fc2b
avcodec/apac: use unsigned for sample residual
Fixes: signed integer overflow: -2146670226 + -2227242 cannot be represented in type 'int'
Fixes: 51943/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APAC_fuzzer-5779018251370496

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-11-28 21:20:56 +01:00
Michael Niedermayer 8f975641d7
avcodec/bonk: Use unsigned in predictor_init_state() to avoid undefined behavior
Fixes: signed integer overflow: -5010 * -717450 cannot be represented in type 'int'
Fixes: 53370/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BONK_fuzzer-4945644204195840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-11-28 21:20:56 +01:00
Michael Niedermayer 88f0e05c72
avcodec/pictordec: Remove mid exit branch
This causes the RLE decoder to exit before applying the last RLE run
All images i tested with are unchanged, this makes the special case
for handling the last run unused for non truncated images.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-11-28 21:20:56 +01:00
Michael Niedermayer 74b6ac7ebb
avcodec/ffv1dec: restructure slice coordinate reading a bit
Fixes: signed integer overflow: -1094995528 * 8224 cannot be represented in type 'int'
Fixes: 53508/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_fuzzer-474551033462784

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-11-28 21:20:56 +01:00
Michael Niedermayer 1fdb65d2b7
avcodec/pictordec: Check that the image fits in the input
Fixes: Timeout
Fixes: 53438/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PICTOR_fuzzer-5458939919859712

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpe
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-11-28 21:20:56 +01:00
Michael Niedermayer 5185d5656b
avcodec/dts2pts_bsf: Eliminate some 64bit corner cases
Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 53364/clusterfuzz-testcase-minimized-ffmpeg_BSF_DTS2PTS_fuzzer-4693772269387776

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-11-28 20:58:06 +01:00
Michael Niedermayer aa79560de5
avcodec/mlpdec: Check max matrix instead of max channel in noise check
This is a regression since: adaa06581c
Before this, max_channel and  max_matrix_channel where compared for equality

Fixes: out of array access
Fixes: 53340/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEHD_fuzzer-514959011885875

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-11-28 20:58:05 +01:00
Michael Niedermayer 7792825ad6
avutil/tx: Use unsigned in ff_tx_fft_sr_combine() to avoid undefined behavior
Fixes: signed integer overflow: -1284837070 - 982101618 cannot be represented in type 'int'
Fixes: 53105/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-4848015827664896

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-11-28 20:58:05 +01:00
Lynne 90c17a05aa
x86/tx_float: fix stray change in 15xM FFT and replace imul->lea
Thanks to rorgoroth for bisecting and kurosu for the lea suggestion.
2022-11-28 16:58:12 +01:00
Niklas Haas 48c385fb4c avfilter/vf_libplacebo: support more output formats
Rather than hard-coding AV_PIX_FMT_VULKAN, expand this to the full list
of formats supported by <libplacebo/utils/libav.h>. We re-use the
existing `format` option to allow selecting specific software formats in
addition to specific vulkan hwframe formats.

Some minor changes are necessary to account for the fact that
`ff_vk_filter_config_output` is now only called optionally, the fact
that the output format must now be parsed before `query_format` gets
called, and the fact that we need to call a different function to
retrieve data from the `pl_frame` in the non-hwaccel case.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-11-28 16:05:36 +01:00
Anton Khirnov becbb22eb0 fftools/ffmpeg: cosmetics
Reindent after previous commit and break/split some lines as
appropriate.
2022-11-28 10:28:14 +01:00
Anton Khirnov d04ec7efe3 fftools/ffmpeg: remove a useless inner block
adjust_frame_pts_to_encoder_tb() is so small that this serves no useful
purpose.
2022-11-28 10:28:14 +01:00
Anton Khirnov d60d6d819d fftools/ffmpeg: drop an always-false check 2022-11-28 10:28:14 +01:00
Anton Khirnov 8ee4365ad8 fftools/ffmpeg: only convert video frame pts if we have a frame
Calling adjust_frame_pts_to_encoder_tb() with a NULL frame does not
perform a meaningful action.
2022-11-28 10:28:14 +01:00
Anton Khirnov 617ea07c22 fftools/ffmpeg: call check_recording_time() with actual frame pts
Not its estimated value that will not necessarily be used.
2022-11-28 10:28:14 +01:00
Anton Khirnov 86a71d6b3c fftools/ffmpeg: stop calling adjust_frame_pts_to_encoder_tb() for audio
Almost none of that function's complexity is useful for audio, it can
be replaced by a simple av_rescale_q().
2022-11-28 10:28:14 +01:00
Anton Khirnov a186360f27 fftools/ffmpeg: set AVFrame.time_base after filtering
Makes it easier to track what timebase are the frame timestamps in and
allows to stop accessing filters in code that shouldn't deal with
filtering.
2022-11-28 10:28:14 +01:00
Anton Khirnov d9534ec84e fftools/ffmpeg: move logging filtered frame timestamps
Do it right after the frame is received from the filtergraph. This is a
more logical place for this and will simplify future commits.
2022-11-28 10:28:14 +01:00
Anton Khirnov 2fa2e146cc fftools/ffmpeg: avoid storing full forced keyframe spec
It is not needed after the spec is parsed. Also avoids ugly string
comparisons for each video frame.
2022-11-28 10:28:14 +01:00
Anton Khirnov 334e52e094 fftools/ffmpeg: parse forced keyframes in of_open()
Allows to remove the ugly of_get_chapters() wrapper.
2022-11-28 10:28:14 +01:00