av_channel_layout_copy() will uninit the dst channel layout
before copying the new one.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
(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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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>
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>
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.
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.