summaryrefslogtreecommitdiff
path: root/libavutil
Commit message (Collapse)AuthorAge
* avutil/mem: fix doc for reallocsZhao Zhili2022-05-26
| | | | | | | | | | The doc says those function are like av_free if size or nmemb is zero. It doesn't match the code. av_realloc() realloc one byte if size is zero, which was added by 91ff05f6ac5 ten years ago. realloc() itself in C is implementation-dependent. Make the doc match the longstanding behaviour. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* qsv: add requirement for the mininal version of libmfxHaihao Xiang2022-05-25
| | | | | | | | | | 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>
* libavutil: Deprecate av_fopen_utf8, provide an avpriv versionMartin Storsjö2022-05-23
| | | | | | | | | | | | | | | | | | | | | | Since every DLL can use an individual CRT on Windows, having an exported function that opens a FILE* won't work if that FILE* is going to be used from a different DLL (or from user application code). Internally within the libraries, the issue can be worked around by duplicating the function in all libraries (this already happened implicitly because the function resided in file_open.c) and renaming the function to ff_fopen_utf8 (so that it doesn't end up exported from the DLLs) and duplicating it in all libraries that use it. This makes the avpriv_fopen_utf8 / ff_fopen_utf8 function work in the exact same way as the existing avpriv_open / ff_open, with the same setup as introduced in e743e7ae6ee7e535c4394bec6fe6650d2b0dbf65. That mechanism doesn't work for external users, thus deprecate the existing function. Signed-off-by: Martin Storsjö <martin@martin.st>
* avutil/hwcontext_qsv: fix mapping issue between QSV frames and D3D11VA framesTong Wu2022-05-23
| | | | | | | | | | | | Fixes: $ ffmpeg.exe -init_hw_device d3d11va=d3d11 -init_hw_device \ qsv=qsv@d3d11 -s:v WxH -pix_fmt nv12 -i input.yuv -vf \ "hwupload=extra_hw_frames=16,hwmap=derive_device=d3d11va,format=d3d11,\ hwmap=derive_device=qsv,format=qsv" -f null - Reviewed-by: Soft Works <softworkz@hotmail.com> Signed-off-by: Tong Wu <tong1.wu@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* avutil/hwcontext_d3d11va: pass the format value from outside for staging textureTong Wu2022-05-23
| | | | | | | | | | | | | | | | In d3d11va_create_staging_texture(), during the hwmap process, the ctx->internal->priv is not initialized, resulting in the texDesc.Format not initialized. Now pass the format value from d3d11va_transfer_data() to fix it. $ ffmpeg.exe -y -hwaccel qsv -init_hw_device d3d11va=d3d11 \ -init_hw_device qsv=qsv@d3d11 -c:v h264_qsv \ -i input.h264 -vf "hwmap=derive_device=d3d11va,format=d3d11,hwdownload,format=nv12" \ -f null - Reviewed-by: Soft Works <softworkz@hotmail.com> Signed-off-by: Tong Wu <tong1.wu@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* avutil/hwcontext_qsv: derive QSV frames to D3D11VA framesTong Wu2022-05-23
| | | | | | | | | | | Fixes: $ ffmpeg.exe -y -hwaccel qsv -init_hw_device d3d11va=d3d11 \ -init_hw_device qsv=qsv@d3d11 -c:v h264_qsv -i input.h264 \ -vf "hwmap=derive_device=d3d11va,format=d3d11" -f null - Reviewed-by: Soft Works <softworkz@hotmail.com> Signed-off-by: Tong Wu <tong1.wu@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* x86/tx_float: replace fft_sr_avx with fft_sr_fma3Lynne2022-05-21
| | | | | | | | | | | | When the SLOW_GATHER flag was added to the AVX2 version, this made FMA3-features not enabled on Zen CPUs. As FMA3 adds 6-7% across all platforms that support it, in the interest of saving space, this commit removes the AVX version and replaces it with an FMA3 version. The only CPUs affected are Sandy Bridge and Bulldozer, which have AVX support, but no FMA3 support. In the future, if there's a demand for it, a version of the function duplicated for AVX can be added.
* x86/tx_float: improve temporary register allocation for loadsLynne2022-05-21
| | | | | | | | | | On Zen 3: Before: 1484285 decicycles in av_tx (fft), 131072 runs, 0 skips After: 1415243 decicycles in av_tx (fft), 131072 runs, 0 skips
* lavu/tx: make slow ISA extension penalties smarterLynne2022-05-21
| | | | | | | | Instead of having a fixed -64 prio penalty, make the penalties more granular. As the prio is based on the register size in bits, decrementing it by 129 makes AVX SLOW functions be avoided in favor of any SSE versions.
* x86/tx_float: add AV_CPU_FLAG_AVXSLOW/SLOW_GATHER flags where appropriateLynne2022-05-21
|
* Revert "x86/tx_float: remove vgatherdpd usage"Lynne2022-05-21
| | | | | | | | This reverts commit 82a68a8771ca39564f6a74e0f875d6852e7a0c2a. Smarter slow ISA penalties makes gathers still useful. The intention is to use gathers with the final stage of non-ptwo iMDCTs, where they give benefit.
* x86/tx_float: remove vgatherdpd usageLynne2022-05-20
| | | | | | | | | | | | | | | | | | | | Its performance loss ranges from either being just as fast as individual loads (Skylake), a few percent slower (Alderlake), 8% slower (Zen 3), to completely disasterous (older/other CPUs). Sadly, gathers never panned out fast on x86, even with the benefit of time and implementation experience. This also saves a register, as there's no need to fill out an additional register mask. Zen 3 (16384-point transform): Before: 1561050 decicycles in av_tx (fft), 131072 runs, 0 skips After: 1449621 decicycles in av_tx (fft), 131072 runs, 0 skips Alderlake: 2% slower on big transforms (65536), to 1% (131072), to a few percent for smaller sizes.
* lib*/version: Move library version functions into files of their ownAndreas Rheinhardt2022-05-10
| | | | | | | 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>
* avutil/hwcontext_videotoolbox: create real buffer poolZhao Zhili2022-04-29
| | | | | | vt_get_buffer shouldn't do buffer pool's job. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avutil/timecode: use timecode fps for number of frame digitsMarton Balint2022-04-22
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/cpu: #define _GNU_SOURCE before including any standard headersMarton Balint2022-04-22
| | | | | | | | Otherwise its effect might not work causing CPU_COUNT to not get defined. Fixes cpu count detection to actually use sched_getaffinity if available. Signed-off-by: Marton Balint <cus@passwd.hu>
* libavutil/hwcontext_qsv: Align width and heigh when download qsv frameWenbin Chen2022-04-13
| | | | | | | | | | | | The width and height for qsv frame to download need to be aligned with 16. Add the alignment operation. Now the following command works: ffmpeg -hwaccel qsv -f rawvideo -s 1920x1080 -pix_fmt yuv420p -i \ input.yuv -vf "hwupload=extra_hw_frames=16,format=qsv,hwdownload, \ format=nv12" -f null - Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* libavutil/hwcontext_vaapi: Re-enable support for libva v1Ingo Brückl2022-04-06
| | | | | | | | | | | | | | | | Commit e050959103f375e6494937fa28ef2c4d2d15c9ef implemented passing in modifiers by using the PRIME_2 memory type, which only exists in v2 of the library. To still support v1 of the library, conditionally compile using VA_CHECK_VERSION() for both the new code and the old code before the commit. Note PRIME_2 memory was introduced from VA-API 1.1, so use VA_CHECK_VERSION(1, 1, 0) instead of VA_CHECK_VERSION(2, 0, 0) (Haihao) Signed-off-by: Ingo Brückl <ib@wupperonline.de> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* avutil/channel_layout: return earlier on UNSPEC layouts in ↵James Almer2022-03-25
| | | | | | | | | av_channel_layout_subset() No point running all 64 iterations in the loop to never write anything to ret. Also make ambisonic layouts check its mask too while at it. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/tests/channel_layout: also test ambisonic layouts in ↵James Almer2022-03-25
| | | | | | av_channel_layout_subset() Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/tests/channel_layout: test av_channel_layout_check()James Almer2022-03-25
| | | | | | Should increase test coverage Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/tests/channel_layout: test the output of av_channel_layout_subset()James Almer2022-03-25
| | | | | | Should increase test coverage a bit Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/tests/channel_layout: test the output of av_channel_layout_standard()James Almer2022-03-25
| | | | | | Should increase test coverage. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/tests/channel_layout: test generating a custom layout using ambisonic ↵James Almer2022-03-25
| | | | | | | | channels and a non diegetic channel with a custom name Should increase test coverage a bit Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/channel_layout: add missing check for AV_CHAN_NONE in ↵James Almer2022-03-25
| | | | | | | | av_channel_description Prevents printing "user -1" on invalid channel ids. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/channel_layout: don't try to print NULL string pointers in ↵James Almer2022-03-25
| | | | | | | | av_channel_{name,description} Instead fallback to print USR%d for channels id < 64 without a known name. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/opt: add missing case for AV_OPT_TYPE_CHLAYOUT in av_opt_free()James Almer2022-03-18
| | | | | | Fixes potential memleaks for existing options of this type. Signed-off-by: James Almer <jamrial@gmail.com>
* Fix libversion.sh for split version headers, to unbreak shared library buildsMartin Storsjö2022-03-17
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* avutil/attributes: add support for clang in AV_NOWARN_DEPRECATEDJames Almer2022-03-16
| | | | | Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/channel_layout: remove duplicate stereo downmix entryJames Almer2022-03-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/channel_layout: do not copy alloc new map for extra channel layoutMarton Balint2022-03-15
| | | | | | | Also use av_channel_layout_bprint directly for describing channel layout for extra channels. Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/channel_layout: fix av_channel_layout_describe_bprint with custom and ↵Marton Balint2022-03-15
| | | | | | | | | | | | | ambisonic channels bp->len cannot be used to detect if try_describe_ambisonic was successful because the bprint buffer might contain other data as well. Also describing an invalid ambisonic layout should not return 0 but AVERROR(EINVAL) instead, so change try_describe_ambisonic to actually return error on invalid ambisonics. This also allows us to fix the first issue. Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/channel_layout: factorize ambisonic order detectionMarton Balint2022-03-15
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/channel_layout: print channels using av_channel_name_bprint in ↵Marton Balint2022-03-15
| | | | | | | | | av_channel_layout_describe_bprint This reduces code duplication an allows printing AMBI%d channel names for custom layouts for non-standard or partial ambisonic layouts. Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/channel_layout: Fix leak of stringAndreas Rheinhardt2022-03-15
| | | | | | | Fixes memleaks in the channel_layout FATE-test. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Bump minor versions after the channel layout changesJames Almer2022-03-15
| | | | | | Forgotten in the respective commits adding new API. Signed-off-by: James Almer <jamrial@gmail.com>
* channel_layout: add support for AmbisonicVittorio Giovara2022-03-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avframe: switch to the new channel layout APIAnton Khirnov2022-03-15
| | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* lavu: support AVChannelLayout AVOptionsAnton Khirnov2022-03-15
| | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* fate: add a channel_layout API testJames Almer2022-03-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/channel_layout: Add a new channel layout APIAnton Khirnov2022-03-15
| | | | | | | | | | | | | The new API is more extensible and allows for custom layouts. More accurate information is exported, eg for decoders that do not set a channel layout, lavc will not make one up for them. Deprecate the old API working with just uint64_t bitmasks. Expanded and completed by Vittorio Giovara <vittorio.giovara@gmail.com> and James Almer <jamrial@gmail.com>. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* aarch64: Only emit the PAC/BTI note section when targeting ELFMartin Storsjö2022-03-15
| | | | | | | | | This avoids build errors if such features are enabled while targeting another binary format. (Using such features on other platforms might require some other form of signaling/setup though, but the ELF specific .note section isn't applicable at least.) Signed-off-by: Martin Storsjö <martin@martin.st>
* avutil/hwcontext_vulkan: fix typo in undefZhao Zhili2022-03-14
|
* avutil/cpu: add AVX512 Icelake flagWu Jianhua2022-03-10
| | | | | | Signed-off-by: Wu Jianhua <jianhua.wu@intel.com> Reviewed-by: Henrik Gramner <henrik@gramner.com> Signed-off-by: James Almer <jamrial@gmail.com>
* arm64: Add Armv8.3-A PAC support to assembly filesAndre Kempe2022-03-09
| | | | | | | | | | | This patch adds optional support for Arm Pointer Authentication Codes. PAC support is turned on or off at compile time using additional compiler flags. Unless any of these is enabled explicitly, no additional code will be emitted at all. Signed-off-by: André Kempe <andre.kempe@arm.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* avutil: [loongarch] Update loongson_intrinsics.h to v1.1.0Hao Chen2022-03-01
| | | | | | | | | The loongson_intrinsics.h file is updated from v1.0.3 version to v1.1.0. Some spelling mistakes are fixed and new functions are added. Signed-off-by: Hao Chen <chenhao@loongson.cn> Reviewed-by: 殷时友 <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil: support for CUVA Vivid HDR metadataLimin Wang2022-03-01
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avutil: make lzo always compileJames Almer2022-02-26
| | | | | | | | Having optionally installed headers is a bad idea as there's no way to know if they are present or not (unless a define is added to avconfig.h, but that's just ugly). Signed-off-by: James Almer <jamrial@gmail.com>
* Remove unnecessary libavutil/(avutil|common|internal).h inclusionsAndreas Rheinhardt2022-02-24
| | | | | | | | | | Some of these were made possible by moving several common macros to libavutil/macros.h. While just at it, also improve the other headers a bit. Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/avassert: Don't include avutil.hAndreas Rheinhardt2022-02-24
| | | | | Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>