summaryrefslogtreecommitdiff
path: root/libavutil
Commit message (Collapse)AuthorAge
* 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>
* avutil/avstring: Fix warning: ISO C90 forbids mixed declarations and codeLimin Wang2020-01-14
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Silence "string-plus-int" warning shown by clang.Carl Eugen Hoyos2020-01-06
| | | | libswscale/utils.c:89:42: warning: adding 'unsigned long' to a string does not append to the string [-Wstring-plus-int]
* libavutil/opt: fix memory leak after av_dict_parse_string failJun Zhao2020-01-04
| | | | | | | | | In case of failure, all the successfully set entries are stored in *pm. We need to manually free the created dictionary to avoid memory leak. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avutil/eval: Add av_expr_count_func() similar to av_expr_count_vars()Michael Niedermayer2019-12-28
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/tests/opt: add av_opt_get/av_opt_set testsMarton Balint2019-12-27
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/tests/opt: add tests for AV_OPT_TYPE_DICTMarton Balint2019-12-27
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/opt: add full support for AV_OPT_TYPE_DICTMarton Balint2019-12-27
| | | | | | | Now it is possible to set them from a string, to serialize them and to use a default value. Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/buffer: add av_buffer_pool_buffer_get_opaqueMarton Balint2019-12-26
| | | | | | | | | | In order to access the original opaque parameter of a buffer in the buffer pool. (The buffer pool implementation overrides the normal opaque parameter but also saves it so it is accessible). v2: add assertion check before dereferencing the BufferPoolEntry. Signed-off-by: Marton Balint <cus@passwd.hu>
* lavu/log: Also print the log level for level trace.Carl Eugen Hoyos2019-12-16
|
* lavu/pixfmt: Cosmetics, remove wrong end-of-comment markers.Carl Eugen Hoyos2019-12-14
|
* avutil/buffer: use appropriate atomic operationsZhao Zhili2019-12-05
| | | | | | No functional changes. ref/unref vs add/sub is symmetrical. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/hwcontext_cuda: allow using primary CUDA device contextOleg Dobkin2019-11-26
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avutil/lfg: Correct index increment type to avoid undefined behaviorMichael Niedermayer2019-11-24
| | | | | | | | Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' Fixes: 18333/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_COMFORTNOISE_fuzzer-5668481831272448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/eval: add function to track variable useGyan Doshi2019-11-17
| | | | | | | | | | | | | | | | | | | | | 1)Some filters allow cross-referenced expressions e.g. x=y+10. In such cases, filters evaluate expressions multiple times for successful evaluation of all expressions. If the expression for one or more variables contains a RNG, the result may vary across evaluation leading to inconsistent values across the cross-referenced expressions. 2)A related case is circular expressions e.g. x=y+10 and y=x+10 which cannot be succesfully resolved. 3)Certain filter variables may only be applicable in specific eval modes and lead to a failure of evaluation in other modes e.g. pts is only relevant for frame eval mode. At present, there is no reliable means to identify these occurrences and thus the error messages provided are broad or inaccurate. The helper function introduced - av_expr_count_vars - allows developers to identify the use and count of variables in expressions and thus tailor the error message, allow for a graceful fallback and/or decide evaluation order.
* avutil/frame: fix remove_side_dataZhao Zhili2019-11-11
| | | | | | | | remove_side_data is supposed to remove a single instance by design. Since new_side_data() doesn't forbid add multiple instances of the same type, remove_side_data should deal with that. Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/lfg: Document the AVLFG structMichael Niedermayer2019-11-09
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mips: msa optimizations for vc1dspgxw2019-10-30
| | | | | | | Performance of WMV3 decoding has speed up from 3.66x to 5.23x tested on 3A4000. Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/opt: print runtime flag tooPaul B Mahol2019-10-14
|
* avutil/opt: add AV_OPT_FLAG_RUNTIME_PARAM flagPaul B Mahol2019-10-14
|
* avutil/eval: add sgn()Paul B Mahol2019-10-12
|
* avutil/avstring: support input path as a null pointer or empty stringLimin Wang2019-10-08
| | | | | | | | | | | | | | | Linux and OSX systems support basename and dirname via <libgen.h>, I plan to make the wrapper interface conform to the standard interface first. If it is feasible, I will continue to modify it to call the system interface if there is already a system call interface. You can get more description about the system interface by below command: "man 3 basename" Reviewed-by: Marton Balint <cus@passwd.hu> Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avutil/common: Fix underflow for ROUNDED_DIV with unsigned integerMengye Lv2019-10-06
| | | | | | | | | | | | When used ROUNDED_DIV(a,b), if a is unsigned integer zero, it's will lead to an underflow issue(it called unsigned integer wrapping). Fixes #8062 Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Mengye Lv <mengyelv@tencent.com> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavu/qsv: remove redundant version queryZhong Li2019-09-27
| | | | Signed-off-by: Zhong Li <zhong.li@intel.com>
* avutil/opt: Fix type specifierAndreas Rheinhardt2019-09-22
| | | | | | | | This bug has been introduced in 9e0a071e. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/encryption_info: Don't pass NULL to memcpyAndreas Rheinhardt2019-09-20
| | | | | | | | | | | | | | | The pointer arguments to memcpy (and several other functions of the C standard library) are not allowed to be NULL, not even when the number of bytes to copy is zero. An AVEncryptionInitInfo's data pointer is explicitly allowed to be NULL and yet av_encryption_init_info_add_side_data unconditionally used it as a source pointer to copy from. This commit changes this so that copying is only done if the number of bytes to copy is > 0. Fixes ticket #8141 as well as a part of ticket #8150. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>