summaryrefslogtreecommitdiff
path: root/libavutil
Commit message (Collapse)AuthorAge
...
* lavu/tx: reset subcontext pointer if initialization failsLynne2022-01-29
| | | | Thanks to mkver for pointing this out.
* lavu/tx: print debug info even if no transforms are foundLynne2022-01-28
|
* avutil/tx: add null pointer check after av_malloczSteven Liu2022-01-28
| | | | | | | Fix CID: 1497863 there will get null pointer in attempt to initialize each if alloc memory failed. Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
* avutil/tx: remove deadcode of the control flowSteven Liu2022-01-28
| | | | | | | | | Fix CID: 1497864 The control flow should return ENOSYS if nb_cd_matches is 0 at before and the ret equal AVERROR(ENOMEM) or goto end label, so remove the last control flow if (ret >= 0) before end label. Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
* hwcontext_vulkan: avoid using 64-bit enumsLynne2022-01-27
| | | | MSVC (2016, but possibly more) still force enums to be basic ints.
* lavu/tx: avoid using 64-bit enumsLynne2022-01-27
| | | | MSVC (2016, but possibly more) still force enums to be basic ints.
* x86/tx_float: add missing FF_TX_OUT_OF_PLACE flag to functionsLynne2022-01-27
| | | | This caused smaller length dedicated transforms to not be picked up.
* lavu/tx: clean up CPU flags checkLynne2022-01-27
| | | | Just makes it more readable.
* x86/tx_float: do not build tx_float_init.c if x86 assembly is disabledLynne2022-01-27
| | | | | | | | This broke builds with --disable-mmx, which also disabled assembly entirely, but ARCH_X86 was still true, so the init file tried to find assembly that didn't exist. Instead of checking for architecture, check if external x86 assembly is enabled.
* lavu/tx: do not mix declarations and codeLynne2022-01-26
|
* x86/tx_float: add permute-free FFT versionsLynne2022-01-26
| | | | These are used in the PFA transforms and MDCTs.
* lavu: bump minor and add APIchanges for new lavu/tx additionsLynne2022-01-26
|
* lavu/tx: add an RDFT implementationLynne2022-01-26
| | | | | | | | | | | | | | | | | | RDFTs are full of conventions that vary between implementations. What I've gone for here is what's most common between both fftw, avcodec's rdft and what we use, the equivalent of which is DFT_R2C for forward and IDFT_C2R for inverse. The other 2 conventions (IDFT_R2C and DFT_C2R) were not used at all in our code, and their names are also not appropriate. If there's a use for either, we can easily add a flag which would just flip the sign on one exptab. For some unknown reason, possibly to allow reusing FFT's exp tables, av_rdft's C2R output is 0.5x lower than what it should be to ensure a proper back-and-forth conversion. This code outputs its real samples at the correct level, which matches FFTW's level, and allows the user to change the level and insert arbitrary multiplies for free by setting the scale option.
* lavu/tx: rewrite internal code as a tree-based codelet constructorLynne2022-01-26
| | | | | | | | | | This commit rewrites the internal transform code into a constructor that stitches transforms (codelets). This allows for transforms to reuse arbitrary parts of other transforms, and allows transforms to be stacked onto one another (such as a full iMDCT using a half-iMDCT which in turn uses an FFT). It also permits for each step to be individually replaced by assembly or a custom implementation (such as an ASIC).
* lavu/tx: improve documentation for existing transformsLynne2022-01-26
|
* avutil/pixfmt.h: typoDiederick Niehorster2022-01-21
| | | | | Signed-off-by: Diederick Niehorster <dcnieho@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavu/hwcontext_vulkan: clear dangling pointers on map failureAnton Khirnov2022-01-21
|
* avutil/parseutils: use quadhd for Quad HDLimin Wang2022-01-12
| | | | | | | | | qHD is 960x540 (q stands for quarter) and QHD is 2560x1440 (Q is quad). use quadhd for QHD for abbreviation. Fix ticket#9591 Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* lavu/fifo: return errors on trying to read/write too muchAnton Khirnov2022-01-10
| | | | | | | | | | Trying to write too much will currently overwrite previous data. Trying to read too much will either av_assert2() in av_fifo_drain() or return old data. Trying to peek too much will either av_assert2() in av_fifo_generic_peek_at() or return old data. Return an error code in all these cases, which is safer and more consistent.
* lavu/fifo: drop useless commentsAnton Khirnov2022-01-10
| | | | | This object was never intended to be thread-safe, so these carry no useful information.
* lavu/fifo: do not copy the whole fifo when reallocatingAnton Khirnov2022-01-10
| | | | | av_realloc() the buffer and only move the part of the ring buffer that needs it. Also avoids allocating a temporary fifo.
* lavu/fifo: simplify av_fifo_alloc()Anton Khirnov2022-01-10
| | | | Turn it into a wrapper around av_fifo_alloc_array().
* lavu/fifo: deprecate av_fifo_peek2()Anton Khirnov2022-01-10
| | | | | | It returns a pointer inside the fifo's buffer, which cannot be safely used without accessing AVFifoBuffer internals. It is easier and safer to use av_fifo_generic_peek_at().
* lavu/videotoolbox: add support for memory mapping framesCameron Gutman2022-01-06
| | | | | Signed-off-by: Cameron Gutman <aicommander@gmail.com> Signed-off-by: Aman Karmani <aman@tmm1.net>
* avutil/hwcontext_vulkan: fixed incorrect memory offsetWu Jianhua2022-01-05
| | | | | | | | This commit fixed hwupload in Vulkan: ffmpeg -init_hw_device vulkan -i test.jpg -vf hwupload,hwdownload,format=yuv420p -y out.jpg Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
* Revert "avutils/hwcontext: When deriving a hwdevice, search for existing ↵Haihao Xiang2022-01-05
| | | | | | | | | | device in both directions" This reverts commit a4289497755386435783774a4f520eb7fc23cbc9. There were objections on ML (see https://ffmpeg.org/pipermail/ffmpeg-devel/2021-December/290530.html) Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* avutils/hwcontext: When deriving a hwdevice, search for existing device in ↵Soft Works2022-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | both directions The test /libavutil/tests/hwdevice checks that when deriving a device from a source device and then deriving back to the type of the source device, the result is matching the original source device, i.e. the derivation mechanism doesn't create a new device in this case. Previously, this test was usually passed, but only due to two different kind of flaws: 1. The test covers only a single level of derivation (and back) It derives device Y from device X and then Y back to the type of X and checks whether the result matches X. What it doesn't check for, are longer chains of derivation like: CUDA1 > OpenCL2 > CUDA3 and then back to OpenCL4 In that case, the second derivation returns the first device (CUDA3 == CUDA1), but when deriving OpenCL4, hwcontext.c was creating a new OpenCL4 context instead of returning OpenCL2, because there was no link from CUDA1 to OpenCL2 (only backwards from OpenCL2 to CUDA1) If the test would check for two levels of derivation, it would have failed. This patch fixes those (yet untested) cases by introducing forward references (derived_device) in addition to the existing back references (source_device). 2. hwcontext_qsv didn't properly set the source_device In case of QSV, hwcontext_qsv creates a source context internally (vaapi, dxva2 or d3d11va) without calling av_hwdevice_ctx_create_derived and without setting source_device. This way, the hwcontext test ran successful, but what practically happened, was that - for example - deriving vaapi from qsv didn't return the original underlying vaapi device and a new one was created instead: Exactly what the test is intended to detect and prevent. It just couldn't do so, because the original device was hidden (= not set as the source_device of the QSV device). This patch properly makes these setting and fixes all derivation scenarios. (at a later stage, /libavutil/tests/hwdevice should be extended to check longer derivation chains as well) Reviewed-by: Lynne <dev@lynne.ee> Reviewed-by: Anton Khirnov <anton@khirnov.net> Tested-by: Wenbin Chen <wenbin.chen@intel.com> Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* lib*/version.h: Bump Versions after release/5.0 branchAndreas Rheinhardt2022-01-04
| | | | | | | This is done a second time for 5.0 because master was merged into 5.0 so that it contains the recent DOVI additions. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lib*/version.h: Bump Versions before release/5.0 branchAndreas Rheinhardt2022-01-04
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavu/frame: Add Dolby Vision metadata side data typeNiklas Haas2022-01-04
| | | | | | | | | | | In order to be able to extend this struct later (as the Dolby Vision RPU evolves), all of the 'container' structs are considered extensible, and the individual constituent fields must instead be accessed via offsets. The precedent for this style of access is set in <libavutil/detection_bbox.h> Signed-off-by: Niklas Haas <git@haasn.dev> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lib*/version.h: Bump Versions after release/5.0 branchMichael Niedermayer2022-01-03
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lib*/version.h: Bump Versions before release/5.0 branchMichael Niedermayer2022-01-03
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* hwcontext_vulkan: remove VK_EXT_hdr_metadata from autoloaded extensions listLynne2022-01-03
| | | | | | We don't use it. Was copied from libplacebo's recommended defaults. Creates problems with validation on Intel devices, where the driver still advertizes it, even though it's not usable without a swapchain.
* libavutil/hwcontext_qsv: clean padding when upload qsv framesWenbin Chen2021-12-23
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix #7830 When we upload a frame that is not padded as MSDK requires, we create a new AVFrame to copy data. The frame's padding data is uninitialized so it brings run to run problem. For example, If we run the following command serveral times we will get different outputs. ffmpeg -init_hw_device qsv=qsv:hw -qsv_device /dev/dri/renderD128 \ -filter_hw_device qsv -f rawvideo -s 192x200 -pix_fmt p010 \ -i 192x200_P010.yuv -vf "format=nv12,hwupload=extra_hw_frames=16" \ -c:v hevc_qsv output.265 According to https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#encoding-procedures "Note: It is the application's responsibility to fill pixels outside of crop window when it is smaller than frame to be encoded. Especially in cases when crops are not aligned to minimum coding block size (16 for AVC, 8 for HEVC and VP9)" I add a function to fill padding area with border pixel to fix this run2run problem, and also move the new AVFrame to global structure to reduce redundant allocation operation to increase preformance. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* lavu/hwcontext_videotoolbox: use OS-provided mapping routines when availablercombs2021-12-22
|
* lavu/videotoolbox: expose routine to set CVPixelBufferRef metadatarcombs2021-12-22
|
* lavu/videotoolbox: expose conversion routines for color parametersrcombs2021-12-22
| | | | | Also fixes symbol lookup errors on older macOS when built with a newer SDK, introduced in 6cab5206b0ad94990c435cb7c5cf3b29675e0231
* avutil/tests/cpu: add slowgatherJames Almer2021-12-21
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/cpu: add slowgather to av_parse_cpu_caps()James Almer2021-12-21
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/cpu: move slow gather checks below in the functionJames Almer2021-12-21
| | | | | | Put them together with other similar slow flag checks. Signed-off-by: James Almer <jamrial@gmail.com>
* libavutil/cpu: Add AV_CPU_FLAG_SLOW_GATHER.Alan Kelly2021-12-21
| | | | This flag is set on Haswell and earlier and all AMD cpus.
* avutil/display: fix inverted docZhao Zhili2021-12-20
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil: add objc.h to SKIPHEADERSAman Karmani2021-12-19
| | | | Signed-off-by: Aman Karmani <aman@tmm1.net>
* avutil/twofish: Fixed decryptionSebastian Kirmayer2021-12-19
| | | | | | | | | | The previous implementation swapped the two halves of the plaintext. The existing tests only decrypted data with a plaintext of all zeroes, which is not affected by swapping the halves. Tests which detect the old buggy behavior have been added. Signed-off-by: Sebastian Kirmayer <ffmpeg@kirmayer.eu> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil: add obj-c helpers into header-only includeAman Karmani2021-12-18
| | | | | Reviewed-by: Ridley Combs <rcombs@rcombs.me> Signed-off-by: Aman Karmani <aman@tmm1.net>
* avcodec: [loongarch] Optimize h264_chroma_mc with LASX.Shiyou Yin2021-12-15
| | | | | | | | | | | ./ffmpeg -i ../1_h264_1080p_30fps_3Mbps.mp4 -f rawvideo -y /dev/null -an before:170 after :183 Change-Id: I42ff23cc2dc7c32bd1b7e4274da9d9ec87065f20 Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Reviewed-by: guxiwei <guxiwei-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil: [loongarch] Add support for loongarch SIMD.Shiyou Yin2021-12-15
| | | | | | | | | | | LSX and LASX is loongarch SIMD extention. They are enabled by default if compiler support it, and can be disabled with '--disable-lsx' '--disable-lasx'. Change-Id: Ie2608ea61dbd9b7fffadbf0ec2348bad6c124476 Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Reviewed-by: guxiwei <guxiwei-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* hwcontext_vulkan: wait on semaphores when exporting to DRMLynne2021-12-10
| | | | There is no synchronization method for DRM yet.
* lavu: bump minor version and add doc/APIchanges entry for Vulkan changesLynne2021-12-10
|
* hwcontext_vulkan: stricter semaphore number requirementsLynne2021-12-10
| | | | | | Always require one semaphore per sw_format plane. This is what the implementation uses and relies upon throughout. This was a leftover from an earlier revision that was never needed.