Commit Graph

4405 Commits

Author SHA1 Message Date
Clément Bœsch 2a69724fd5 Merge commit '0456e684394dc5a7b98ab9ebb48396d743bf3730'
* commit '0456e684394dc5a7b98ab9ebb48396d743bf3730':
  audio_fifo: Drop write-only variable

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-24 13:17:55 +01:00
Clément Bœsch 0b3decc596 Merge commit '0d9b9bd37f43ee29ad9f709d85c8f3be9db71104'
* commit '0d9b9bd37f43ee29ad9f709d85c8f3be9db71104':
  lavu: Add JEDEC P22 color primaries

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-24 11:21:46 +01:00
Clément Bœsch a44ab512e6 lavu/pixfmt: fix redundant comment
Mistake introduced in a1f6b1d9d8.
2017-03-24 11:17:51 +01:00
James Almer c97e986e90 Merge commit '7911186ed616ae81dd8617d6d0e8b08c818db9d8'
* commit '7911186ed616ae81dd8617d6d0e8b08c818db9d8':
  emms: Give apriv_emms_yasm() a more general name

Merged-by: James Almer <jamrial@gmail.com>
2017-03-23 18:28:56 -03:00
James Almer 29db87af52 Merge commit '6be7944ee2ec2f045e6eb9a93237e992c8b20ac4'
* commit '6be7944ee2ec2f045e6eb9a93237e992c8b20ac4':
  x86: Add missing colons after assembly labels

Merged-by: James Almer <jamrial@gmail.com>
2017-03-23 18:05:27 -03:00
Clément Bœsch a1f6b1d9d8 Merge commit '310c55f1799deab395319471a75c528d0fa7b30d'
* commit '310c55f1799deab395319471a75c528d0fa7b30d':
  pixfmt: Document alternative names for smpte 431 and 432

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-23 11:22:32 +01:00
Clément Bœsch 443e969293 Merge commit '27079a426c9d3db918b158976e44b9b143d78e1c'
* commit '27079a426c9d3db918b158976e44b9b143d78e1c':
  buffer: convert to stdatomic

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-22 17:46:01 +01:00
Clément Bœsch 67d8eabdbb lavu/buffer: drop USE_ATOMICS
USE_ATOMICS is only set if there is no thread implementation enabled, in
which case you can't expect any lock mechanism from FFmpeg.

This is also conflicting with the incoming use of stdatomic.
2017-03-22 17:40:03 +01:00
Jun Zhao 9365dfcbf6 hwcontext: fix comments for av_hwdevice_ctx_alloc()
fix the wrong comments for av_hwdevice_ctx_alloc()

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2017-03-22 00:58:42 +00:00
James Almer d8962ffbd8 avutil/x86util: don't use movss in VBROADCASTSS macro when src and dst args are the same
Reviewed-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-03-21 19:15:00 -03:00
Clément Bœsch 3898e346b3 Merge commit '07e1f99a1bb41d1a615676140eefc85cf69fa793'
* commit '07e1f99a1bb41d1a615676140eefc85cf69fa793':
  x86util: Document SBUTTERFLY macro

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-20 18:38:07 +01:00
Clément Bœsch 2feef75cb5 Merge commit '09a145b3c837273b1379321e44386a3233156e75'
* commit '09a145b3c837273b1379321e44386a3233156e75':
  hwcontext_vdpau: Remove duplicate definition of GET_CALLBACK

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-20 16:05:51 +01:00
Clément Bœsch 3835283293 Merge commit '4fb311c804098d78e5ce5f527f9a9c37536d3a08'
* commit '4fb311c804098d78e5ce5f527f9a9c37536d3a08':
  Drop memalign hack

Merged, as this may indeed be uneeded since
46e3936fb0.

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-20 08:54:44 +01:00
Clément Bœsch a5cf6628d6 Merge commit 'f01f7a7846529b7c3ef343f117eaa2c0a1457af0'
* commit 'f01f7a7846529b7c3ef343f117eaa2c0a1457af0':
  hwcontext_dxva2: use the special UC copy for downloading frames

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-20 08:37:40 +01:00
Clément Bœsch 8200b16a9c Merge commit 'd7bc52bf456deba0f32d9fe5c288ec441f1ebef5'
* commit 'd7bc52bf456deba0f32d9fe5c288ec441f1ebef5':
  imgutils: add a function for copying image data from GPU mapped memory

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-20 08:34:10 +01:00
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