Commit Graph

5276 Commits

Author SHA1 Message Date
Andreas Rheinhardt 5088c7c733 avutil/error: Include macros.h for MKTAG
Up until now, including error.h alone does not make the AVERROR_* defines
usable, because they just expand to something involving MKTAG, but
without the header providing MKTAG. So include macros.h, the header
providing MKTAG.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-29 22:02:05 +02:00
Andreas Rheinhardt 2dd8acbe80 avutil/common, macros: Move several macros from common.h to macros.h
common.h currently contains several things: Math macros, UTF-8 macros,
other fundamental macros; furthermore it also contains miscellaneous
math functions and it (directly and indirectly) includes lots of other
headers.

This commit moves the "other fundamental macros" to macros.h which is
a more fitting place.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-29 22:02:05 +02:00
Jiaxun Yang a1cd62883f avutil/mips: Use $at as MMI macro temporary register
Some function had exceed 30 inline assembly register oprands limiation
when using LOONGSON2 version of MMI macros. We can avoid that by take
$at, which is register reserved for assembler, as temporary register.

As none of instructions used in these macros is pseudo, it is safe to
utilize $at here.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-28 23:31:48 +02:00
Jiaxun Yang b868272d7e avutil/mips: Use MMI_{L, S}QC1 macro in {SAVE, RECOVER}_REG
{SAVE,RECOVER}_REG will be available for Loongson2 again,
also comment about the magic.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-28 23:31:48 +02:00
James Almer e3b5ff17c2 avutil/film_grain_params: add support for H.274 Film Grain Characteristics
Used by codecs like H.264, HEVC, and VVC.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-07-23 11:06:31 -03:00
Andreas Rheinhardt 2934a4b9a5 Remove unnecessary avassert.h inclusions
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 15:02:30 +02:00
Andreas Rheinhardt 4608f7cc6a Remove unnecessary mem.h inclusions
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 14:47:57 +02:00
Andreas Rheinhardt e7bd47e657 Remove obsolete version.h inclusions
These have mostly been added because of FF_API_*; yet when these were
removed, removing the header has been forgotten.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 14:34:31 +02:00
Andreas Rheinhardt 2c05ee092b avutil/internal, swresample/audioconvert: Remove cpu.h inclusions
These inclusions are not necessary, as cpu.h is already included
wherever it is needed (via direct inclusion or via the arch-specific
headers).
Also remove other unnecessary cpu.h inclusions from ordinary
non-headers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 14:33:45 +02:00
Andreas Rheinhardt 69f120ead7 avcodec/avcodec: Don't include cpu.h
It is not used here at all; instead, add it where it is used without
including it or any of the arch-specific CPU headers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 12:59:07 +02:00
J. Dekker c866a099b2 lavu/kperf: use ff_thread_once()
Signed-off-by: J. Dekker <jdek@itanimul.li>
2021-07-21 16:35:27 +02:00
James Almer f9d5050d28 avutil/macos_kperf: add missing header guards
Fixes fate-source

Signed-off-by: James Almer <jamrial@gmail.com>
2021-07-20 19:01:02 -03:00
J. Dekker 9a727235fd lavu/checkasm: add (private) kperf timing for macOS
Signed-off-by: J. Dekker <jdek@itanimul.li>
2021-07-20 19:40:03 +02:00
Thilo Borgmann c1bf56a526 lavu/cpu: Use av_cpu_ prefix 2021-07-20 10:31:41 +02:00
Aman Karmani 504c60660d avutil/hwcontext_videotoolbox: implement hwupload to convert AVFrame to CVPixelBuffer
Teach AV_HWDEVICE_TYPE_VIDEOTOOLBOX to be able to create AVFrames of type
AV_PIX_FMT_VIDEOTOOLBOX. This can be used to hwupload a regular AVFrame
into its CVPixelBuffer equivalent.

    ffmpeg -init_hw_device videotoolbox -f lavfi -i color=black:640x480 -vf hwupload -c:v h264_videotoolbox -f null -y /dev/null

