Commit Graph

107111 Commits

Author SHA1 Message Date
Gyan Doshi 0dcbe1c1aa doc/protocols: add details and reformat IPFS section 2022-05-26 16:21:28 +05:30
Gyan Doshi 8a0f7f7bfe doc/protocols: sort IPFS section alphabetically 2022-05-26 16:20:49 +05:30
Michael Niedermayer d84f03609e avformat/matroskadec: assert non NULL buf
The code is only called if size is > 0 so buf should not be NULL

Helps: CID610554

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-05-26 11:54:05 +02:00
Michael Niedermayer 7bfbd24e71 Changelog: Add line for IPFS
Noticed-and-suggested-by: Mark Gaiser <markg85@gmail.com>
Reviewed-by: Mark Gaiser <markg85@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-05-26 11:54:05 +02:00
Michael Niedermayer 5982da87e3 avformat/act: Check ff_get_wav_header() for failure
Fixes: missing error check
Fixes: CID717495

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-05-26 11:54:05 +02:00
Michael Niedermayer cb5be590cd avformat/jpegxl_probe: Check init_get_bits8() for failure
Fixes: missing error check
Fixes: CID1504270

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-05-26 11:54:05 +02:00
Zhao Zhili 5d8d3c1ac2 avutil/mem: fix doc for reallocs
The doc says those function are like av_free if size or nmemb is
zero. It doesn't match the code. av_realloc() realloc one byte if
size is zero, which was added by 91ff05f6ac ten years ago.
realloc() itself in C is implementation-dependent. Make the doc
match the longstanding behaviour.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2022-05-26 17:18:23 +08:00
J. Dekker 3c694967f8 lavc/aarch64: hevc_sao reschedule slightly
Signed-off-by: J. Dekker <jdek@itanimul.li>
2022-05-26 08:10:41 +02:00
Trystan Mata 1cb601ad10 avcodec/mfenc: Dynamically load MFPlat.DLL
Allows non-UWP builds of FFmpeg with MediaFoundation to work on
N editions of Windows which are without MediaFoundation by default.

On UWP target, FFmpeg is linked directly against MediaFoundation since
LoadLibrary is not available.

This commit adresses https://trac.ffmpeg.org/ticket/9788

Signed-off-by: Martin Storsjö <martin@martin.st>
2022-05-25 23:45:42 +03:00
Haihao Xiang 478e1a98a2 qsv: add requirement for the mininal version of libmfx
libmfx 1.28 was released 3 years ago, it is easy to get a greater
version than 1.28. We may remove lots of compile-time checks if adding
the requirement for the minimal version in the configure script.

Reviewed-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-05-25 15:17:35 +08:00
Dmitry Rogozhkin f8a07c4d4a libavcodec/qsvenc: expose only supported options
vp9, hevc, avc, mpeg2 QSV encoders inherit common list
of options (QSV_COMMON_OPTS) while bunch of options is not
actually supported by current qsv code. The only codec which
supportes everything is avc, followed by hevc, while vp9 and
mpeg2 significantly fall behind. This creates difficulties
for the users to use qsv encoders. This patch fixes options
list for encoders leaving only those which are actually
supported.

Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-05-25 15:17:35 +08:00
J. Dekker cc679054c7 checkasm: improve hevc_sao test
The HEVC decoder can call these functions with smaller widths than the
functions themselves are designed to operate on so we should only check
the relevant output

Signed-off-by: J. Dekker <jdek@itanimul.li>
2022-05-25 08:04:58 +02:00
J. Dekker 2e832be322 lavc/aarch64: add hevc sao edge 8x8
bench on AWS Graviton:

hevc_sao_edge_8x8_8_c: 516.0
hevc_sao_edge_8x8_8_neon: 81.0

Signed-off-by: J. Dekker <jdek@itanimul.li>
2022-05-25 08:04:46 +02:00
J. Dekker 92f67e4017 lavc/aarch64: add hevc sao edge 16x16
bench on AWS Graviton:

hevc_sao_edge_16x16_8_c: 1857.0
hevc_sao_edge_16x16_8_neon: 211.0
hevc_sao_edge_32x32_8_c: 7802.2
hevc_sao_edge_32x32_8_neon: 808.2
hevc_sao_edge_48x48_8_c: 16764.2
hevc_sao_edge_48x48_8_neon: 1796.5
hevc_sao_edge_64x64_8_c: 32647.5
hevc_sao_edge_64x64_8_neon: 3118.5

