Commit Graph

4366 Commits

Author SHA1 Message Date
Clément Bœsch 9c2436e1e7 lavu: add AV_PIX_FMT_FLAG_BAYER 2017-03-20 08:02:30 +01:00
Clément Bœsch ea8efc9594 lavu/mathematics: split closing bracket out of ifdefery 2017-03-18 23:50:05 +01:00
Clément Bœsch 1e1513d01a lavu/mathematics: document so-called "cruft" 2017-03-18 23:50:03 +01:00
Clément Bœsch 53587ca482 Merge commit 'ec021d48445a414325ad59a73f9cde3212b173e4'
* commit 'ec021d48445a414325ad59a73f9cde3212b173e4':
  buffer: fix av_buffer_pool_init2() documentation

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-18 19:22:30 +01:00
Vittorio Giovara f20bcec4c2 spherical: Change types of bounding and pad to uint32_t
These values are defined to be 32bit in the specification,
so it makes more sense to store them as fixed width.

Based on a patch by Micahel Niedermayer <michael@niedermayer.cc>.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-03-17 13:12:25 -04:00
Carl Eugen Hoyos 1cd58e9154 lavu/spherical: Make AVSphericalMapping pointer parameter const.
Reflects the actual code and silences a gcc warning:
ffprobe.c:1797:42: warning: passing argument 1 of 'av_spherical_tile_bounds' discards 'const' qualifier from pointer target type
2017-03-16 22:18:12 +01:00
Clément Bœsch 5e4a572699 Merge commit '24a362569bff1d4161742fffaca80a4a4428be8a'
* commit '24a362569bff1d4161742fffaca80a4a4428be8a':
  buffer: fix av_buffer_realloc() when the data is offset wrt buffer start

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-16 21:42:45 +01:00
James Almer 30fe4b8d4c Merge commit 'f79d847400d218cfd0b95f10358fe6e65ec3c9c4'
* commit 'f79d847400d218cfd0b95f10358fe6e65ec3c9c4':
  intreadwrite: Use the __unaligned keyword on MSVC for ARM and x86_64

Merged-by: James Almer <jamrial@gmail.com>
2017-03-15 21:20:44 -03:00
James Almer 916dff9cb1 Merge commit '230b1c070baa3b6d4bd590426a365b843d60ff50'
* commit '230b1c070baa3b6d4bd590426a365b843d60ff50':
  intreadwrite: Add intermediate variables in the byteswise AV_W*() macros

Mostly a noop. Merged for cosmetic purposes.
See d83ff76ca0

Merged-by: James Almer <jamrial@gmail.com>
2017-03-15 21:17:37 -03:00
Martin Storsjö dda45c087b aarch64: Add parentheses around the offset parameter in movrel
This fixes building with clang for linux with PIC enabled.

This is cherrypicked from libav commit
8847eeaa14.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-03-11 13:14:50 +02:00
Michael Niedermayer 1d0bad421c avutil/tests/lfg: Remove debugging start/stop timer
Fixes code with qemu ARM

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-03-08 14:32:00 +01:00
Thomas Turner a50ccbd240 avutil/tests/lfg.c: added proper normality test
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>
2017-03-08 14:32:00 +01:00
James Almer dbc932e745 Revert "lavu/atomic: add support for the new memory model aware gcc built-ins"
This reverts commit faa9d29829.

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>
2017-03-08 00:48:37 -03:00
Vittorio Giovara 1b7ffddb3a spherical: Add tiled equirectangular type and projection-specific properties
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-03-07 11:19:37 -05:00
James Almer a43389547c avutil/md5: stop discarding the const qualifier for the src pointer
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>
2017-03-03 13:37:11 -03:00
James Almer e2b7ae4b19 avutil/md5: fix misaligned reads
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>
2017-03-03 13:36:49 -03:00
Michael Niedermayer 55196e5d10 Revert "avutil/frame: Disallow zero sized frame side data"
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 7e4f32f4e4.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-03-03 01:03:29 +01:00
Mark Thompson 2b8151c806 hwcontext_vaapi: Don't abort on failing to allocate from a fixed-size pool
Cherry-picked from Libav d30719e62d.