Signed-off-by: Aman Karmani <aman@tmm1.net>
2021-07-18 12:01:16 -07:00
Lynne 997f9bdb99
x86/tx_float: correctly load the transform length
The field is a standard field, yet we were loading it as if it was
a quadword. This worked for forward transforms by chance, but broke
when the transform was inverse.
checkasm couldn't catch that because we only test forward transforms,
which are identical to inverse transforms but with a different revtab.
2021-07-18 15:04:57 +02:00
Thilo Borgmann 87951dcbe7 lavu/cpu.c: Add av_force_cpu_count() to override auto-detection. 2021-07-16 10:06:10 +02:00
Michael Niedermayer 85b883429f avutil/tx: avoid negative left shifts
Fixes: left shift of negative value -1
Fixes: 33736/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SIREN_fuzzer-6657785795313664

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-18 18:58:25 +02:00
James Almer 8a6103326e avutil/samplefmt: don't add offsets to NULL pointers
Signed-off-by: James Almer <jamrial@gmail.com>
2021-06-13 16:10:37 -03:00
James Almer 7916c14713 avutil/samplefmt: remove outdated comment
av_samples_fill_arrays() has been returning the minimum required buffer size
for a while now.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-06-13 16:10:37 -03:00
Matthieu Patou 163559ed62 avutil/tests/audio_ffio: add missing header
Needed for HAVE_BIGENDIAN

Suggested-by: ffmpeg@fb.com
Signed-off-by: James Almer <jamrial@gmail.com>
2021-06-13 13:39:57 -03:00
James Almer 75f0bc651f avutil/tests/lzo: remove timer macros
Suggested-by: ffmpeg@fb.com
Signed-off-by: James Almer <jamrial@gmail.com>
2021-06-13 13:39:57 -03:00
Anton Khirnov 580e168a94 lavu/mem: un-inline av_size_mult()
There seems to be no compelling reason for it to be inline.
2021-06-11 19:42:47 +02:00
Anton Khirnov c8778606b3 lavu/video_enc_params: make sure blocks are properly aligned 2021-06-10 16:59:50 +02:00
Lynne 08d933bf61
hwcontext_vulkan: fix typo in vulkan_device_init()
load_functions() did not load the device-level functions.
2021-06-10 12:24:04 +02:00
Andreas Rheinhardt 7e03d962a4 avutil/opt: Check directly for av_dict_copy() failure
av_dict_copy() returned void when this code was written.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-06-08 12:52:50 +02:00
Jin Bo fd5fd48659 libavcodec/mips: Fix build errors reported by clang
Clang is more strict on the type of asm operands, float or double
type variable should use constraint 'f', integer variable should
use constraint 'r'.

Signed-off-by: Jin Bo <jinbo@loongson.cn>
Reviewed-by: yinshiyou-hf@loongson.cn
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-03 13:44:00 +02:00
Valerii Zapodovnikov 6b1268f8c3 pixfmt: fixed wrong fix of comment
This mostly reverts 785bfb1d7b.
But I also added some clarifications so that nobody mixes primaries
with matrix again. SMPTE 240 and 170 primaires are the same, while
matrix coeff. are different, because 240 is derived from 170's new
primaries and white point while 170 uses BT.601 derived from BT.470
System M (yes, with Illuminant C) a.k.a. NTSC 1953. Some nits too.

