Commit Graph

110051 Commits

Author SHA1 Message Date
Anton Khirnov
9141c0cfd8 fftools/ffplay: drop an unused function argument 2023-03-20 10:42:09 +01:00
Anton Khirnov
e6126abc69 fftools/ffprobe: stop using AVFrame.pkt_{pos,size}
These fields are ad-hoc and will be deprecated. Use the recently-added
AV_CODEC_FLAG_COPY_OPAQUE to pass arbitrary user data from packets to
frames.

Changes the result of the flcl1905 test, which uses ffprobe to decode
wmav2 with multiple frames per packet. Such packets are handled
internally by calling the decoder's decode callback multiple times,
offsetting the internal packet's data pointer and decreasing its size
after each call. The output pkt_size value before this commit is then
the remaining internal packet size at the time of each internal decode
call.

After this commit, output pkt_size is simply the size of the full packet
submitted by the caller to the decoder. This is more correct, since
internal packets are never seen by the caller and should have no
observable outside effects.
2023-03-20 10:42:09 +01:00
Anton Khirnov
0ad64cdd92 fftools/ffmpeg_filter: initialize graph inputs/outputs
Avoids uninitialized free on error.

Found-by: Paul B Mahol
2023-03-20 10:41:26 +01:00
Haihao Xiang
57afccc0ef lavfi/vf_vpp_qsv: set the right timestamp for AVERROR_EOF
Rescale the timestamp for AVERROR_EOF. This can fix tickets 10261 and
10262.

Tested-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-03-20 09:58:41 +08:00
Michael Niedermayer
3ead1fe413
avfilter/vf_uspp: about 10x the speed with threads
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-03-18 22:36:51 +01:00
Michael Niedermayer
cee4b99d41
avfilter/vf_uspp: Support any codec
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-03-18 18:20:14 +01:00
Michael Niedermayer
771c27119d
avfilter/vf_uspp: update to new APIs
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-03-18 18:20:02 +01:00
Andreas Rheinhardt
adb5f7b41f avcodec/libopusenc: Remove redundant av_packet_unref()
The AVPacket given to an encoder's encode callback
is unreferenced generically on error.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-18 07:21:35 +01:00
Andreas Rheinhardt
e5abcf0d29 avcodec/libfdk-aacenc: Remove redundant av_packet_unref()
The AVPacket given to an encoder's encode callback
is unreferenced generically on error.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-18 07:21:35 +01:00
Andreas Rheinhardt
af26a8ffbb avcodec/libmp3lame: Remove redundant av_packet_unref()
The AVPacket given to an encoder's encode callback
is unreferenced generically on error.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-18 07:21:35 +01:00
Andreas Rheinhardt
590d169bdb avcodec/decode: Reset MMX state for receive_frame decoders, too
FFmpeg's assembly code currently does not abide by the
plattform-specific ABIs wrt its handling of the X86 MMX flag:
Resetting the MMX state is deferred to avoid doing it multiple times
instead of ensuring that the CPU is in floating point state
upon return from any function.

Furthermore, resetting said state is sometimes done generically,
namely for all the decoders using the ordinary decode callback;
yet this is not done for the decoders using the receive_frame API.

This led to problems when MJPEG (and the MJPEG-based decoders)
were switched to the receive_frame API in commit
e9a2a87773, because ff_mjpeg_decode_sos()
only resets the MMX state on success, not on failure.
Such issues are probably still possible with SMVJPEG, which still
uses the receive_frame API. See issue #10210.