Signed-off-by: wm4 <nfxjfg@googlemail.com>
2017-03-02 11:20:47 +01:00
wm4 554bc4eea8 avcodec, avutil, avformat: remove AVOption requirement for some fields
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.
2017-03-02 10:32:12 +01:00
Micah Galizia 489c09ad4b add locale month names to av_small_strptime
Signed-off-by: Micah Galizia <micahgalizia@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-26 17:16:22 +01:00
Michael Niedermayer 7e4f32f4e4 avutil/frame: Disallow zero sized frame side data
There should be no case that needs this and its a potential for
creating corner cases

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-25 22:02:23 +01:00
Michael Niedermayer 5804201cba avutil/frame: Reimplement av_frame_new_side_data() without size=0 special case
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>
2017-02-25 22:02:23 +01:00
Michael Niedermayer 4614bf2caf Factorize CHECK/SUINT code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-21 00:40:20 +01:00
Michael Niedermayer e8d4eacc07 Factor CHECKED out of DEBUG so it can be set seperatly
Suggested-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-19 15:39:36 +01:00
James Darnley 5336887867 avcodec/h264: sse2, avx h luma mbaff deblock/loop filter
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)
2017-02-18 20:26:52 +01:00
James Darnley 7627df15d4 x86util: import MOVHL macro
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.
2017-02-18 20:26:51 +01:00
James Darnley 9d815b7424 avcodec/x86: deduplicate PASS8ROWS macro 2017-02-18 20:26:49 +01:00
wm4 50708f4aa4 hwcontext_dxva2: support D3D9Ex
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 c2f97f0508.
2017-02-13 08:01:20 +01:00
wm4 e3af49b14b AVFrame: add an opaque_ref field
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 04f3bd3496.
2017-02-13 08:01:20 +01:00
Mark Thompson 3420b34a8a Revert "avutil/hwcontext_vaapi: fix SEGV in vaTerminate when vaInitialize fails"
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 3606602f11.
2017-02-05 15:13:15 +00:00
Aman Gupta 3606602f11 avutil/hwcontext_vaapi: fix SEGV in vaTerminate when vaInitialize fails
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>
2017-02-02 23:47:55 +00:00
Clément Bœsch 55b2cfa921 Merge commit 'f637046d3134a331e4b5a7243ac3dfb92735b8a5'
* commit 'f637046d3134a331e4b5a7243ac3dfb92735b8a5':
  libavutil: Always use some GCC style attributes on clang

Merged-by: Clément Bœsch <cboesch@gopro.com>
2017-02-02 11:26:05 +01:00
Clément Bœsch a0860b0a38 Merge commit '6f9e34baea4f6f484392e4e67f606a0835d07b73'
* commit '6f9e34baea4f6f484392e4e67f606a0835d07b73':
  arm: Check for support for the .fpu directive

Merged-by: Clément Bœsch <cboesch@gopro.com>
2017-02-02 11:22:04 +01:00
James Almer 8d5df204d0 Merge commit '8e9cd81d291b1010c625b2766058aadf4affb537'
* commit '8e9cd81d291b1010c625b2766058aadf4affb537':
  x86: cpu: Detect Conroe CPUs and their slow shuffle unit

Merged-by: James Almer <jamrial@gmail.com>
2017-01-31 15:20:54 -03:00
James Almer 2eab48177d Merge commit '7d7355aa92bb36ca0765c49a569a999bcb96f332'
* commit '7d7355aa92bb36ca0765c49a569a999bcb96f332':
  x86: Add SSSE3_SLOW CPU flag and related convenience macros

Merged-by: James Almer <jamrial@gmail.com>
2017-01-31 15:17:19 -03:00
Marton Balint d25769555b avutil/frame: fix av_frame_copy for unknown layouts
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>
2017-01-31 00:29:49 +01:00
Paul B Mahol 13564fc24d avutil/eval: add atan2 function
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-01-30 11:04:31 +01:00
Marton Balint c4618f842a avutil/channel_layout: add av_get_extended_channel_layout
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>
2017-01-24 23:51:36 +01:00
Marton Balint 5049f05f27 avutil/channel_layout: fix remains of old syntax in docs and comments
Signed-off-by: Marton Balint <cus@passwd.hu>
2017-01-24 23:51:36 +01:00
wm4 c16fe1432d hwcontext_cuda: implement frames_get_constraints
Copied and modified from hwcontext_qsv.c.
2017-01-23 16:21:18 +01:00
Jonathan Campbell 76c5a69e26 libavutil: add av_lfg_init_from_data() function
seeds an AVLFG from binary data.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-01-22 02:28:53 +01:00
Mark Thompson f7e9275f83 hwcontext_vdpau: Fix missing subscripts
Also remove the redundant casts which were hiding the error here.

(cherry picked from commit 7081620aca)
2017-01-17 23:06:46 +00:00
Matthieu Bouron adf5dc90a9 avutil/tests: add aes_ctr, audio_fifo and imgutils to .gitignore 2017-01-17 10:08:05 +01:00
Thomas Turner 08fdf965c9 avutil/tests/audio_fifo.c: pass by reference for efficiency and change datatype to const
Signed-off-by: Thomas Turner <thomastdt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-01-13 00:17:10 +01:00
James Almer 1d4d0ee4b0 avutil/reverse: move the ff_reverse declaration to a separate header
Fixes compilation with hardcoded tables after eaff1aa09e
and e71b8119e7

Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-01-12 19:59:37 -03:00
Henrik Gramner cd09e3b349 x86inc: Avoid using eax/rax for storing the stack pointer
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.
2017-01-09 16:00:29 +01:00
Wang Bin 0e8b68a2c4 avutil/tile: check clock_gettime at runtime for apple platforms
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>
2017-01-09 11:52:06 +08:00
Thomas Turner 3126ca2825 avutil/tests: added selftest for aes_ctr.c
Signed-off-by: Thomas Turner <thomastdt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-01-02 02:45:43 +01:00
Thomas Turner b7a6d28e5e avutil/tests: improved code coverage for atomic
Signed-off-by: Thomas Turner <thomastdt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-01-01 16:57:55 +01:00
Michael Niedermayer 7525517593 libavutil/random_seed: Ensure that get_generic_seed() spends at least 1/32 sec gathering entropy
This may fix the failures on windows

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-31 17:20:06 +01:00