Signed-off-by: J. Dekker <jdek@itanimul.li>
2022-05-25 08:04:39 +02:00
J. Dekker d957ee34a6 lavc/aarch64: fix hevc sao band filter
The SAO band filter can be called with non-multiples of 8, we round up
to the nearest multiple of 8 to account for this.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2022-05-25 08:04:35 +02:00
Andreas Rheinhardt 8d788c567a avcodec/mjpegenc: Remove ineffective pred option
Never did anything, so it is removed immediately.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-24 21:38:16 +02:00
Andreas Rheinhardt d587b1c323 avcodec/mpegvideoenc: Remove ineffective options
This commit removes the ineffective FF_MPV_DEPRECATED_ options,
namely mpeg_quant (this is only an option for MPEG-4), a53cc
(this is only an option for MPEG-2), force_duplicated_matrix
(applies only to MJPEG) and b_strategy, b_sensitivity and brd_scale
(these options only make sense for encoders supporting B-frames,
which currently means the MPEG-1/2 and MPEG-4 encoders).
Given that these options never changed the outcome of encoding,
they are removed at once.

Notice that the options for the encoders for which it made sense
are not affected by this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-24 21:37:17 +02:00
Andreas Rheinhardt de640d2b53 avcodec/mjpegenc: Remove pointless motion-estimation options
(M)JPEG does not use motion estimation/motion vectors at all.
These options therefore don't affect the output at all.
So remove them.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-24 21:36:45 +02:00
Andreas Rheinhardt 3fba5d4f3c avcodec/mpegvideoenc: Remove ineffective [pb]bias options
The user-provided value is overwritten in ff_mpv_encode_init()
without having ever been read.
(This has been broken when making these options mpegvideo-specific
in commits 910247f172 and
cf7d2f2d21. No one has ever complained,
so this commit removes these fields.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-24 21:31:26 +02:00
Andreas Rheinhardt 49838705a4 avcodec/pthread_frame: Don't update the first thread ctx before freeing
Currently, ff_frame_thread_free() uses the last worker thread
to updates the first worker thread via update_context_from_thread()
immediately before freeing all these worker threads. This is
a remnant of the time in which the first worker was special.
(E.g. the first worker shared its AVCodecInternal with the public
AVCodecContext.)

But these times are over (none of the uses of is_copy matter
for ff_frame_thread_free()); nowadays the only thing that
update_context_from_thread() does is referencing a few
buffers/frames and replacing them with other references instead.
These new references will then be freed immediately thereafter
when the first worker thread is freed. Ensuring that the code is
free of double-frees is achieved by using reference-counted structures
(or in case of AVChannelLayouts: by giving each worker its own copy).

Some archaeology:
a) Updating the first worker thread from the last one used
has been done since frame-threading was added in
37b00b47cb.
b) The precursor to ff_mpv_common_end() checked for is_copy
before freeing pictures (i.e. it only freed them for the first
worker thread).
c) Commits c2dfb1e37c and
e33811bd26 modified the
update_thread_context function of the H.264 decoder
so that it could fail before calling ff_mpeg_update_thread_context().
d) This led to a double free/an assert violation with a H.264
sample for which ff_mpeg_update_thread_context() is not reached
for the final update_context_from_thread(). Commit
a6e4796fbf added code to fix this
sample.
e) This issue was fixed (even with the last mentioned commit reverted)
when the H.264 decoder was deMpegEncContextized in commit
b7fe35c9e5 (merging commit
2c54155407).
f) mpegvideo.c stopped using is_copy when it was switched to refcounted
frames in 759001c534.
g) 1f4cf92cfb removed the init_thread_copy
callbacks; now no FFCodec.close callback checks for is_copy at all
any more.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-24 21:31:08 +02:00
Andreas Rheinhardt a78173374a ffbuild/common: Fix CPPFLAGS applied for compiling C++ files
Currently, $(CPPFLAGS) and $(CFLAGS) are prepended to CXXFLAGS
(the flags for compiling C++) like this:
CXXFLAGS := $(CPPFLAGS) $(CFLAGS) $(CXXFLAGS)
Using ":=" creates a simply expanded variable, i.e. the values
of the variable at the time of assignment are used and later
modifications to them are ignored (using a recursively expanding
variable (i.e. "=" instead of ":=") is not really possible here,
as there would be an infinite loop when evaluating CXXFLAGS).

Yet we perform later additions to CPPFLAGS: HAVE_AV_CONFIG_H and
BUILDING_libfoo are defined. These do not reach C++ compilations.

To fix this a trick is employed to prepend to a recursively
expanded variable while keeping it recursively expanded.

