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

109310 Commits

Author SHA1 Message Date
Marvin Scholz
1cf526c37a avfilter/vf_scale: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz
f8584c13f0 avformat/smjpegenc: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz
3000cf7a57 avcodec/libvpxenc: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz
5b13238ce0 avcodec/librav1e: remove unnecessary variable
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz
e048d06621 avcodec/librav1e: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz
ece29ad0dc fftools: use av_dict_get_string
Instead of manually assembling the string, use av_dict_get_string
which handles things like proper escaping too (even though it is
not yet needed here).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz
f1907faab4 fftools: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Andreas Rheinhardt
7b450bafd7 avcodec/h2645_sei: Factor attaching film grain side-data to frame out
This unfortunately involved adding some parameters
to ff_h2645_sei_to_frame() that will be mostly unused.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:00:41 +01:00
Andreas Rheinhardt
8bf18018a3 avcodec/(h264|hevc)_ps: Factor common VUI code out
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:00:41 +01:00
Andreas Rheinhardt
1e38e7fd14 avcodec/h264_ps: Don't output invalid chroma location
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:00:41 +01:00
Andreas Rheinhardt
881e8bcc51 avcodec/h264data: Deduplicate H.26[45] aspect ratio table
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:00:41 +01:00
Andreas Rheinhardt
8d481b0234 avcodec/h264_ps: Don't error out on unknown aspect ratio
Values 17..254 are actually only reserved and not invalid.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:00:41 +01:00
Andreas Rheinhardt
a5bba606a0 avcodec/h2645_sei: Also support Active Format Descriptor for HEVC
It is valid for HEVC; in fact, the ATSC-HEVC spec [1] simply
refers to the relevant H.264 spec.

It is also trivial to implement now: Just move applying AFD
to ff_h2645_sei_to_frame() and stop ignoring AFD when parsing
a HEVC SEI containing it.

A FATE-test for this has been added.

[1]: https://www.atsc.org/atsc-documents/a3412017-video-hevc/

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:00:41 +01:00
Andreas Rheinhardt
01e775f4b7 avcodec/h2645_sei: Attach AVStereo3D side data generically
There are only slight differences between H.264 and HEVC
for this side data, so it makes sense to share the code.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:00:41 +01:00
Andreas Rheinhardt
38d0d12c46 avcodec/h264_sei, sei: Make H264_SEI_FpaType generic
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:00:41 +01:00
Andreas Rheinhardt
3bafc4ead4 avcodec/h2645_sei: Factor out applying SEIs to frames
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:00:41 +01:00
Andreas Rheinhardt
f89825e60a avcodec/h2645_sei: Factor out freeing common SEI parts
This commit only factors out freeing the common SEI parts,
not whether the fields indicating whether an SEI is present
shall be reset. H.264 and HEVC differ in this regard
(ff_h264_sei_uninit() really resets, whereas ff_hevc_reset_sei()
only uninits.) and neither actually honours the persistency
as prescribed by the relevant specs.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:00:40 +01:00
Andreas Rheinhardt
de5891d371 avcodec/h2645_sei: Factor updating H.2645 SEIs out
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:00:40 +01:00
Andreas Rheinhardt
33239ebd07 avcodec/h2645_sei: Factor parsing common SEI messages out
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:00:40 +01:00
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