summaryrefslogtreecommitdiff
path: root/libavutil
Commit message (Collapse)AuthorAge
* Merge commit 'f79d847400d218cfd0b95f10358fe6e65ec3c9c4'James Almer2017-03-15
|\ | | | | | | | | | | | | * commit 'f79d847400d218cfd0b95f10358fe6e65ec3c9c4': intreadwrite: Use the __unaligned keyword on MSVC for ARM and x86_64 Merged-by: James Almer <jamrial@gmail.com>
| * intreadwrite: Use the __unaligned keyword on MSVC for ARM and x86_64Martin Storsjö2016-08-02
| | | | | | | | | | | | | | | | | | | | | | | | | | AV_WN64 is meant for unaligned data, but the existing av_alias* unions (without a definition for the av_alias attribute - we don't have one for MSVC) indicate to the compiler that they would have sufficient alignment for normal access, i.e. the compiler is free to assume 8 byte alignment. On ARM, this makes sure that AV_WN64 (or two consecutive AV_WN32) is done with two str instructions instead of one strd. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '230b1c070baa3b6d4bd590426a365b843d60ff50'James Almer2017-03-15
|\| | | | | | | | | | | | | | | | | | | * commit '230b1c070baa3b6d4bd590426a365b843d60ff50': intreadwrite: Add intermediate variables in the byteswise AV_W*() macros Mostly a noop. Merged for cosmetic purposes. See d83ff76ca0e1ec905ca2d5b27bd0973991eadbd9 Merged-by: James Almer <jamrial@gmail.com>
| * intreadwrite: Add intermediate variables in the byteswise AV_W*() macrosMartin Storsjö2016-08-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids issues with expanding the argument multiple times, and makes sure that it is of the right type for the following shifts. Even if the caller of a macro could be expected not to pass parameters that have side effects if expanded multiple times, these fallback codepaths are rarely, if ever, tested, so it is expected that such issues can arise. Thefore, for safety, make sure the fallback codepaths only expand the arguments once. Signed-off-by: Martin Storsjö <martin@martin.st>
| * libavutil: Use an intermediate variable in AV_COPY*UMartin Storsjö2016-07-31
| | | | | | | | | | | | | | | | | | | | | | If AV_RN and AV_WN are macros with multiple individual reads and writes, the previous version of the AV_COPYU macro would fail if the reads and writes overlap. This should not be any less efficient in any case, given a sensibly optimizing compiler. Signed-off-by: Martin Storsjö <martin@martin.st>
* | aarch64: Add parentheses around the offset parameter in movrelMartin Storsjö2017-03-11
| | | | | | | | | | | | | | | | | | This fixes building with clang for linux with PIC enabled. This is cherrypicked from libav commit 8847eeaa141898850381400000fb2b8a7adc7100. Signed-off-by: Martin Storsjö <martin@martin.st>
* | avutil/tests/lfg: Remove debugging start/stop timerMichael Niedermayer2017-03-08
| | | | | | | | | | | | Fixes code with qemu ARM Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/tests/lfg.c: added proper normality testThomas Turner2017-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Chen-Shapiro(CS) test was used to test normality for Lagged Fibonacci PRNG. Normality Hypothesis Test: The null hypothesis formally tests if the population the sample represents is normally-distributed. For CS, when the normality hypothesis is True, the distribution of QH will have a mean close to 1. Information on CS can be found here: http://www.stata-journal.com/sjpdf.html?articlenum=st0264 http://www.originlab.com/doc/Origin-Help/NormalityTest-Algorithm Signed-off-by: Thomas Turner <thomastdt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Revert "lavu/atomic: add support for the new memory model aware gcc built-ins"James Almer2017-03-08
| | | | | | | | | | | | | | | | | | | | | | This reverts commit faa9d2982969c999ab0e443a226eff116f7f8e4b. This change became superfluous when support for C11 atomics was introduced. Reverting it will make the removal of this implementation in an upcoming merge conflict free. Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | spherical: Add tiled equirectangular type and projection-specific propertiesVittorio Giovara2017-03-07
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avutil/md5: stop discarding the const qualifier for the src pointerJames Almer2017-03-03
| | | | | | | | | | | | | | The code modifying the buffer on big endian systems was removed. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | avutil/md5: fix misaligned readsJames Almer2017-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes ubsan happy and also considerably increases performance on big endian systems. Tested on an IBM POWER7 3.55 GHz Before: 2.24user 0.14system 0:02.39elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k 2.26user 0.11system 0:02.38elapsed 99%CPU (0avgtext+0avgdata 2688maxresident)k 2.23user 0.15system 0:02.38elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k 2.25user 0.12system 0:02.38elapsed 100%CPU (0avgtext+0avgdata 2624maxresident)k 2.20user 0.15system 0:02.36elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k After: 1.86user 0.13system 0:02.00elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k 1.89user 0.11system 0:02.01elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k 1.85user 0.14system 0:02.00elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k 1.84user 0.15system 0:01.99elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k 1.89user 0.13system 0:02.02elapsed 99%CPU (0avgtext+0avgdata 2688maxresident)k Tested-by: Nicolas George <george@nsup.org> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | Revert "avutil/frame: Disallow zero sized frame side data"Michael Niedermayer2017-03-03
| | | | | | | | | | | | | | | | | | Found a case where we use size==0, the other related commits remain needed, and should be sufficient to fix the original issue This reverts commit 7e4f32f4e4b93c95dcc872cb844c5548e69f352e. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | hwcontext_vaapi: Don't abort on failing to allocate from a fixed-size poolMark Thompson2017-03-02
| | | | | | | | | | | | Cherry-picked from Libav d30719e62de68975cbc7ffd318df03a183037563. Signed-off-by: wm4 <nfxjfg@googlemail.com>
* | avcodec, avutil, avformat: remove AVOption requirement for some fieldswm42017-03-02
| | | | | | | | | | | | | | | | | | | | Allow all struct fields to be accessed directly, as long as they're public. Before this change, many fields were "public", but could be accessed via AVOption only. This meant they were effectively not public, but were present for documentation purposes, which was incredibly confusing at best.
* | add locale month names to av_small_strptimeMicah Galizia2017-02-26
| | | | | | | | | | Signed-off-by: Micah Galizia <micahgalizia@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/frame: Disallow zero sized frame side dataMichael Niedermayer2017-02-25
| | | | | | | | | | | | | | There should be no case that needs this and its a potential for creating corner cases Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/frame: Reimplement av_frame_new_side_data() without size=0 special caseMichael Niedermayer2017-02-25
| | | | | | | | | | | | | | | | | | | | | | | | The size 0 special case causes side data to be created which is different and a special case if for any reasons size = 0 is passed Fixes: multiple runtime error: null pointer passed as argument 1, which is declared to never be null Fixes: 653/clusterfuzz-testcase-5773837415219200 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Factorize CHECK/SUINT codeMichael Niedermayer2017-02-21
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Factor CHECKED out of DEBUG so it can be set seperatlyMichael Niedermayer2017-02-19
| | | | | | | | | | Suggested-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/h264: sse2, avx h luma mbaff deblock/loop filterJames Darnley2017-02-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | x86-64 only Yorkfield: - sse2: ~2.17x (434 vs. 200 cycles) Nehalem: - sse2: ~2.94x (409 vs. 139 cycles) Skylake: - sse2: ~3.10x (370 vs. 119 cycles) - avx: ~3.29x (370 vs. 112 cycles)
* | x86util: import MOVHL macroJames Darnley2017-02-18
| | | | | | | | | | | | | | | | | | | | Originally committed to x264 in 1637239a by Henrik Gramner who has agreed to re-license it as LGPL. Original commit message follows. x86: Avoid some bypass delays and false dependencies A bypass delay of 1-3 clock cycles may occur on some CPUs when transitioning between int and float domains, so try to avoid that if possible.
* | avcodec/x86: deduplicate PASS8ROWS macroJames Darnley2017-02-18
| |
* | hwcontext_dxva2: support D3D9Exwm42017-02-13
| | | | | | | | | | | | | | | | | | | | D3D9Ex uses different driver paths. This helps with "headless" configurations when no user logs in. Plain D3D9 device creation will fail if no user is logged in, while it works with D3D9Ex. Signed-off-by: Anton Khirnov <anton@khirnov.net> Merges Libav commit c2f97f0508708.
* | AVFrame: add an opaque_ref fieldwm42017-02-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an extended version of the AVFrame.opaque field, which can be used to attach arbitrary user information to an AVFrame. The usefulness of the opaque field is rather limited, because it can store only up to 32 bits of information (or 64 bit on 64 bit systems). It's not possible to set this field to a memory allocation, because there is no way to deallocate it correctly. The opaque_ref field circumvents this by letting the user set an AVBuffer, which makes the user data refcounted. Signed-off-by: Anton Khirnov <anton@khirnov.net> Merges Libav commit 04f3bd349651.
* | Revert "avutil/hwcontext_vaapi: fix SEGV in vaTerminate when vaInitialize fails"Mark Thompson2017-02-05
| | | | | | | | | | | | | | | | | | | | | | The original code is correctly following the API - vaTerminate() must be called to free the resources of a VADisplay after it is created by any of the vaGetDisplay*() calls; it is not necessary to have successfully called vaInitialize() on it. The segfaults which prompted this change must therefore be bugs in libva or the driver it loads. This reverts commit 3606602f1137552ea54f2c259eb140c1e3c026d4.
* | avutil/hwcontext_vaapi: fix SEGV in vaTerminate when vaInitialize failsAman Gupta2017-02-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Program terminated with signal SIGSEGV, Segmentation fault. #0 0x0000000000aff8a4 in vaTerminate () #1 0x0000000000ae50ce in vaapi_device_free (ctx=<optimized out>) at libavutil/hwcontext_vaapi.c:882 #2 0x0000000000ae1f9e in hwdevice_ctx_free (opaque=<optimized out>, data=<optimized out>) at libavutil/hwcontext.c:66 #3 0x0000000000ad856f in buffer_replace (src=0x0, dst=0x7fffa26ef1b8) at libavutil/buffer.c:119 #4 av_buffer_unref (buf=buf@entry=0x7fffa26ef1f8) at libavutil/buffer.c:129 #5 0x0000000000ae299f in av_hwdevice_ctx_create (pdevice_ref=0x170ac50 <hw_device_ctx>, type=type@entry=AV_HWDEVICE_TYPE_VAAPI, device=<optimized out>, opts=opts@entry=0x0, flags=flags@entry=0) at libavutil/hwcontext.c:494 #6 0x0000000000400968 in vaapi_device_init (device=<optimized out>) at ffmpeg_vaapi.c:223 Signed-off-by: Mark Thompson <sw@jkqxz.net>
* | Merge commit 'f637046d3134a331e4b5a7243ac3dfb92735b8a5'Clément Bœsch2017-02-02
|\| | | | | | | | | | | | | * commit 'f637046d3134a331e4b5a7243ac3dfb92735b8a5': libavutil: Always use some GCC style attributes on clang Merged-by: Clément Bœsch <cboesch@gopro.com>
| * libavutil: Always use some GCC style attributes on clangMartin Storsjö2016-07-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang normally disguises as GCC (defining __GNUC__), and thus get all the normal GCC specific attributes. Clang can also work as a drop-in replacement for MSVC, and in these cases, it doesn't define __GNUC__, but defines _MSC_VER instead. Even in these setups, it still supports the GCC style attributes, thus use them, especially where there isn't any MSVC specific version, or where the MSVC specific version doesn't work on clang (for DECLARE_ASM_CONST). Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '6f9e34baea4f6f484392e4e67f606a0835d07b73'Clément Bœsch2017-02-02
|\| | | | | | | | | | | | | * commit '6f9e34baea4f6f484392e4e67f606a0835d07b73': arm: Check for support for the .fpu directive Merged-by: Clément Bœsch <cboesch@gopro.com>
| * arm: Check for support for the .fpu directiveMartin Storsjö2016-07-21
| | | | | | | | | | | | | | When targeting COFF (windows), clang doesn't support this directive (while binutils supports it for all targets). Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '8e9cd81d291b1010c625b2766058aadf4affb537'James Almer2017-01-31
|\| | | | | | | | | | | | | * commit '8e9cd81d291b1010c625b2766058aadf4affb537': x86: cpu: Detect Conroe CPUs and their slow shuffle unit Merged-by: James Almer <jamrial@gmail.com>
| * x86: cpu: Detect Conroe CPUs and their slow shuffle unitFiona Glaser2016-07-20
| |
* | Merge commit '7d7355aa92bb36ca0765c49a569a999bcb96f332'James Almer2017-01-31
|\| | | | | | | | | | | | | * commit '7d7355aa92bb36ca0765c49a569a999bcb96f332': x86: Add SSSE3_SLOW CPU flag and related convenience macros Merged-by: James Almer <jamrial@gmail.com>
| * x86: Add SSSE3_SLOW CPU flag and related convenience macrosDiego Biurrun2016-07-20
| |
| * x86util: Extend SPLATW for avx2James Almer2016-07-18
| | | | | | | | | | | | Integration to Libav by Josh de Kock <josh@itanimul.li>. Signed-off-by: Alexandra Hájková <alexandra@khirnov.net>
* | avutil/frame: fix av_frame_copy for unknown layoutsMarton Balint2017-01-31
| | | | | | | | | | | | | | | | | | I wonder how unknown layouts ever worked without this? Reviewed-by: Nicolas George <george@nsup.org> Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* | avutil/eval: add atan2 functionPaul B Mahol2017-01-30
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avutil/channel_layout: add av_get_extended_channel_layoutMarton Balint2017-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Return a channel layout and the number of channels based on the specified name. This function is similar to av_get_channel_layout(), but can also parse unknown channel layout specifications. Unknown channel layout specifications are a decimal number and a capital 'C' suffix, in order to not break compatibility with the lowercase 'c' suffix, which is used for a guessed channel layout with the specified number of channels. Signed-off-by: Marton Balint <cus@passwd.hu>
* | avutil/channel_layout: fix remains of old syntax in docs and commentsMarton Balint2017-01-24
| | | | | | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* | hwcontext_cuda: implement frames_get_constraintswm42017-01-23
| | | | | | | | Copied and modified from hwcontext_qsv.c.
* | libavutil: add av_lfg_init_from_data() functionJonathan Campbell2017-01-22
| | | | | | | | | | | | seeds an AVLFG from binary data. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | hwcontext_vdpau: Fix missing subscriptsMark Thompson2017-01-17
| | | | | | | | | | | | Also remove the redundant casts which were hiding the error here. (cherry picked from commit 7081620aca36e616ea96f71fd71d2703e3abae09)
* | avutil/tests: add aes_ctr, audio_fifo and imgutils to .gitignoreMatthieu Bouron2017-01-17
| |
* | avutil/tests/audio_fifo.c: pass by reference for efficiency and change ↵Thomas Turner2017-01-13
| | | | | | | | | | | | | | datatype to const Signed-off-by: Thomas Turner <thomastdt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/reverse: move the ff_reverse declaration to a separate headerJames Almer2017-01-12
| | | | | | | | | | | | | | | | Fixes compilation with hardcoded tables after eaff1aa09e90e2711207c9463db8bf8e8dec8178 and e71b8119e7db675dd2dac3f7fb069b0df2943c38 Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org> Signed-off-by: James Almer <jamrial@gmail.com>
* | x86inc: Avoid using eax/rax for storing the stack pointerHenrik Gramner2017-01-09
| | | | | | | | | | | | | | | | | | When allocating stack space with an alignment requirement that is larger than the current stack alignment we need to store a copy of the original stack pointer in order to be able to restore it later. If we chose to use another register for this purpose we should not pick eax/rax since it can be overwritten as a return value.
* | avutil/tile: check clock_gettime at runtime for apple platformsWang Bin2017-01-09
| | | | | | | | | | | | | | | | | | | | | | clock_gettime is avalible since macOS 10.12 and iOS 10.0. Because of weak linking, clock_gettime can be build without error with new macOS/iOS sdk, but the symbol may not exist on the target system. Explicitly checking the symbol is required. https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html Signed-off-by: Wang Bin <wbsecg1@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* | avutil/tests: added selftest for aes_ctr.cThomas Turner2017-01-02
| | | | | | | | | | Signed-off-by: Thomas Turner <thomastdt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/tests: improved code coverage for atomicThomas Turner2017-01-01
| | | | | | | | | | Signed-off-by: Thomas Turner <thomastdt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>