There are two practical consequences of this: C++ files now no longer
include the version.h header, but only the version_major.h header
of their library, saving some recompilations. Furthermore, they
now get some optimized math functions (namely the ones from
lavu/intmath.h instead of the ones from lavu/common.h).
(av_parity() is the only one for which it makes a difference.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-24 21:30:52 +02:00
Anton Khirnov b033913d1c fftools/ffmpeg: move processing AV_PKT_DATA_QUALITY_STATS to do_video_stats()
This is a more appropriate place for this code, since the values we read
from AV_PKT_DATA_QUALITY_STATS side data are primarily written into
video stats. This ensures that the values written into stats actually
apply to the right packet.

Rename the function to update_video_stats() to better reflect its new
purpose.
2022-05-24 13:46:57 +02:00
Anton Khirnov 0c914ebd53 fftools/ffmpeg: merge variable declaration and initialization 2022-05-24 13:46:57 +02:00
Anton Khirnov 9acce2afcf fftools/ffmpeg: stop using av_stream_get_end_pts() in do_video_stats()
It retrieves libavformat's internal dts value (contrary to the
function's name), which is not only incorrect in general, but also
unnecessary because we can access the packet directly.
2022-05-24 13:46:57 +02:00
Anton Khirnov 3d4d355375 fftools/ffmpeg: stop using AVStream.nb_frames in do_video_stats()
Its use for muxing is not documented, in practice it is incremented per
each packet successfully passed to the muxer's write_packet(). Since
there is a lot of indirection between ffmpeg receiving a packet from the
encoder and it actually being written (e.g. bitstream filters, the
interleaving queue), using nb_frames here is incorrect.

Add a new counter for packets received from encoder instead.
2022-05-24 13:46:57 +02:00
Anton Khirnov 19d1e1fb06 fftools/ffmpeg: move do_video_stats() to avoid a forward declaration 2022-05-24 13:46:57 +02:00
Anton Khirnov 1753fbd095 fftools/ffmpeg: drop a useless check and reduce indentation
do_video_stats() is only ever called for video.
2022-05-24 13:46:57 +02:00
Anton Khirnov 9f4437a4eb fftools/ffmpeg: reindent after previous commit 2022-05-24 13:46:57 +02:00
Anton Khirnov 2ecb333fe4 fftools/ffmpeg: reuse the encoding code for flushing encoders 2022-05-24 13:46:57 +02:00
Anton Khirnov a11ab64730 fftools/ffmpeg: share the code encoding a single frame between video and audio
Call do_video_stats() for every video packet produced by the encoder,
rather than for every frame sent to the encoder.
2022-05-24 13:46:57 +02:00
Anton Khirnov fa26e17747 lavfi/vf_v360: implement output mask for barrelsplit
The top/bottom of the barrel are each coded as two semicircles inside a
square block in the frame. Mask out the parts of the square that lie
outside of these semicircles, so they are made transparent when
alpha_mask=1.

Fixes the other part of #9725.
2022-05-24 13:41:24 +02:00
Anton Khirnov 83a5ef5113 lavfi/vf_v360: fix barrelsplit transform with padding
Make it match Facebook's transform360
(https://github.com/facebook/transform360)

Fixes one part of #9725.
2022-05-24 13:41:22 +02:00
Anton Khirnov 82784ddf33 lavfi/vf_v360: factorize vector computation for barrelsplit 2022-05-24 13:39:48 +02:00
Anton Khirnov 58bb83c7ed lavfi/vf_v360: drop nonsense inline specifier
This function is always called indirectly, it cannot be inlined.
2022-05-24 13:39:48 +02:00
Anton Khirnov 60f948dd55 tests/fate/vcodec: add tests for ffv1 2pass mode 2022-05-24 13:35:16 +02:00
Anton Khirnov e53940186a fftools/ffmpeg: fix 2pass log file names
Use the global stream index rather than an unrelated variable in the
filename.

Broken in 6d5d924604.
2022-05-24 13:35:16 +02:00
Anton Khirnov 83560e48f6 tests/fate-run: give consistent names to enc_dec() arguments
enc_dec() performs two ffmpeg runs - the first one encoding a source
file into a specified output format, the second one decoding previously
encoded file.

The arguments to this function currently have confusing names - e.g.
dec_opt contains _output_ (i.e. encoding) options for the second
(decoding) ffmpeg invocation. It is also possible to supply _input_
(i.e. decoding) options for the second ffmpeg run, but the argument
is currently unnamed and referred to by number.

Add an _in/_out suffix to argument names to make it clear what they are
used for. Give a name to input options for the decoding ffmpeg run.
2022-05-24 13:35:16 +02:00
Anton Khirnov aa7d38f27c tests/fate/vcodec: drop unnecessary options
jpeg2000 will be chosen by default, there is no reason to prescribe it
explicitly. No other test does so.
2022-05-24 13:35:16 +02:00
Zhao Zhili 5a7a33f6f2 avcodec/libdavs2: export has_b_frames info
More precisely, we should use picture_reorder_delay, but it's
unavailable yet.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2022-05-24 18:03:12 +08:00
Zhao Zhili 8379e454e0 avcodec/libuavs3d: use output_reorder_delay as has_b_frames
has_b_frames is more than a bool, it's the size of the frame
reordering buffer in the decoder.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2022-05-24 18:03:12 +08:00
Zhao Zhili 99d1279216 avcodec/avs3_parser: set has_b_frames properly
has_b_frames should be output_reorder_delay field in AVS3 sequence
header and larger than 1. The parser implementation doesn't parse
that field. Decoder can set has_b_frames properly, so use FFMAX
here to avoid resetting has_b_frames from output_reorder_delay to 1.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2022-05-24 18:03:12 +08:00
Thilo Borgmann 9cb9da62a3 avfilter: Add blockdetect filter 2022-05-24 11:21:36 +02:00
softworkz 6b32ad59c8 avcodec/dvdsubdec: use avpriv_fopen_utf8() instead of plain fopen()
Unify file access operations by replacing usages of direct calls
to posix fopen() to prepare for long filename support on Windows.

Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-05-24 11:50:32 +03:00
softworkz f579a1d08b avfilter: use avpriv_fopen_utf8() instead of plain fopen()
Unify file access operations by replacing usages of direct calls
to posix fopen() to prepare for long filename support on Windows.

Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-05-24 11:50:24 +03:00
Paul B Mahol d2ef44fbb1 avfilter/af_afftfilt: add threads support 2022-05-24 08:58:42 +02:00
Martin Storsjö 6076dbcb55 Switch uses of av_fopen_utf8 to avpriv_fopen_utf8
The former has been deprecated.

Signed-off-by: Martin Storsjö <martin@martin.st>
2022-05-23 13:52:45 +03:00
Martin Storsjö 4cdc14aa95 libavutil: Deprecate av_fopen_utf8, provide an avpriv version
Since every DLL can use an individual CRT on Windows, having
an exported function that opens a FILE* won't work if that
FILE* is going to be used from a different DLL (or from user
application code).

Internally within the libraries, the issue can be worked around
by duplicating the function in all libraries (this already happened
implicitly because the function resided in file_open.c) and renaming
the function to ff_fopen_utf8 (so that it doesn't end up exported from
the DLLs) and duplicating it in all libraries that use it.

This makes the avpriv_fopen_utf8 / ff_fopen_utf8 function work in
the exact same way as the existing avpriv_open / ff_open, with the
same setup as introduced in e743e7ae6e.

That mechanism doesn't work for external users, thus deprecate the
existing function.

Signed-off-by: Martin Storsjö <martin@martin.st>
2022-05-23 13:52:26 +03:00
Martin Storsjö 3fb9244642 fftools: Stop using av_fopen_utf8
Provide a header based inline reimplementation of it.

Using av_fopen_utf8 doesn't work outside of the libraries when built
with MSVC as shared libraries (in the default configuration, where
each DLL gets a separate statically linked CRT).

Signed-off-by: Martin Storsjö <martin@martin.st>
2022-05-23 13:35:59 +03:00
Tong Wu 1f9b5fa581 avutil/hwcontext_qsv: fix mapping issue between QSV frames and D3D11VA frames
Fixes:
$ ffmpeg.exe -init_hw_device d3d11va=d3d11 -init_hw_device \
qsv=qsv@d3d11 -s:v WxH -pix_fmt nv12 -i input.yuv -vf \
"hwupload=extra_hw_frames=16,hwmap=derive_device=d3d11va,format=d3d11,\
hwmap=derive_device=qsv,format=qsv" -f null -

Reviewed-by: Soft Works <softworkz@hotmail.com>
Signed-off-by: Tong Wu <tong1.wu@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-05-23 15:10:05 +08:00
Tong Wu 20807a9d61 avutil/hwcontext_d3d11va: pass the format value from outside for staging texture
In d3d11va_create_staging_texture(), during the hwmap process, the
ctx->internal->priv is not initialized, resulting in the
texDesc.Format not initialized. Now pass the format value from
d3d11va_transfer_data() to fix it.

$ ffmpeg.exe -y -hwaccel qsv -init_hw_device d3d11va=d3d11 \
-init_hw_device qsv=qsv@d3d11 -c:v h264_qsv \
-i input.h264 -vf "hwmap=derive_device=d3d11va,format=d3d11,hwdownload,format=nv12" \
-f null -

Reviewed-by: Soft Works <softworkz@hotmail.com>
Signed-off-by: Tong Wu <tong1.wu@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-05-23 15:10:05 +08:00