summaryrefslogtreecommitdiff
path: root/libavutil
Commit message (Collapse)AuthorAge
* avutil/opt: Document actual behaviour of av_opt_copy a bit moreAndreas Rheinhardt2021-08-17
| | | | | | | | | In particular, document that av_opt_copy() always disentangles allocated options even on error; this guarantee is needed to e.g. properly free duplicated thread contexts in libavcodec on error. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavu/internal: add FF_FIELD_AT().Nicolas George2021-08-14
|
* hwcontext_vulkan: use GPU memcpy when copying to system RAMLynne2021-08-14
| | | | This should speed it up significantly on systems where it matters.
* imgutils: expose av_image_copy_plane_uc_from()Lynne2021-08-14
| | | | | | | | | | | | The reason why the generic av_image_copy_uc_from() doesn't really fit in the case for Vulkan is because some planes may be copied via other methods (such as mapping GPU memory), and if they don't satisfy the strict alignment requirements, a gpu image->gpu buffer->cpu ram copy is performed. We need this for hwcontext_vulkan, and I think this will also be useful to API users like libplacebo who would rather not write a custom SIMD memcpy.
* avutil/mem: Correct av_calloc() documentationAndreas Rheinhardt2021-08-12
| | | | | | Incorrect since 4959f18a8e11ad7d3529b1c4fc429f1b6b76ad7c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/mem: Reinline av_size_mult() internallyAndreas Rheinhardt2021-08-12
| | | | | | | | | | | | | Since 580e168a945b65100ec2c25433f33bfacfe9f7be, av_size_mult() is no longer inlined; on systems where interposing is a thing, this also inhibits the compiler from inlining said function into the internal callers of said function, although inlining such a small function is typically beneficial: With GCC 10.3 on Ubuntu x64 and -O3 this decreases the size of av_realloc_array from 91B to 23B, from 129B to 81B for av_realloc_f and from 77B to 23B for each of av_malloc_array, av_mallocz_array and av_calloc. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/tx: add a return at the end of non-void functionsJames Almer2021-08-06
| | | | | | Fixes compilation with GCC 11 when configured with --disable-optimizations Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/internal: Move MAKE_ACCESSORS to its only userAndreas Rheinhardt2021-08-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Move ff_tlog() from lavc/internal.h to lavu/internal.hAndreas Rheinhardt2021-08-05
| | | | | | | It is also used by libavfilter and it is only natural to define it alongside ff_dlog(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/Makefile: Apply CFLAGS for compilationAndreas Rheinhardt2021-08-04
| | | | | | | Fixes "make tools/crypto_bench.o". Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/error: Include macros.h for MKTAGAndreas Rheinhardt2021-07-29
| | | | | | | | | 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>
* avutil/common, macros: Move several macros from common.h to macros.hAndreas Rheinhardt2021-07-29
| | | | | | | | | | | | 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>
* avutil/mips: Use $at as MMI macro temporary registerJiaxun Yang2021-07-28
| | | | | | | | | | | | | 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>
* avutil/mips: Use MMI_{L, S}QC1 macro in {SAVE, RECOVER}_REGJiaxun Yang2021-07-28
| | | | | | | | | {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>
* avutil/film_grain_params: add support for H.274 Film Grain CharacteristicsJames Almer2021-07-23
| | | | | | Used by codecs like H.264, HEVC, and VVC. Signed-off-by: James Almer <jamrial@gmail.com>
* Remove unnecessary avassert.h inclusionsAndreas Rheinhardt2021-07-22
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Remove unnecessary mem.h inclusionsAndreas Rheinhardt2021-07-22
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Remove obsolete version.h inclusionsAndreas Rheinhardt2021-07-22
| | | | | | | 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>
* avutil/internal, swresample/audioconvert: Remove cpu.h inclusionsAndreas Rheinhardt2021-07-22
| | | | | | | | | | 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>
* avcodec/avcodec: Don't include cpu.hAndreas Rheinhardt2021-07-22
| | | | | | | 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>
* lavu/kperf: use ff_thread_once()J. Dekker2021-07-21
| | | | Signed-off-by: J. Dekker <jdek@itanimul.li>
* avutil/macos_kperf: add missing header guardsJames Almer2021-07-20
| | | | | | Fixes fate-source Signed-off-by: James Almer <jamrial@gmail.com>
* lavu/checkasm: add (private) kperf timing for macOSJ. Dekker2021-07-20
| | | | Signed-off-by: J. Dekker <jdek@itanimul.li>
* lavu/cpu: Use av_cpu_ prefixThilo Borgmann2021-07-20
|
* avutil/hwcontext_videotoolbox: implement hwupload to convert AVFrame to ↵Aman Karmani2021-07-18
| | | | | | | | | | | | 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>
* x86/tx_float: correctly load the transform lengthLynne2021-07-18
| | | | | | | | 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.
* lavu/cpu.c: Add av_force_cpu_count() to override auto-detection.Thilo Borgmann2021-07-16
|
* avutil/tx: avoid negative left shiftsMichael Niedermayer2021-06-18
| | | | | | | | 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>
* avutil/samplefmt: don't add offsets to NULL pointersJames Almer2021-06-13
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/samplefmt: remove outdated commentJames Almer2021-06-13
| | | | | | | av_samples_fill_arrays() has been returning the minimum required buffer size for a while now. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/tests/audio_ffio: add missing headerMatthieu Patou2021-06-13
| | | | | | | Needed for HAVE_BIGENDIAN Suggested-by: ffmpeg@fb.com Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/tests/lzo: remove timer macrosJames Almer2021-06-13
| | | | | Suggested-by: ffmpeg@fb.com Signed-off-by: James Almer <jamrial@gmail.com>
* lavu/mem: un-inline av_size_mult()Anton Khirnov2021-06-11
| | | | There seems to be no compelling reason for it to be inline.
* lavu/video_enc_params: make sure blocks are properly alignedAnton Khirnov2021-06-10
|
* hwcontext_vulkan: fix typo in vulkan_device_init()Lynne2021-06-10
| | | | load_functions() did not load the device-level functions.
* avutil/opt: Check directly for av_dict_copy() failureAndreas Rheinhardt2021-06-08
| | | | | | av_dict_copy() returned void when this code was written. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* libavcodec/mips: Fix build errors reported by clangJin Bo2021-06-03
| | | | | | | | | | 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>
* pixfmt: fixed wrong fix of commentValerii Zapodovnikov2021-06-02
| | | | | | | | | | | | This mostly reverts 785bfb1d7bb8de567c3aac1d9cc369b55ac9fb7b. 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>
* avutil/mem: use GCC builtins to check for overflow in av_size_mult()James Almer2021-05-31
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/mem: check for max_alloc_size in av_fast_malloc()James Almer2021-05-27
| | | | | | This puts av_fast_malloc*() in line with av_fast_realloc(). Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/mem: make ff_fast_malloc() internal to mem.cJames Almer2021-05-27
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/mem: make max_alloc_size an atomic typeJames Almer2021-05-23
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/imgutils: don't add offsets to NULL pointersJames Almer2021-05-12
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* mips: Fix potential illegal instruction error.Shiyou Yin2021-05-07
| | | | | | | | 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>
* avutil/mem: Also poison new av_realloc-allocated blocksAndreas Rheinhardt2021-04-30
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* hwcontext_vulkan: dlopen libvulkanLynne2021-04-30
| | | | | | | | | | | | 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.
* hwcontext_vulkan: dynamically load functionsLynne2021-04-30
| | | | This patch allows for alternative loader implementations.
* avutil/hwcontext_vulkan: fix format specifiers for some printed variablesJames Almer2021-04-29
| | | | | | | | | | 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>
* hwcontext_vulkan: reorder structure fields and add spaces in betweenLynne2021-04-28
| | | | We're in the middle of an ABI unstable period, so we're allowed to.
* Bump major versions of all libraries.Anton Khirnov2021-04-27
| | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>