1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-07 11:13:41 +02:00
Commit Graph

46552 Commits

Author SHA1 Message Date
Semen Belozerov
3a7e9caf92 avcodec/vp9: ipred_hd_16x16_16 avx2 implementation
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2022-05-31 08:07:57 -04:00
Andreas Rheinhardt
6d037537c1 avcodec/wavpack: Remove redundant av_channel_layout_uninit()
av_channel_layout_copy() will uninit the dst channel layout
before copying the new one.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-31 12:45:41 +02:00
Andreas Rheinhardt
415f012359 avcodec/ffv1enc: Fix undefined left shifts of negative numbers
Maybe this fixes the FPE encountered here:
https://fate.ffmpeg.org/report.cgi?slot=alpha-debian-qemu-gcc-4.7&time=20220530144951

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-30 19:49:04 +02:00
Andreas Rheinhardt
c5b2ddfe18 avcodec/iff: Remove redundant #if
Since ec0275843d this file
is compiled iff the IFF ILBM decoder is enabled.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-30 19:44:11 +02:00
Michael Niedermayer
366ef56f7f avcodec/ffv1enc: Eliminate float/double from find_best_state()
log2() remains, this can either be replaced by a integer implementation or the table
hardcoded if needed

Tested-by: Anton Khirnov <anton@khirnov.net>
Tested-by: Martin Storsjö <martin@martin.st>

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-05-30 12:13:29 +02:00
Michael Niedermayer
9e4d1549e8 avcodec/pcm-dvdenc: Mark unreachable defaults
Helps: CID1441929
Helps: CID1441931

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-05-30 12:13:29 +02:00
Martin Storsjö
9fba0b8a8c mfenc: Use dlopen instead of LoadLibrary for loading mfplat.dll
The dlopen wrapper contains code to make loading libraries safer,
to avoid loading a potentially malicious DLL with the same name.

Signed-off-by: Martin Storsjö <martin@martin.st>
2022-05-28 01:15:34 +03:00
Bohan Li
950123dc31 avcodec/libaomenc: Add unmet target level warning
When target levels are set, this patch checks whether they are
satisfied by libaom. If not, a warning is shown. Otherwise the output
levels are also logged.

This patch applies basically the same approach used for libvpx.

Signed-off-by: Bohan Li <bohanli@google.com>
Signed-off-by: James Zern <jzern@google.com>
2022-05-27 13:38:19 -07: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
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
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
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
Zhao Zhili
a12ebbbcaa avcodec/libuavs3d: fix access uninitialized variable when draining
buf_ptr is uninitialized and accessed when function return.
2022-05-23 10:19:23 +08:00
Andreas Rheinhardt
2c8f97831a avcodec/mpegvideo: Move float.h inclusion to mpegvideoenc.h
It is only needed for the options in mpegvideoenc.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-19 19:16:23 +02:00
Andreas Rheinhardt
9cc38cc636 avcodec/mss2: Remove write-only QpelDSPContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-19 19:16:23 +02:00
Andreas Rheinhardt
6e5acb6c88 avcodec/error_resilience: Only keep what is needed from MECmpContext
ERContext currently has an embedded MECmpContext, despite only
needing exactly one function from it. This is wasteful because
MECmpContext is pretty large (135 pointers, 1080 B for eight byte
pointers). So keep only what is needed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-19 19:16:23 +02:00
Limin Wang
94968dbc11 avcodec/dvdsubenc: return error if canvas_size is too small for subtitle render
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2022-05-19 21:17:31 +08:00
Andreas Rheinhardt
d31a3af6a9 avcodec/wrapped_avframe: Don't attach FrameDecodeData unnecessarily
It is unneeded, as this decoder does not call ff_get_buffer().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-15 19:08:43 +02:00
Andreas Rheinhardt
104abea646 avcodec/ac3: Move non-(de|en)coder-only parts out of ac3.h
Move AC3HeaderInfo into ac3_parser_internal.h and the rest
into a new header ac3defs.h.

This also breaks an include cycle of ac3.h and ac3tab.h
(the latter now only needs ac3defs.h).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-15 18:13:56 +02:00
Andreas Rheinhardt
cbd75ecc18 avcodec/ac3tab: Move some tables only used by ac3.c to it
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-15 18:13:55 +02:00
Andreas Rheinhardt
996ec1cbe8 avcodec/ac3: Remove declaration of inexistent function
Removed in 7b11eead1b.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-15 18:13:55 +02:00
Vignesh Venkatasubramanian
ab05e9a7f2 avcodec/libaomenc: Add parameter for avif single image encoding
Add a parameter to libaom-av1 encoder to enforce some of the single
image constraints in the AV1 encoder. Setting this flag will limit
the encoder to producing exactly one frame and the sequence header
that is produced by the encoder will be conformant to the AVIF
specification [1].