This commit therefore also resets the MMX state for
the receive_frame API to avoid any more surprises of this sort.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-18 05:10:24 +01:00
Zhao Zhili
f543f12817 avcodec/mediacodecenc: pass colorspace info to encoder
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-18 00:13:17 +08:00
Zhao Zhili
d0c6389e91 avcodec/mediacodecdec: refactor color space utils
So it can be shared with encoder.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-18 00:13:12 +08:00
Wenbin Chen
31a23149da doc/encoders: Add av1 to qsv encoder's summary
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2023-03-17 14:13:37 +08:00
Wenbin Chen
2db22d14bf doc/examples/qsv_transcode: Fix a bug when use more than one parameter set
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2023-03-17 14:13:37 +08:00
Wenbin Chen
55c8c9493f libavcodec/qsvenc: Add dynamic setting support of low_delay_brc to av1_qsv
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2023-03-17 14:13:37 +08:00
Zhao Zhili
13deb775cf fftools/ffprobe: fix print_dynamic_hdr_vivid
Don't print tone_mapping_param_num if tone_mapping_mode_flag is
disabled.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-17 18:52:36 +08:00
Zhao Zhili
c62fe3eee2 avcodec/dynamic_hdr_vivid: reindent after the previous commit
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-17 18:52:36 +08:00
Zhao Zhili
229363732e avcodec/dynamic_hdr_vivid: fix base_enable_flag control
The base_enable_flag is parallel to three_Spline_enable_flag. The
typesetting of the specification is very misleading.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-17 18:52:36 +08:00
Zhao Zhili
9a1b142712 avcodec/dynamic_hdr_vivid: fix base_param_Delta
It conflicts the comments. The operation based on Delta_enable_mode
can be applied by user during tone mapping.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-17 18:52:36 +08:00
Zhao Zhili
ac5dffdfe6 libavcodec/dynamic_hdr_vivid: fix start code check
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-17 18:52:36 +08:00
Zhao Zhili
8de8f1df77 fftools/ffprobe: fix HDR vivid info
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-17 18:52:31 +08:00
Zhao Zhili
4ec2861559 avfilter/vf_showinfo: fix HDR vivid info
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-17 18:52:12 +08:00
Zhao Zhili
0f2bef2684 avcodec/dynamic_hdr_vivid: fix three spline params
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-17 18:51:16 +08:00
Zhao Zhili
3be46ee767 libavutil/hdr_dynamic_vivid_metadata: fix three spline params
There are two group of three_Spline params.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-17 18:51:16 +08:00
Devin Heitmueller
6273fb36cc avformat/mpegtsenc: Restrict "async" behavior to KLV async packets
The original code would strip off the PTS/DTS of any packets
which had a stream ID of STREAM_ID_PRIVATE_STREAM_1.  While the
intent was to apply this to asynchronous KLV packets, it was
being applied to any codec that had that same stream ID (including
types such as SMPTE 2038).

Add a clause to the if() statement to ensure it only gets applied
if the codec actually is KLV.

Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-03-16 23:24:04 +01:00
James Almer
14719b7939 fate: add a yuv422p test for the untile filter
Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-16 16:07:40 -03:00
James Almer
dc61d5cf19 avfilter/vf_untile: swap the chroma shift values used for plane offsets
Fixes ticket #10265

Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-16 16:07:40 -03:00
Tong Wu
c3a7999099 avformat/mov: fix 2 compile errors
Compiler: MSVC 14.35.32215
Error type: error C2059: syntax error: '}'
Related commit: 9e1ffed fate/mov: add PCM in mp4 test
d7e8643 avformat/mov: parse ISO-14496-12 ChannelLayout

Signed-off-by: Tong Wu <tong1.wu@intel.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Haihao Xiang <haihao.xiang@intel.com>
2023-03-16 22:52:41 +08:00
Andreas Rheinhardt
85b185b504 avcodec/av1dec: Fix unintended fallthrough
Fixes Coverity issue #1521982.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-15 16:58:42 +01:00
James Almer
0d35634eaa avcodec/libdav1d: Fix unintended fallthrough
Based on a patch by Andreas Rheinhardt

Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-15 12:42:43 -03:00
Zhao Zhili
9e1ffeda8c fate/mov: add PCM in mp4 test
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-15 00:12:59 +08:00
Zhao Zhili
d4ee177a36 avformat/movenc: add PCM in mp4 support
It's defined by ISO/IEC 23003-5.