Reviewed-by: Reto Kromer <lists@reto.ch>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-02 17:30:24 +02:00
James Almer baf5cc5b7a avutil/mem: use GCC builtins to check for overflow in av_size_mult()
Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-31 09:02:06 -03:00
James Almer 918fc9a0ed avutil/mem: check for max_alloc_size in av_fast_malloc()
This puts av_fast_malloc*() in line with av_fast_realloc().

Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-27 10:29:59 -03:00
James Almer 786be70e28 avutil/mem: make ff_fast_malloc() internal to mem.c
Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-27 10:29:52 -03:00
James Almer be96f4b616 avutil/mem: make max_alloc_size an atomic type
Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-23 11:26:22 -03:00
James Almer fc99d59553 avutil/imgutils: don't add offsets to NULL pointers
Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-12 15:52:50 -03:00
Shiyou Yin ab04fedaaa mips: Fix potential illegal instruction error.
MSA2 optimizations are attached to MSA macros in generic_macros_msa.h.
It's difficult to do runtime check for them. Remove this part of code
can make it more robust. H264 1080p decoding: 5.13x==>5.12x.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-05-07 17:53:23 +02:00
Andreas Rheinhardt 8b83a4a885 avutil/mem: Also poison new av_realloc-allocated blocks
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-30 10:24:32 +02:00
Lynne cf17e2323f hwcontext_vulkan: dlopen libvulkan
While Vulkan itself went more or less the way it was expected to go,
libvulkan didn't quite solve all of the opengl loader issues. It's multi-vendor,
yes, but unfortunately, the code is Google/Khronos QUALITY, so suffers from
big static linking issues (static linking on anything but OSX is unsupported),
has bugs, and due to the prefix system used, there are 3 or so ways to type out
functions.

Just solve all of those problems by dlopening it. We even have nice emulation
for it on Windows.
2021-04-30 00:08:37 +02:00
Lynne 4a6581e968 hwcontext_vulkan: dynamically load functions
This patch allows for alternative loader implementations.
2021-04-30 00:08:37 +02:00
James Almer ffeeff4fbc avutil/hwcontext_vulkan: fix format specifiers for some printed variables
VkPhysicalDeviceLimits.optimalBufferCopyRowPitchAlignment and
VkPhysicalDeviceExternalMemoryHostPropertiesEXT.minImportedHostPointerAlignment are of type
VkDeviceSize (a typedef uint64_t).
VkPhysicalDeviceLimits.minMemoryMapAlignment is of type size_t.

Signed-off-by: James Almer <jamrial@gmail.com>
Reviewed-by: Lynne <dev@lynne.ee>
2021-04-29 14:04:02 -03:00
Lynne 3a3e8c35b6
hwcontext_vulkan: reorder structure fields and add spaces in between
We're in the middle of an ABI unstable period, so we're allowed to.
2021-04-28 18:18:05 +02:00
Anton Khirnov 85ba17f36d Bump major versions of all libraries.
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-27 11:48:05 -03:00
James Almer 0bf3a7361d avutil: remove deprecated AVClass.child_class_next
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 11:48:04 -03:00
Andreas Rheinhardt d40bb518b5 avutil/cpu: Remove deprecated functions
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:13 -03:00
Andreas Rheinhardt ef6a9e5e31 avutil/buffer: Switch AVBuffer API to size_t
Announced in 14040a1d91.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:13 -03:00
Andreas Rheinhardt 985c0dac67 avutil/pixdesc: Remove deprecated AV_PIX_FMT_FLAG_PSEUDOPAL
Deprecated in d6fc031caf.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:13 -03:00
Andreas Rheinhardt 1eb3110115 avutil/frame: Remove deprecated getters and setters
Deprecated in 7df37dd319.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:13 -03:00
Andreas Rheinhardt a240097ecd avutil: Switch crypto APIs to size_t
Announced in e435beb1ea.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:13 -03:00
Andreas Rheinhardt 6e30b35b85 avutil/frame: Remove deprecated AVFrame.pkt_pts field
Deprecated in 32c8359093.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:13 -03:00
Andreas Rheinhardt 3b56fa85e8 avutil/frame: Remove deprecated AVFrame.error
Deprecated in 1aa24df74c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:12 -03:00
Andreas Rheinhardt 0181162bb5 avutil/pixdesc: Remove deprecated off-by-one fields from pix fmt descs
Deprecated in 2268db2cd0.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:12 -03:00
Andreas Rheinhardt b8accd1175 avutil/frame: Remove AVFrame QP table API
Originally deprecated in 1296b1f6c0631ab79464e22d48a6a1548450b943;
scheduled again for removal in a991526832.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:12 -03:00