summaryrefslogtreecommitdiff
path: root/libavutil
Commit message (Collapse)AuthorAge
* Revert "avutil/timecode: fix sscanf format string with garbage at the end"Marton Balint2021-01-23
| | | | | | | | | This reverts commit 6696a07ac62bfec49dd488510a719367918b9f7a. It is wrong to restrict timecodes to always contain leading zeros or for hours or frames to be 2 chars only. Signed-off-by: Marton Balint <cus@passwd.hu>
* avutils/vulkan: hwmap, respect src frame resolutionXu Guangxin2021-01-22
| | | | | | | | | | | | | fixes http://trac.ffmpeg.org/ticket/9055 The hw decoder may allocate a large frame from AVHWFramesContext, and adjust width and height based on bitstream. We need to use resolution from src frame instead of AVHWFramesContext. test command: ffmpeg -loglevel debug -hide_banner -hwaccel vaapi -init_hw_device vaapi=va:/dev/dri/renderD128 -hwaccel_device va -hwaccel_output_format vaapi -init_hw_device vulkan=vulk -filter_hw_device vulk -i 1920x1080.264 -c:v libx264 -r:v 30 -profile:v high -preset veryfast -vf "hwmap,chromaber_vulkan=0:0,hwdownload,format=nv12" -map 0 -y vaapiouts.mkv expected: No green bar at bottom.
* All: update names in copyright headersrcombs2021-01-20
|
* avutil/timecode: Avoid undefined behavior with large framenumMichael Niedermayer2021-01-19
| | | | | | | | Fixes: signed integer overflow: 2147462079 + 2149596 cannot be represented in type 'int' Fixes: 27565/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5091972813160448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/timecode: fix sscanf format string with garbage at the endLimin Wang2021-01-16
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avutil/tx: use ENOSYS instead of ENOTSUPJames Almer2021-01-13
| | | | | | | It's the standard error code used across the codebase to signal unimplemented or unsupported features. Signed-off-by: James Almer <jamrial@gmail.com>
* lavu: support arbitrary-point FFTs and all even (i)MDCT transformsLynne2021-01-13
| | | | | | | | | This patch adds support for arbitrary-point FFTs and all even MDCT transforms. Odd MDCTs are not supported yet as they're based on the DCT-II and DCT-III and they're very niche. With this we can now write tests.
* avutil/eval: Unconditionally check argument of e_divMichael Niedermayer2021-01-11
| | | | | | | | Fixes: division by zero Fixes: 26451/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVO_fuzzer-4756955832516608 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavu/tx: clip when converting table values to fixed-pointLynne2021-01-09
| | | | | | | | | | | | | | | | | | INT32_MAX (2147483647) isn't exactly representable by a floating point value, with the closest being 2147483648.0. So when rescaling a value of 1.0, this could overflow when casting the 64-bit value returned from lrintf() into 32 bits. Unfortunately the properties of integer overflows don't match up well with how a Fourier Transform operates. So clip the value before casting to a 32-bit int. Should be noted we don't have overflows with the table values we're currently using. However, converting a Kaiser-Bessel window function with a length of 256 and a parameter of 5.0 to fixed point did create overflows. So this is more of insurance to save debugging time in case something changes in the future. The macro is only used during init, so it being a little slower is not a problem.
* Mark some pointers as constAndreas Rheinhardt2021-01-01
| | | | | Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* mpegvideo: use the AVVideoEncParams API for exporting QP tablesAnton Khirnov2021-01-01
| | | | | | | | | | Do it only when requested with the AV_CODEC_EXPORT_DATA_VIDEO_ENC_PARAMS flag. Drop previous code using the long-deprecated AV_FRAME_DATA_QP_TABLE* API. Temporarily disable fate-filter-pp, fate-filter-pp7, fate-filter-spp. They will be reenabled once these filters are converted in following commits.
* lavu/mem: move the DECLARE_ALIGNED macro family to mem_internal on next+1 bumpAnton Khirnov2021-01-01
| | | | They are not properly namespaced and not intended for public use.
* lavu: move LOCAL_ALIGNED from internal.h to mem_internal.hAnton Khirnov2021-01-01
| | | | That is a more appropriate place for it.
* hwcontext_drm: make dependency on Linux kernel headers optionalLynne2020-12-30
| | | | | | | | | | This was introduced in version 4.6. And may not exist all without an optional package. So to prevent a hard dependency on needing the Linux kernel headers to compile, make this optional. Also ignore the status of the ioctl, since it may fail on older kernels which don't support it. It's okay to ignore as its not fatal and any serious errors will be caught later by the mmap call.
* lavu: use address-of operator checking clock_gettimeMarvin Scholz2020-12-28
| | | | | | | | | | | | When targeting a recent enough macOS/iOS version that has clock_gettime it won't be a weak symbol, in which case clang warns for this check as it's always true: warning: address of function 'clock_gettime' will always evaluate to 'true' This warning is silenced by using the address-of operator to make the intent explicit.
* hwcontext_vulkan: wait and signal semaphores when transferring to CUDALynne2020-12-05
| | | | | Same as when downloading. Not sure why this isn't done, probably because the CUDA code predates the sync mechanism we settled on.
* avutil/opt: add AV_OPT_FLAG_DEPRECATED optionLimin Wang2020-12-05
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avutil/timecode: add av_timecode_init_from_componentsMarton Balint2020-12-03
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/timecode: allow drop frame timecodes for multiples of 30000/1001 fpsMarton Balint2020-12-03
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/film_grain_params: fix doxy for ar_coeff_* fieldsJames Almer2020-12-03
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/avsscanf: fix possible overreads when dealing with %c or %sPaul B Mahol2020-12-02
|
* hwcontext_vulkan: reduce priority for PACK32 formatsLynne2020-11-27
| | | | Due to some endian-dependent overlap, these should be used last.
* avutil/film_grain_params: add more details to some AVFilmGrainAOMParams fieldsJames Almer2020-11-26
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* lavu/film_grain_params: fix typo in type enumLynne2020-11-27
| | | | Ref: xkcd #1015
* hwcontext_vulkan: optionally enable more functionalityNiklas Haas2020-11-25
| | | | | | These two extensions and two features are both optionally used by libplacebo to speed up rendering, so it makes sense for libavutil to automatically enable them as well.
* hwcontext_vulkan: support additional pixel formatsLynne2020-11-25
| | | | | We support every single packed format possible now. There are some fringe leftover mappings which are uninteresting.
* hwcontext_vulkan: fix incorrect A/0BGR mappingLynne2020-11-25
| | | | | | | | Vulkan formats with a PACK suffix define native endianess. Vulkan formats without a PACK suffix are in bytestream order. Pixel formats with a LE/BE suffix define endianess. Pixel formats without LE/BE suffix are in bytestream order.
* hwcontext_vulkan: simplify plane size calculations and support 4-plane formatsLynne2020-11-25
| | | | Needed to support YUVA.
* hwcontext_vulkan: do not segfault when failing to init a AVHWFramesContextLynne2020-11-25
| | | | | frames_uninit is always called on failure, and the free_exec_ctx function did not zero the pool when freeing it, so it resulted in a double free.
* hwcontext_vulkan: always attempt to map host memory when transferringLynne2020-11-25
| | | | | | | | | | | | | | This relies on the fact that host memory is always going to be required to be aligned to the platform's page size, which means we can adjust the pointers when we map them to buffers and therefore skip an entire copy. This has already had extensive testing in libplacebo without problems, so its safe to use here as well. Speeds up downloads and uploads on platforms which do not pool their memory hugely, but less so on platforms that do. We can pool the buffers ourselves, but that can come as a later patch if necessary.
* hwcontext_vulkan: check for memory size before choosing typeLynne2020-11-25
| | | | | It makes allocation a bit more robust in case some weird device with weird drivers which segments memory in weird ways appears.
* hwcontext_vulkan: correctly access the p->extensions bitmaskLynne2020-11-25
| | | | Its a 64-bit bitfield being put directly into an int.
* hwcontext_vulkan: unify download/upload functionsLynne2020-11-25
| | | | They were identical, save for variable names and order.
* hwcontext_vulkan: add VkExternalMemoryBufferCreateInfo to imported buffersLynne2020-11-25
| | | | Its a validation layer thing.
* hwcontext_vulkan: do not use uninitialized variables on errors in CUDA codeLynne2020-11-25
|
* hwcontext_drm: issue DMA_BUF_IOCTL_SYNC when mapping FDsLynne2020-11-25
| | | | | This improves performance and helps a little when given FDs without any synchronization fences.
* libavutil: introduce AVFilmGrainParams side dataLynne2020-11-25
| | | | | | | | This patch introduces a new frame side data type AVFilmGrainParams for use with video codecs which support it. It can save a lot of memory used for duplicate processed reference frames and reduce copies when applying film grain during presentation.
* lavu: add missing stddef.h includes for size_t.Anton Khirnov2020-11-20
|
* avutil/frame: fix potential leaks in av_frame_ref()Gil Pedersen2020-11-19
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/frame: use av_buffer_replace() to simplify codeGil Pedersen2020-11-19
| | | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Gil Pedersen <git@gpost.dk> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/hwcontext_cuda: fix edge case with non-even frame heightsTimo Rothenpieler2020-11-04
|
* avutil/hwcontext_cuda: query correct alignment from deviceTimo Rothenpieler2020-11-04
|
* avutil/hwcontext_cuda: increase CUDA frame alignment to 512Timo Rothenpieler2020-11-03
| | | | | At least on Turing, a frame without 512 byte alignment cannot be passed to cuTexObjectCreate.
* avutil/mathematics: Use av_sat_add64() for the last addition in av_add_stable()Michael Niedermayer2020-10-25
| | | | | | | | Fixes: signed integer overflow: 9223372036854770375 + 5450 cannot be represented in type 'long' Fixes: 26471/clusterfuzz-testcase-minimized-ffmpeg_dem_MXG_fuzzer-6229617557635072 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/common: Implement av_sat_add64_c() with fewer branchesMichael Niedermayer2020-10-24
| | | | | | | | No benchmark because this is not used in any speed relevant pathes nor is it used where __builtin_add_overflow is available. So I do not know how to realistically benchmark it. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/pixdesc: add missing FF_API_PSEUDOPAL checkJames Almer2020-10-02
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* lavu/buffer: add a convenience function for replacing buffersAnton Khirnov2020-09-28
| | | | | | | A common pattern e.g. in libavcodec is replacing/updating buffer references: unref old one, ref new one. This function allows simplifying such code and avoiding unnecessary refs+unrefs if the references are already equivalent.
* avutil/pixfmt: improve definition of AVColorRangeJan Ekström2020-09-23
| | | | | | | | | | | | As it was brought up that the current documentation leaves things as specific to YCbCr only, ICtCp and RGB are now mentioned. Additionally, the specifications on which these definitions of narrow and full range are defined are mentioned. This way, the documentation of AVColorRange should now match how most people seem to read interpret it at this point, and thus flagging RGB AVFrames as full range is valid not only according to common sense, but also the enum definition.
* avutil/fixed_dsp: Fix integer overflows in butterflies_fixed_c()Michael Niedermayer2020-09-19
| | | | | | | | Fixes: signed integer overflow: 0 - -2147483648 cannot be represented in type 'int' Fixes: 23646/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5480991098667008 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/cuda_check: add missing dynlink_loader.h includeJames Almer2020-09-15
| | | | | | Fixes make checkheaders Signed-off-by: James Almer <jamrial@gmail.com>