Part of Fixing Trac ticket #7621

[1] https://aomediacodec.github.io/av1-avif

Signed-off-by:: Vignesh Venkatasubramanian <vigneshv@google.com>
2022-05-13 12:45:00 +05:30
Semen Belozerov
e71d5156c8 avcodec/vp9: ipred_vl_16x16_16 avx2 implementation
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2022-05-12 14:43:08 -04:00
Tomas Härdin
1cd8596ef4 libavcodec/cinepakenc: Mark no-skip frames as keyframes
Reset curframe whenever we generate a keyframe.
Use -g instead of -keyint_min.
2022-05-12 11:19:12 +02:00
Andreas Rheinhardt
c19797bf59 avcodec/internal: Hide stuff only used by the core decode API
The general decoding API uses bitstream filters and an AVFifo
and therefore AVCodecInternal contains pointers to an AVBSFContext
and to an AVFifo and lavc/internal.h includes lavc/bsf.h and
lavu/fifo.h.
Yet actually, only two files are supposed to use these, namely
avcodec.c and (mainly) decode.c. For all the other files,
it should be an opaque type that they should not touch and that
they need not know anything about. This can be achieved by not
including these headers and using the structs instead of the
corresponding typedefs.
This also forces translation units that really use the BSF
and the FIFO APIs themselves to include the relevant headers
directly instead of relying on indirect inclusions (up until now,
even avcodec.c and decode.c relied on fifo.h to be included
by internal.h).
Of course, it also avoids unnecessary rebuilds when bsf.h or fifo.h
change.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-12 08:52:59 +02:00
Andreas Rheinhardt
e92e74b897 avcodec/texturedspenc: Fix invalid shift
Left shifts of signed types are UB unless the results fit
into the type. (Furthermore the value to be shifted need to be
nonnegative.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-12 08:33:11 +02:00
Anton Khirnov
8016219472 lavc: drop a confusing message about "thread emulation"
There is no such thing.
2022-05-11 10:37:26 +02:00
Anton Khirnov
28b8b41e5a lavc/pthread_frame: do not copy AVCodecInternal contents
None of its fields have meaningful values at that point that would need
to be copied to frame thread workers.
2022-05-11 10:37:26 +02:00
Anton Khirnov
2cb86cd00c lavc/avcodec: only allocate decoding packets for decoders 2022-05-11 10:37:26 +02:00
Anton Khirnov
c954cf1e1b lavc/encode: add an encoder-specific get_buffer() variant
Several encoders (roqvideo, svq1, snow, and the mpegvideo family)
currently call ff_get_buffer(). However this function is written
assuming it is called by a decoder. Though nothing has been obviously
broken by this until now, that may change in the future.

To avoid potential future issues, introduce a simple encode-specific
wrapper around avcodec_default_get_buffer2() and enforce its use in
encoders.
2022-05-11 10:37:17 +02:00
Anton Khirnov
a4ce370659 lavc/snow: only allocate mconly_picture for decoding
It is not used in the encoder.
2022-05-11 10:33:55 +02:00
John Stebbins
326f9fd01b lavc/pgs_frame_merge_bsf: add bsf to merge PGS segments
Required to remux m2ts to mkv
Minor changes and porting to FFBitStreamFilter done by the committer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-10 10:03:30 +02:00
Andreas Rheinhardt
f2b79c5b85 lib*/version: Move library version functions into files of their own
This avoids having to rebuild big files every time FFMPEG_VERSION
changes (which it does with every commit).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-10 06:49:32 +02:00
Jan Ekström
fe100bc556 avcodec/libsvtav1: signal CPB properties through side data
This way values such as maxrate/bufsize can be utilized further
down the chain.

First, syncs up the max_rate and buffer_size from SVT-AV1 back to
avctx, and then in case at least one of the utilized values is
nonzero, adds the CPB properties side data.
2022-05-09 23:08:42 +03:00
Jan Ekström
70887d44ff avcodec/libsvtav1: update avctx bit rate according to RC mode
This way we can filter out the default value for this member, which
is nonzero. Bases on the current affairs that bit rate based rate
control is nonzero in SVT-AV1.
2022-05-09 23:08:42 +03:00
Jun Zhao
68a7df5e9d lavc/cavsdec: Add profile check
Add profile check for cavs decoder, now cavs decoder only support
JiZhun(0x20) profile

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2022-05-08 10:38:54 +08:00
Jun Zhao
072a0daf5d lavc/libuavs3d: fix incorrect comments
fix incorrect comments

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2022-05-08 10:38:45 +08:00
Michael Niedermayer
f3b7ba21ba avcodec/libxavs2: Improve r redundancy in occured
Reviewed-by: "mypopy@gmail.com" <mypopy@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-05-06 15:57:45 +02:00