summaryrefslogtreecommitdiff
path: root/libavutil
Commit message (Collapse)AuthorAge
* avutil/opt: only skip evaluation for rational optionsMarton Balint2020-05-01
| | | | | | | | | | | | Fixes problems when non-rational options were set using rational expressions, causing rounding errors and the option range limits not to be enforced properly. ffmpeg -f lavfi -i "sine=r=96000/2" This caused an assertion failure with assert level 2. Signed-off-by: Marton Balint <cus@passwd.hu>
* lavu/version: bump minor version for DOVI sidedataJun Zhao2020-04-25
| | | | | | | bump minor version for DOVI sidedata, because added the dovi_meta.h as lavu API part. Also update APIchanges. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavutil: add DOVI related headervacingfang2020-04-23
| | | | | | add DOVI related struct Signed-off-by: vacingfang <vacingfang@tencent.com>
* hwcontext_vulkan: correctly download and upload flipped imagesLynne2020-04-21
| | | | | | | | | | | | We derive the destination buffer stride from the input stride, which meant if the image was flipped with a negative stride, we'd be FFALIGNING a negative number which ends up being huge, thus making the Vulkan buffer allocation fail and the whole image transfer fail. Only found out about this as OpenGL compositors can copy an entire image with a single call if its flipped, rather than iterate over each line.
* avutil/log: update text requesting samplesMarton Balint2020-04-17
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* lavu/mem: Make other alloc functions more similar to av_malloc().Carl Eugen Hoyos2020-04-12
| | | | | | | Do not limit the array allocation functions and av_calloc() to allocations of INT_MAX, instead depend on max_alloc_size like av_malloc(). Allows a workaround for ticket #7140.
* hwcontext_vulkan: only use one semaphore per imageLynne2020-04-07
| | | | | | The idea was to allow separate planes to be filtered independently, however, in hindsight, literaly nothing uses separate per-plane semaphores and it would only work when each plane is backed by separate device memory.
* avutil/hwcontext_cuda: Only handle CUDA hardware framesTimo Rothenpieler2020-04-06
|
* avutil/opt: Don't use NULL for %s string in a log messageAndreas Rheinhardt2020-04-01
| | | | | | | | | | | | | | | If one calls av_opt_set() with an incorrect string to set the value of an option of type AV_OPT_TYPE_VIDEO_RATE, the given string is used in a log message via %s. This also happens when the string is actually a nullpointer in which case using it for %s is forbidden. This commit changes this by erroring out early in case of a nullpointer. This also fixes a warning from GCC 9.2: "‘%s’ directive argument is null [-Wformat-overflow=]" Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avutil/frame: make frame copy functions hwframe awareTimo Rothenpieler2020-03-28
|
* avutil/hwcontext: correctly set extended_data on hwframe_get_bufferTimo Rothenpieler2020-03-28
|
* lavu/tx: add 2-point FFT transformLynne2020-03-23
| | | | | | By itself, this allows 6-point, 10-point and 30-point transforms. When the 9-point transform is added it allows for 18-point FFT, and also for a 36-point MDCT (used by MP3).
* lavu/tx: improve documentationLynne2020-03-23
|
* hwcontext_opencl: include header file in HEADERSDaniel Playfair Cal2020-03-20
| | | | | | | | This matches the inclusion of the other hwcontext_<hwaccel>.h headers. The skipping of the header depending on build flags is already present. Signed-off-by: Daniel Playfair Cal: <daniel.playfair.cal@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avutil/hwcontext_cuda: combine transfer functionsTimo Rothenpieler2020-03-19
| | | | | Gets rid of some mostly duplicated code and adds the ability to do hardware to hardware transfers.
* avutil/hwcontext_cuda: add YUVA420P pixel formatYaroslav Pogrebnyak2020-03-19
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* hwcontext_vulkan: fix imported image bitmaskLynne2020-03-17
|
* hwcontext_vulkan: support more than one plane per DMABUF layerLynne2020-03-12
| | | | | Requires the dmabuf modifiers extension. Allows for importing of compressed images with a second plane.
* hwcontext_vulkan: duplicate DMABUF objects before importing themLynne2020-03-12
| | | | | | | | The specifications are very vague about who has ownership, and in this case, Vulkan takes ownership of all DMABUF FDs passed to it, causing errors to occur if someone gave us images for mapping which were meant to be kept. The old behavior worked with one-way VAAPI and DMABUF imports, but was broken with clients like wlroots' dmabuf-capture.
* hwcontext_vulkan: initialize semaphores of DMABUF importsLynne2020-03-12
| | | | | | | | | There was a recent change in Intel's driver that triggered a driver-internal error if the semaphore given to the command buffer wasn't initialized. Given that the specifications require the semaphore to be initialized, this is within spec. Unlike what's causing it in the first place, which is that there are no ways to extract/import dma sync objects from DMABUFs, so we must leave our semaphores bare.
* hwcontext_vulkan: only convert image layout for transfers if necessaryLynne2020-03-12
|
* hwcontext_vulkan: minor corrections for DMABUF mappingLynne2020-03-12
| | | | We need to consider the amount of layers instead of the image's planes.
* hwcontext_vaapi: Only accept a render node when deriving from DRM deviceMark Thompson2020-02-24
| | | | | | | | | | | | | If we are given a non-render node, try to find the matching render node and fail if that isn't possible. libva will not accept a non-render device which is not DRM master, because it requires legacy DRM authentication to succeed in that case: <https://github.com/intel/libva/blob/master/va/drm/va_drm.c#L68-L75>. This is annoying for kmsgrab because in most recording situations DRM master is already held by something else (such as a windowing system), leading to device derivation not working and forcing the user to create the target VAAPI device separately.
* lavu/hwcontext_vaapi: add vaapi_format_map support for Y210Linjie Fu2020-02-24
| | | | | | | | | | | | | VA_RT_FORMAT describes the desired sampling format for surface. When creating surface, VA_RT_FORMAT will be used firstly to choose the expected fourcc/media_format for the surface. And the fourcc will be revised by the value of VASurfaceAttribPixelFormat. Add vaapi_format_map support for new pixel_format Y210. This is fundamental for both VA-API and QSV. Signed-off-by: Linjie Fu <linjie.fu@intel.com>
* lavu/pix_fmt: add new pixel format y210Linjie Fu2020-02-24
| | | | | | | Add some packed 4:2:2 10-bit pixel formats for hardware decode support in VAAPI and QSV. Signed-off-by: Linjie Fu <linjie.fu@intel.com>
* avutil/hwcontext_d3d11va: Use secure dlopen.Matt Oliver2020-02-15
| | | | dlopen contains additional security to prevent dll hijacking compared to standard LoadLibrary.
* lavu/tx: improve 3-point fixed precisionLynne2020-02-14
| | | | | There's just no reason not to when its so easy (albeit messy) and its also reducing the precision of all non-power-of-two transforms that use it.
* lavu/tx: slightly optimize fft15Lynne2020-02-13
| | | | Saves 2 additions.
* lavu/tx: undef the correct macroLynne2020-02-13
| | | | It was renamed and no warning was given for undeffing a nonexisting one.
* lavu/tx: implement 32 bit fixed point FFT and MDCTLynne2020-02-13
| | | | | | | | | | | | | | | | | | | | Required minimal changes to the code so made sense to implement. FFT and MDCT tested, the output of both was properly rounded. Fun fact: the non-power-of-two fixed-point FFT and MDCT are the fastest ever non-power-of-two fixed-point FFT and MDCT written. This can replace the power of two integer MDCTs in aac and ac3 if the MIPS optimizations are ported across. Unfortunately the ac3 encoder uses a 16-bit fixed point forward transform, unlike the encoder which uses a 32bit inverse transform, so some modifications might be required there. The 3-point FFT is somewhat less accurate than it otherwise could be, having minor rounding errors with bigger transforms. However, this could be improved later, and the way its currently written is the way one would write assembly for it. Similar rounding errors can also be found throughout the power of two FFTs as well, though those are more difficult to correct. Despite this, the integer transforms are more than accurate enough.
* avutil/log: Add av_log_once() for printing a message just once with a high ↵Michael Niedermayer2020-02-12
| | | | | | | | | log level Compared to ad-hoc if(printed) ... code this allows the user to disable it by adjusting the log level Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/log: add support for multibyte console log for win32Marton Balint2020-02-09
| | | | | | Fixes ticket #5398. Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/log: add support for forced ANSI colors on win32Marton Balint2020-02-09
| | | | | | | To make behavior the same as non-win32 code when the standard error is redirected. Also restructure the code a bit. Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/log: fix detecting console mode on Win32Marton Balint2020-02-09
| | | | | | A redirected stderr can still have a valid handle. Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/log: factorize ansi_fputsMarton Balint2020-02-09
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/log: drop support for NO_COLOR environment variableMarton Balint2020-02-09
| | | | | | Deprecated for more than 9 years now. Signed-off-by: Marton Balint <cus@passwd.hu>
* lavu/tx: mention FFT output is not normalizedLynne2020-02-08
| | | | | | | Not even FFTW's output is normalized. This should prevent at least some users from complaining that doing a forward transform followed by an inverse transform has a mismatching output to the original input.
* lavu: bump minor version for the Vulkan patchsetLynne2020-02-04
|
* lavu/hwcontext_cuda: refactor context initialisationPhilip Langdale2020-02-04
| | | | | There's enough going on here now that it should not be duplicated between cuda_device_create and cuda_device_derive.
* lavu: add Vulkan hwcontext codeLynne2020-02-04
| | | | | | | | | | This commit adds the necessary code to initialize and use a Vulkan device within the hwcontext libavutil framework. Currently direct mapping to VAAPI and DRM frames is functional, and transfers to CUDA and native frames are supported. Lets hope the future Vulkan video decode extension fits well within this framework.
* lavu/hwcontext: Add support for HW -> HW transfersPhilip Langdale2020-02-04
| | | | | | | | | | | | | | | | | | | | We are beginning to consider scenarios where a given HW Context may be able to transfer frames to another HW Context without passing via system memory - this would usually be when two contexts represent different APIs on the same device (eg: Vulkan and CUDA). This is modelled as a transfer, as we have today, but where both the src and the dst are hardware frames with hw contexts. We need to be careful to ensure the contexts are compatible - particularly, we cannot do transfers where one of the frames has been mapped via a derived frames context - we can only do transfers for frames that were directly allocated by the specified context. Additionally, as we have two hardware contexts, the transfer function could be implemented by either (or indeed both). To handle this uncertainty, we explicitly look for ENOSYS as an indicator to try the transfer in the other direction before giving up.
* avutil/common: warn about possible move of the data pointer after the last 0 ↵Marton Balint2020-01-31
| | | | | | byte in GET_UTF8 Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/common: put ERROR statements into separate code blocks in GET_UTF8/16Marton Balint2020-01-31
| | | | | | To be able to safely use more than one statement in ERROR. Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/common: add parenthesis around GET_16BIT in GET_UTF16Marton Balint2020-01-31
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/common: use unsigned int in GET_UTF8Marton Balint2020-01-31
| | | | | | Right shift of signed value is implementation defined. Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/thread: fix strict_pthread_cond_timedwaitMarton Balint2020-01-25
| | | | | | Timeout error was assumed to be fatal which it is not. Signed-off-by: Marton Balint <cus@passwd.hu>
* libavutil: x86: Include stdlib.h before using _byteswap_ulongMartin Storsjö2020-01-23
| | | | | | | When clang works in MSVC mode, it does have the _byteswap_ulong builtin, but one has to include stdlib.h before using it. Signed-off-by: Martin Storsjö <martin@martin.st>
* configure: Check for GetStdHandle in addition to SetConsoleTextAttributeMartin Storsjö2020-01-23
| | | | | | | | | SetConsoleTextAttribute used to be unavailable for Windows Store apps, but is available to them now. But GetStdHandle still is unavailable, thus make sure to check for both functions before using code that requires both. Signed-off-by: Martin Storsjö <martin@martin.st>
* avutil/log: Move log_level_offset_offset code from av_log() to v_log()Michael Niedermayer2020-01-22
| | | | | Suggested-by: Anton Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/thread: Add pthread_cond_timedwait functionMatt Oliver2020-01-21
| | | | | | v2: fix calculating milisecond times and use SleepConditionVariableSRW. Signed-off-by: Matt Oliver <protogonoi@gmail.com>