Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-11-24imgutils: Use designated initializers for AVClassTimothy Gu
More readable and less breakable.
2015-11-23avutil/x86/bswap: Remove warning about bswap intrinsics with msvc.Matt Oliver
Signed-off-by: Matt Oliver <protogonoi@gmail.com>
2015-11-23avutil/motion_vector: export subpel motion informationClément Bœsch
FATE test changes because of the switch from shift to division.
2015-11-22Merge commit '588b6215b4c74945994eb9636b0699028c069ed2'Derek Buitenhuis
* commit '588b6215b4c74945994eb9636b0699028c069ed2': rtmpcrypt: Do the xtea decryption in little endian mode xtea: Add functions for little endian mode Conflicts: libavutil/xtea.c Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-11-21avutil/eval: change sqrt to hypotGanesh Ajjanagadde
This improves the mathematical behavior of hypotenuse computation. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-11-21configure+libm.h: add hypot emulationGanesh Ajjanagadde
It is known that the naive sqrt(x*x + y*y) approach for computing the hypotenuse suffers from overflow and accuracy issues, see e.g http://www.johndcook.com/blog/2010/06/02/whats-so-hard-about-finding-a-hypotenuse/. This adds hypot support to FFmpeg, a C99 function. On platforms without hypot, this patch does a reaonable workaround, that although not as accurate as GNU libm, is readable and does not suffer from the overflow issue. Improvements can be made separately. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-11-21avutil/libm: correct isnan, isinf compat hacksGanesh Ajjanagadde
isnan and isinf are actually macros as per the standard. In particular, the existing implementation has incorrect signature. Furthermore, this results in undefined behavior for e.g double values outside float range as per the standard. This patch corrects the undefined behavior for all usage within FFmpeg. Note that long double is not handled as it is not used in FFmpeg. Furthermore, even if at some point long double gets used, it is likely not needed to modify the macro in practice for usage in FFmpeg. See below for analysis. Getting long double to work strictly per the spec is significantly harder since a long double may be an IEEE 128 bit quad (very rare), 80 bit extended precision value (on GCC/Clang), or simply double (on recent Microsoft). On the other hand, any potential future usage of long double is likely for precision (when a platform offers extra precision) and not for range, since the range anyway varies and is not as portable as IEEE 754 single/double precision. In such cases, the implicit cast to a double is well defined and isinf and isnan should work as intended. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-11-19Merge commit '1fc94724f1fd52944bb5ae571475c621da4b77a0'Derek Buitenhuis
* commit '1fc94724f1fd52944bb5ae571475c621da4b77a0': xtea: Clarify that the current API works in big endian mode Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-11-19avutil/mem: Add av_fast_mallocz()Michael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-15avutil: Move av_rint64_clip_* to internal.hMichael Niedermayer
The function is renamed to ff_rint64_clip() This should avoid build failures on VS2012 Feel free to changes this to a different solution Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-14avutil/common: add av_rint64_clipGanesh Ajjanagadde
The rationale for this function is reflected in the documentation for it, and is copied here: Clip a double value into the long long amin-amax range. This function is needed because conversion of floating point to integers when it does not fit in the integer's representation does not necessarily saturate correctly (usually converted to a cvttsd2si on x86) which saturates numbers > INT64_MAX to INT64_MIN. The standard marks such conversions as undefined behavior, allowing this sort of mathematically bogus conversions. This provides a safe alternative that is slower obviously but assures safety and better mathematical behavior. API: @param a value to clip @param amin minimum value of the clip range @param amax maximum value of the clip range @return clipped value Note that a priori if one can guarantee from the calling side that the double is in range, it is safe to simply do an explicit/implicit cast, and that will be far faster. However, otherwise this function should be used. avutil minor version is bumped. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-11-13xtea: Add functions for little endian modeMartin Storsjö
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-11-13xtea: Clarify that the current API works in big endian modeMartin Storsjö
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-11-12avutil/x86/intmath: Fix intrinsic header include when using newer gcc with ↵Matt Oliver
older icc. Signed-off-by: Matt Oliver <protogonoi@gmail.com>
2015-11-12avutil/x86/bswap: Add msvc bswap instrinsics.Matt Oliver
This adds msvc optimisations as well as fixing an error in icl whereby it will generate invalid code otherwise. Signed-off-by: Matt Oliver <protogonoi@gmail.com>
2015-11-11avutil/x86/intmath: Disable use of tzcnt on older intel compilers.Matt Oliver
ICC versions older than atleast 12.1.6 dont have the tzcnt intrinsics. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Matt Oliver <protogonoi@gmail.com>
2015-11-10avutil/softfloat: use abort() instead of av_assert0(0)James Almer
Fixes compilation of host tool aacps_fixed_tablegen. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
2015-11-09avutil/x86/intmath: Correct intrinsic headers for older compilers.Matt Oliver
Signed-off-by: Matt Oliver <protogonoi@gmail.com>
2015-11-08softfloat: handle INT_MIN correctly in av_int2sfAndreas Cadhalpun
Otherwise v=INT_MIN doesn't get normalized and thus triggers av_assert2 in other functions. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-08softfloat: assert when the argument of av_sqrt_sf is negativeAndreas Cadhalpun
The correct result can't be expressed in SoftFloat. Currently it returns a random value from an out of bounds read. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-08avutil/softfloat: Include negative numbers in cmp/gt testsMichael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08avutil/softfloat: Fix av_gt_sf() with large exponents try #2Michael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08avutil/softfloat: Add test for av_gt_sf()Michael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08avutil/softfloat: Extend the av_cmp_sf() test to cover a wider range of ↵Michael Niedermayer
exponents Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08avutil/softfloat: Fix overflows in shifts in av_cmp_sf() and av_gt_sf()Michael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08avutil/softfloat: Add test for av_cmp_sf()Michael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08avutil/softfloat: Add tests for exponent underflowsMichael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08avutil/softfloat: Fix exponent underflow in av_div_sf()Michael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08avutil/softfloat: Fix exponent underflow in av_mul_sf()Michael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08avutil/softfloat: Fix typo in av_mul_sf() doxyMichael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08Revert "avutil/softfloat: Check for MIN_EXP in av_sqrt_sf()"Michael Niedermayer
This case should not be possible if the input has a exponent within the valid range This reverts commit 0269fb11e3de17375f86d9120599af8c87cdfa0a.
2015-11-08avutil/softfloat: Check for MIN_EXP in av_sqrt_sf()Michael Niedermayer
Otherwise the exponent could eventually underflow Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08avutil/softfloat: Correctly set the exponent for 0.0 in av_sqrt_sf()Michael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08avutil/softfloat: FLOAT_0 should use MIN_EXPMichael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-07lavu/opt: enhance printing durations.Nicolas George
Trim unneeded leading components and trailing zeros. Move the formating code in a separate function. Use the function also to format the default value, it was currently printed as plain integer, inconsistent to the way it is parsed.
2015-11-05libavutil/channel_layout: Check strtol*() for failureMichael Niedermayer
Fixes assertion failure Fixes: 4f5814bb15d2dda6fc18ef9791b13816/signal_sigabrt_7ffff6ae7cc9_65_7209d160d168b76f311be6cd64a548eb.wv Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-04avutil/common: add FFDIFFSIGN macroGanesh Ajjanagadde
This is of use for defining comparator callbacks. Common approaches like return x-y are not safe due to the risks of overflow. Furthermore, the (x > y) - (x < y) trick is optimized to branchless code. This also documents this macro accordingly. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-11-02avutil/file_open: avoid file handle inheritance on WindowsTobias Rapp
Avoids inheritance of file handles on Windows systems similar to the O_CLOEXEC/FD_CLOEXEC flag on Linux. Fixes file lock issues in Windows applications when a child process is started with handle inheritance enabled (standard input/output redirection) while a FFmpeg transcoding is running in the parent process. Links relevant to the subject: https://msdn.microsoft.com/en-us/library/w7sa2b22.aspx Describes the _wsopen() function and the O_NOINHERIT flag. File handles opened by _wsopen() are inheritable by default. https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425%28v=vs.85%29.aspx Describes handle inheritance when creating new processes. Handle inheritance must be enabled (bInheritHandles = TRUE) e.g. when you want to pass handles for stdin/stdout via lpStartupInfo. Signed-off-by: Tobias Rapp <t.rapp@noa-audio.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-02avutil/eval: minor typoGanesh Ajjanagadde
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-31avutil/x86/intmath: Add missing header.Matt Oliver
Signed-off-by: Matt Oliver <protogonoi@gmail.com>
2015-10-31avutil/opencl_internal: add av_warn_unused_resultGanesh Ajjanagadde
clSetKernelArg can return an error due to lack of memory (for instance): https://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clSetKernelArg.html. Thus this error must be propagated. Currently should not trigger warnings, but adds robustness. Untested. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-31avutil/x86/intmath: Use tzcnt in place of bsf.Matt Oliver
Signed-off-by: Matt Oliver <protogonoi@gmail.com>
2015-10-31avutil/rational: use frexp rather than ad-hoc log to get floating point exponentGanesh Ajjanagadde
This simplifies and cleans up the code. Furthermore, it is much faster due to absence of the slow log computation. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-30avutil/wchar_filename: add av_warn_unused_resultGanesh Ajjanagadde
Current code is fine, this just adds robustness. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-30avutil/mathematics: correct documentation for av_gcdGanesh Ajjanagadde
av_gcd is now always defined regardless of input. This documents this change in the "documented API". Two benefits (closely related): 1. The function is robust, and there is no need to worry about INT64_MIN, etc. 2. Clients of av_gcd, like av_reduce, can now be made fully correct. Currently, av_reduce can trigger undefined behavior if e.g num is INT64_MIN due to integer overflow in the FFABS. Furthermore, this undefined behavior is completely undocumented, and could be a fuzzer's paradise. The FFABS was needed in the past as av_gcd was undefined for negative inputs. In order to make av_reduce robust, it is essential to guarantee that av_gcd works for all int64_t. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-30avutil/mathematics: make av_gcd more robustGanesh Ajjanagadde
This ensures that no undefined behavior is invoked, while retaining identical return values in all cases and at no loss of performance (identical asm on clang and gcc). Essentially, this patch exchanges undefined behavior with implementation defined behavior, a strict improvement. Rationale: 1. The ideal solution is to have the return type a uint64_t. This unfortunately requires an API change. 2. The only pathological behavior happens if both arguments are INT64_MIN, to the best of my knowledge. In such a case, the implementation defined behavior is invoked in the sense that UINT64_MAX is interpreted as INT64_MIN, which any reasonable implementation will do. In any case, any usage where both arguments are INT64_MIN is a fuzzer anyway. 3. Alternatives of checking, etc require branching and lose performance for no concrete gain - no client cares about av_gcd's actual value when both args are INT64_MIN. Even if it did, on sane platforms (e.g all the ones FFmpeg cares about), it produces a correct gcd, namely INT64_MIN. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-29avutil/audio_fifo: add av_warn_unused_resultGanesh Ajjanagadde
This one should not trigger any warnings, but will be useful for future robustness. Strictly speaking, one could check the size after the call by examining the structure instead of the return value. Such a use case is highly unusual, and this commit may be easily reverted if there is a legitimate need of such use. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-29avutil/ripemd: make rol macro more robust by adding parenthesesGanesh Ajjanagadde
This ensures that the macro remains correct in the sense of allowing expressions for value and bits, by placing the value and bits expressions within parentheses. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-28lavu/aes: test CBC functionalityRodger Combs
2015-10-28lavu/aes: align AVAES struct membersRodger Combs