BSF can update extradata, e.g., vvc_mp4toannexb. If we don't copy
bsf->par_out back to avcodec context, decoder can get extradata in
mp4 format, while packets are in annexb format.
This class is unavailable on tvOS before 17.0 (and macOS before 10.7
and iOS before 4.0, but those are fairly ancient). This makes sure
that we don't try to build the avfoundation indevice for such
OSes.
Signed-off-by: Martin Storsjö <martin@martin.st>
E.g. tvOS doesn't have devicesWithMediaType.
In principle, we could probably disable building the whole
input device on such OSes, but that would either require
testing explicitly for the OS type in configure (which we don't
do anywhere so far), or test for individual objective C methods.
This approach allows the code to compile, but no input devices
will be found at runtime.
Signed-off-by: Martin Storsjö <martin@martin.st>
While technically not specifiad as valid by the AVFilterLink documentation,
it is currently possible to get an FPS of zero from various sources inside
libavfilter (notably vf_buffersrc).
Avoid a division by zero and resulting infinity when this happens.
Fixed warning about OBU count being wrong, which can only be
determined when the number of OBUs in the header is non-zero,
not the other way round.
Signed-off-by: Chris Hodges <chris.hodges@axis.com>
They are not needed for shared builds (and because --gc-sections
is not the default for shared builds, they were included by default
included in libavutil since bf22c4cc3e).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
mpegvideodec.h includes mpegvideodata.h which in turn contains
a "static const uint8_t *const ff_mpeg1_dc_scale_table =
ff_mpeg12_dc_scale_table[0]"; yet if mpegvideo is disabled,
ff_mpeg12_dc_scale_table is not available, yet a non-optimizing
compiler (like GCC with -O0) may emit ff_mpeg1_dc_scale_table
and therefore a reference to ff_mpeg12_dc_scale_table nevertheless.
Fix this by only including mpegvideodec.h if it is needed.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
The ff_h2656_put_{uni_,}8tap_hv{32,64,128}_8_avx2
and ff_h2656_put_{uni_,}4tap_hv{64,128}_8_avx2
functions were unused and have been removed.
This saved 3712B of .text here.
(ff_h2656_put_{uni_,}4tap_hv32_8_avx2 are now only
called from exactly one callsite (in
ff_hevc_put_{uni_,}epel_hv32_8_avx2) and could be inlined.)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
The line which appears to be using it was always commented out
(since it has been added in 70c5ae870b).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
It can't really happen, because no currently used pixel format
has a name exceeding the size of the buffer.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
big secret, reading a float as the corresponding integer is a good
approximation of log2() for numbers not too close to 1.0. At the same
time it maintains strict monotonicity
this reduces run time from 19sec to 17sec for the slowest of my testcases
(with default remap_optimizer 3)
Compression is about the same:
-rw-r----- 1 michael michael 497603370 Mar 30 15:23 float-303503-fixed-40-optim-3-1log2F.nut
-rw-r----- 1 michael michael 497603374 Mar 28 11:27 float-303503-fixed-40-optim-3b.nut
-rw-r----- 1 michael michael 549938852 Mar 28 11:27 float-303503-float16-40-optim-3b.nut
-rw-r----- 1 michael michael 549938857 Mar 30 15:23 float-303503-float16-40-optim-3-1log2F.nut
-rw-r----- 1 michael michael 1150827841 Mar 28 11:28 float-303503-float-40-optim-3b.nut
-rw-r----- 1 michael michael 1150832913 Mar 30 15:22 float-303503-float-40-optim-3ref-log2F2.nut
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
When running 'ffmpeg -init_hw_device list' to display available hardware
devices, it incorrectly shows an error message:
"Failed to set value 'list' for option 'init_hw_device': Immediate exit requested"
This is a regression introduced by commit a50f90f1c2. The command is
actually working as intended - it should exit after listing devices, but
shouldn't display an error message.
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Add videotoolbox to the list of supported hardware acceleration methods
in the -hwaccel option documentation. This option allows users to utilize
Apple's VideoToolbox framework for hardware-accelerated video decoding
on macOS and iOS devices.
The videotoolbox acceleration has been supported for a while, but was
missing from the documentation.
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
This data is only used by sbcdsp.c, so delete sbcdsp_data.h,
make a header out of sbcdsp_data.c and make the data contained
therein static.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
It is simpler, avoids several loops and also makes GCC no longer
emit bogus -Wstringop-overflow= warnings.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Doing so gets rid of a stupid GCC -Wstringop-overflow= warning
(GCC somehow believes that fbw_channels can be 7 with the old
form of the code, so that channel_uses_spx[7] would be written
to, but now it no longer believes so).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
GCC considers declarations using a parameter of pointer
type (or equivalently a parameter using an array of unspecified
dimensions) to be inconsistent with a declaration using
a known-length array type and emits a -Warray-parameter warning
for several ff_j_rev_dct* functions for this.
This patch makes the declarations match the actual definitions
to suppress these (IMO nonsensical) warnings.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Previously, AV1 used filler data with CBR by default while H.264
and HEVC may or may not depending on driver version. Make this
consistent by using not filler data in CBR mode for all codecs.
Since there are valid reasons to use CBR with or without filler,
also add a cbr_padding option to allow users to override this.
Signed-off-by: Cameron Gutman <aicommander@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
This backports similar functionality from dav1d, from commits
35d1d011fda4a92bcaf42d30ed137583b27d7f6d and
d130da9c315d5a1d3968d278bbee2238ad9051e7.
This allows detecting writes out of bounds, on all 4 sides of
the intended destination rectangle.
The bounds checking also can optionally allow small overwrites
(up to a specified alignment), while still checking for larger
overwrites past the intended allowed region.
Signed-off-by: Martin Storsjö <martin@martin.st>
This makes it easier to implement custom error printouts in tests.
This is a port of dav1d's commit
13a7d78655f8747c2cd01e8a48d44dcc7f60a8e5 into ffmpeg's checkasm.
Signed-off-by: Martin Storsjö <martin@martin.st>
This makes sure to disable VideoToolbox if building with an SDK
that does contain VideoToolbox, but targeting an older version of
the OS where it is unavailable. Previously, we would enable
VideoToolbox as long as the framework itself was found, which only
require the framework to exist in the SDK.
Signed-off-by: Martin Storsjö <martin@martin.st>
The audiotoolbox outdev uses APIs that only are available on macOS,
not on iOS or tvOS. Check for them in configure, and make sure the
outdev is disabled otherwise.
This allows building for iOS without explicitly having to disable
the audiotoolbox outdev.
Signed-off-by: Martin Storsjö <martin@martin.st>
The conversion functions were added in
e7382b4d01, yet they were never
really enabled. Found via -ffunction-sections and --gc-sections.
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This was changed 8 years ago with the introduction of the linux-perf path,
with seemingly no justification at the time. Likely a developer oversight
from testing.
This bug not only made --runs completely ineffective, but also meant that we
didn't actually correctly filter out outliers.
Fixes: e0d56f097f