Fixes ticket #10185

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-15 00:12:59 +08:00
Zhao Zhili
d7e864366b avformat/mov: parse ISO-14496-12 ChannelLayout
Only support chnl version 0 now.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-15 00:12:59 +08:00
Zhao Zhili
a3dc677b9f avformat/isom_tags: remove ipcm from movaudio_tags
ipcm is defined by ISO/IEC 23003-5, not defined by quicktime. After
adding ISO/IEC 23003-5 support, we don't need it for ticket #9219.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-15 00:12:59 +08:00
Zhao Zhili
d04dbf48fc avformat/mov: fix ISO/IEC 23003-5 support
Missing floating-point formats support.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-15 00:12:59 +08:00
Andreas Rheinhardt
a6e9d01f88 avcodec/libx264: Use av_pix_fmt_count_planes() where appropriate
This also fixes the number of planes for the NV formats
(this seems to not have caused any problems).

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-14 07:17:05 +01:00
Andreas Rheinhardt
19e35edaf1 avcodec/libx264: Use dedicated pointer for accesses
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-14 07:16:58 +01:00
Andreas Rheinhardt
df53d7a194 avcodec/libx264: Pass x264_picture_t* directly
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-14 07:16:54 +01:00
Andreas Rheinhardt
f456c192d9 avcodec/libx264: Fix leak in case of allocation failure
Fixes Coverity issue #1518906.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-14 07:16:51 +01:00
Andreas Rheinhardt
2732d0507c avfilter/vf_ssim360: Remove dead code
Fixes Coverity issue #1520669.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-14 07:16:45 +01:00
Andreas Rheinhardt
1091963d38 avfilter/vf_ssim360: Use correct type in sizeof
SSIM360Context.ssim360_hist is an array of four pointers to double;
so sizeof(*ssim360_hist[0]) (=sizeof(double)) is the correct size
to use to calculate the amount of memory to allocate, not
sizeof(*ssim360_hist) (which is sizeof(double*)).

Use FF_ALLOCZ_TYPED_ARRAY to avoid this issue altogether.

Fixes Coverity issue #1520671.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-14 07:16:06 +01:00
Andreas Rheinhardt
4175022bdb avcodec/libvpxdec: Constify VP9-decoder
Possible since 8d226fb978.

Reviewed-by: James Zern <jzern-at-google.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-13 23:36:53 +01:00
Andreas Rheinhardt
430dcd52b6 avcodec/libopencore-amr: Use frame_number instead of frame_num
Forgotten in 6b6f7db819.

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-13 23:36:53 +01:00
Andreas Rheinhardt
7f825d3335 avcodec/libxavs: Use frame_num instead of frame_number
Forgotten in 6b6f7db819.

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-13 23:36:53 +01:00
Jan Ekström
fba9d9609f avcodec/libsvtav1: use larger of bit rate and max rate for buffer size
Generally if maxrate is set, the calculation should be maxrate over
bufsize. This additionally enables CRF + maxrate & bufsize usage.

In order to keep negative values from enabling zero to be treated
as larger and causing a division by zero, check that one of the
variables is larger than zero.
2023-03-14 00:14:52 +02:00
Niklas Haas
1231003c3c avfilter/vf_libplacebo: remove deprecated field
This has not been functional since a year ago, including in our current
minimum dependency of libplacebo (v4.192.0). It also causes build errors
against libplacebo v6, so it needs to be removed from the code. We can
keep the option around for now, but it should also be removed soon.

Signed-off-by: Niklas Haas <git@haasn.dev>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-13 11:30:58 -03:00
Niklas Haas
11eca6018c avfilter/vf_libplacebo: wrap deprecated opts in FF_API define
Signed-off-by: Niklas Haas <git@haasn.dev>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-13 11:30:58 -03:00
Michael Niedermayer
7c130d6911
avcodec/mpeg12dec: Check input size
Fixes: Timeout
Fixes: 53599/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IPU_fuzzer-4950102511058944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-03-12 22:33:13 +01:00
Michael Niedermayer
f669dd4dff
avcodec/escape124: Simplify unpack_codebook()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-03-12 22:33:12 +01:00