Commit Graph

110064 Commits

Author SHA1 Message Date
J. Dekker
37cde570bc lavc/aarch64: add clip N macro
Signed-off-by: J. Dekker <jdek@itanimul.li>
2023-03-22 14:48:13 +01:00
xufuji456
9413bdc381 avcodec/arm/hevc: remove duplicate mov of deblock neon
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-03-22 09:46:22 +02:00
rcombs
c0d9327a63 lavc/ass: error if not passed exactly 1 rect
This never produced valid output.
2023-03-21 14:24:31 -04:00
rcombs
b68a6ba469 ffmpeg: send only one rect per packet when encoding ASS
The packet and rect formats are identical,
so there's no support for multiple rects per packet.
2023-03-21 14:24:31 -04:00
Raphaël Zumer
0a3ce5f738 avutil: add HDR10+ dynamic metadata serialization function
Co-authored-by: Mohammad Izadi <moh.izadi@gmail.com>
Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-21 13:52:39 -03:00
Raphaël Zumer
6f2413a203 avcodec/avutil: move dynamic HDR10+ metadata parsing to libavutil
Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-21 13:52:36 -03:00
Anton Khirnov
1e406692e5 fftools/ffmpeg_mux_init: avoid invalid reads in forced keyframe parsing
Fixes #10243
2023-03-20 10:53:03 +01:00
Anton Khirnov
49b733c73c doc/developer.texi: add a section on API/ABI compatibility
Document established practices in it.
2023-03-20 10:52:17 +01:00
Anton Khirnov
f4dd302a38 doc/developer.texi: document checkasm 2023-03-20 10:52:17 +01:00
Anton Khirnov
a36ad2c649 doc/developer.texi: document the use of other languages than C 2023-03-20 10:52:17 +01:00
Anton Khirnov
27f8c9b27b lavu/frame: deprecate AVFrame.pkt_{pos,size}
These fields are supposed to store information about the packet the
frame was decoded from, specifically the byte offset it was stored at
and its size.

However,
- the fields are highly ad-hoc - there is no strong reason why
  specifically those (and not any other) packet properties should have a
  dedicated field in AVFrame; unlike e.g. the timestamps, there is no
  fundamental link between coded packet offset/size and decoded frames
- they only make sense for frames produced by decoding demuxed packets,
  and even then it is not always the case that the encoded data was
  stored in the file as a contiguous sequence of bytes (in order for pos
  to be well-defined)
- pkt_pos was added without much explanation, apparently to allow
  passthrough of this information through lavfi in order to handle byte
  seeking in ffplay. That is now implemented using arbitrary user data
  passthrough in AVFrame.opaque_ref.
- several filters use pkt_pos as a variable available to user-supplied
  expressions, but there seems to be no established motivation for using them.
- pkt_size was added for use in ffprobe, but that too is now handled
  without using this field. Additonally, the values of this field
  produced by libavcodec are flawed, as described in the previous
  ffprobe conversion commit.

In summary - these fields are ill-defined and insufficiently motivated,
so deprecate them.
2023-03-20 10:42:09 +01:00
Anton Khirnov
2fb3ee1787 fftools/ffplay: stop using AVFrame.pkt_pos
This field is ad-hoc and will be deprecated. Use the recently-added
AV_CODEC_FLAG_COPY_OPAQUE to pass arbitrary user data from packets to
frames.
2023-03-20 10:42:09 +01:00
Anton Khirnov
c29e5ab5c1 fftools/ffplay: depend on avfilter
Making lavfi optional adds a lot of complexity for very questionable
gain.
2023-03-20 10:42:09 +01:00
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