Commit Graph

4506 Commits

Author SHA1 Message Date
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
Diego Biurrun
b83aea7340 des-test: Pass the proper types to av_des_*() functions
Fixes a number of incompatible pointer type warnings.
2017-01-24 13:25:53 +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
Anton Khirnov
52627248e4 frame: add a cropping rectangle to AVFrame
Extend the width/height doxy to clarify that it should store coded
values.
2017-01-12 16:22:44 +01: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
Diego Biurrun
00b6a76543 hmac: Explicitly convert types at function pointer assignment
Fixes a number of warnings of the type
libavutil/hmac.c:61:21: warning: assignment from incompatible pointer type
2017-01-09 15:18:16 +01:00
Diego Biurrun
e435beb1ea crypto: consistently use size_t as type for length parameters
size_t is the correct type to use for sizes.
2017-01-09 15:17:43 +01:00
Henrik Gramner
3cba1ad76d 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.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-01-09 13:21:12 +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
Thomas Turner
1bfb4587a2 avutil/tests/audio_fifo.c: Memory leak and tab space fixes
Prevents memory leak when read_samples_from_audio_fifo() is
called more than once by deallocating before reallocating
more memory.

Fixes space indentation for contents in ERROR().

Signed-off-by: Thomas Turner <thomastdt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-31 17:20:06 +01:00
Thomas Turner
11b7cad3dc avutil/tests/audio_fifo.c: use av_malloc() family of functions
Signed-off-by: Thomas Turner <thomastdt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-31 17:20:01 +01:00
Thomas Turner
d7a3c7427f avutil/tests/audio_fifo.c: Corrected test error messages
Signed-off-by: Thomas Turner <thomastdt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-28 16:04:59 +01:00
Michael Niedermayer
c4152fc42e avutil/random_seed: Reduce the time needed on systems with very low precission clock()
This should fix issues on BSD
CLOCKS_PER_SEC is 128 on BSD while SUSv2 requires it to be a million

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-24 14:46:25 +01:00
James Almer
94eb600f35 tests/audio_fifo: fix buffer allocation for non planar formats
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-23 21:47:03 -03:00
Michael Niedermayer
c193132ce5 avutil/tests/random_seed: eliminate goto
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-23 21:47:26 +01:00
Thomas Turner
8dcb28cf6d avutil/tests: Improved code coverage for random_seed
Signed-off-by: Thomas Turner <thomastdt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-23 02:57:20 +01:00
James Almer
0abcebe3d6 tests/avstring: free the pointer after calls to av_d2str()
Fixes memleaks.

Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-22 12:11:13 -03:00
Michael Niedermayer
da73d95bad avutil/random_seed: Improve get_generic_seed() with higher precission clock()
Tested-by: Thomas Turner <thomastdt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-22 12:40:48 +01:00
Diego Biurrun
92db508307 build: Generate pkg-config files from Make and not from configure
This moves work from the configure to the Make stage where it can
be parallelized and ensures that pkgconfig files are updated when
library versions change.

Bug-Id: 449
2016-12-22 12:30:54 +01:00
Michael Niedermayer
54931fd0fb avutil/random_seed: Use uint64 instead of uint8 for struct to avoid potential alignment issues
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-21 03:37:54 +01:00
Thomas Turner
9f76ad2a46 avutil: Added selftest for libavutil/audio_fifo.c
Signed-off-by: Thomas Turner <thomastdt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-21 03:37:54 +01:00
Thomas Turner
e303e3d4b9 avutil: Improved test coverage for avstring.c
Signed-off-by: Thomas Turner <thomastdt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-20 18:21:24 +01:00
Michael Niedermayer
d4c1cc2b87 avutil/imgutils: Clarify doxy for av_image_check_size2()
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-16 02:07:32 +01:00
Diego Biurrun
2d7aadf3d9 Add missing #includes for standalone spherical-information-related headers
(cherry picked from commit f912fd767e)
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-14 13:33:30 -03:00
Diego Biurrun
05a603a94e ppc: Merge types_altivec.h into util_altivec.h
There is no point in keeping the two separate.
2016-12-14 14:08:43 +01:00
Wan-Teh Chang
fed50c4304 avutil: fix data race in av_get_cpu_flags()
Make the one-time initialization in av_get_cpu_flags() thread-safe. The
static variable |cpu_flags| in libavutil/cpu.c is read and written using
normal load and store operations. These are considered as data races.
The fix is to use atomic load and store operations.

The fix can be verified by running the libavutil/tests/cpu_init.c test
program under ThreadSanitizer:
    ./configure --toolchain=clang-tsan
    make libavutil/tests/cpu_init
    libavutil/tests/cpu_init

There should be no warnings from ThreadSanitizer.

Co-author: Dmitry Vyukov of Google, who suggested the data race fix.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-13 00:07:20 +01:00
Michael Niedermayer
4cf3def805 avutil/tests/imgutils: Remove unused variable
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-13 00:06:53 +01:00
Andreas Cadhalpun
3ab8436ff6 opt: reject denominator zero as out of range
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-12-13 00:00:31 +01:00
Wan-Teh Chang
3703f13333 avutil/tests: run the cpu_init.c test conditionally on HAVE_THREADS
Suggested by Diego Biurrun and James Almer.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-10 18:47:10 -03:00
Wan-Teh Chang
8986885801 avutil/cpu_init: remove unnecessary arguments to the main() function
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-10 18:47:00 -03:00
Michael Niedermayer
f542b152aa avutil: Add av_image_check_size2()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-10 22:24:10 +01:00
Michael Niedermayer
1b39a30247 fate: add av_image_check_size() test
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-10 22:24:10 +01:00
Wan-Teh Chang
2170017a1c avutil: fix data race in av_get_cpu_flags()
Make the one-time initialization in av_get_cpu_flags() thread-safe. The
static variables |flags|, |cpuflags_mask|, and |checked| in
libavutil/cpu.c are read and written using normal load and store
operations. These are considered as data races. The fix is to use atomic
load and store operations.

Remove the |checked| variable because the invalid value of -1 for
|flags| can be used to indicate the same condition. Rename |flags| to
|cpu_flags| and move it to file scope.

The fix can be verified by running the libavutil/tests/cpu_init.c test
program under ThreadSanitizer:
    ./configure --toolchain=clang-tsan
    make libavutil/tests/cpu_init
    libavutil/tests/cpu_init

There should be no warnings from ThreadSanitizer.

Co-author: Dmitry Vyukov of Google, who suggested the data race fix.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
2016-12-08 15:53:58 -05:00
Diego Biurrun
f912fd767e Add missing #includes for standalone spherical-information-related headers 2016-12-08 20:12:23 +01:00
Vittorio Giovara
8f58ecc344 lavu: Add AVSphericalMapping type and frame side data
While no decoder currently exports spherical information, this type
represents a frame property that has to be passed through from container
to frames.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-12-07 14:39:04 -05:00
Vittorio Giovara
2fb6acd9c2 lavc: Add spherical packet side data API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-12-07 14:34:34 -05:00
Vittorio Giovara
c70add61d1 lavu: Add AVSphericalMapping type and frame side data
While no decoder currently exports spherical information, this type
represents a frame property that has to be passed through from container
to frames.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-12-07 14:32:17 -05:00
Vittorio Giovara
075acbb6ff lavu: Add a video section to Doxygen documentation
Fill it with AVStereo3D and AVDisplayMatrix documentation.
Apply the necessary changes to make verbatim code look good in doxygen.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-12-07 14:26:21 -05:00
Vittorio Giovara
706af9227b lavu: Document the color properties enumeration values origin 2016-12-02 11:36:46 -05:00
Timo Rothenpieler
52773a2c68 avutil/hwcontext_cuda: check for missing pixel format 2016-11-30 12:36:23 +01:00
Mark Thompson
d30719e62d hwcontext_vaapi: Don't abort on failing to allocate from a fixed-size pool 2016-11-26 18:03:05 +00:00
Andreas Cadhalpun
2d6f46d801 softfloat: decrease MIN_EXP to cover full float range
floats are not necessarily normalized, so a normalized softfloat needs
MIN_EXP lowered by 23 to cover that range.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-25 01:23:48 +01:00
Janne Grunau
6a1ea4ec93 arm: warn/error on movrelx usage problematic with PIC on ELF
The warning has false positives but our asm does not trigger it. For
new code false positives can only be avoided by changing the register
allocation.
2016-11-24 21:26:22 +01:00
Wan-Teh Chang
048b46b4e2 avutil/tests: add cpu_init to .gitignore and tests/fate
This is a follow-up to commit d84a21207e,
which added the libavutil/tests/cpu_init.c.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-24 21:10:37 +01:00
James Almer
d1de725bee cuda: check for cuda.h when enabled
Fixes make checkheaders on systems without the Cuda Toolkit, which
was broken after the dynlink changes.

Signed-off-by: James Almer <jamrial@gmail.com>
2016-11-24 13:50:43 -03:00
Wan-Teh Chang
d84a21207e avutil/tests: Add cpu_init.c to check whether the one-time initialization in av_get_cpu_flags() has data races.
Co-author: Dmitry Vyukov of Google

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-23 22:35:25 +01:00
Wan-Teh Chang
29fb49194b avutil/cpu: remove the |checked| static variable
Remove the |checked| variable because the invalid value of -1 for
|flags| can be used to indicate the same condition. Also rename |flags|
to |cpu_flags| because there are a local variable and a function
parameter named |flags| in the same file.

Co-author: Dmitry Vyukov of Google

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-23 22:35:25 +01:00
Michael Niedermayer
2f935baa7d avutil/opt: Add AV_OPT_TYPE_UINT64
Requested-by: wm4 ([FFmpeg-devel] [PATCH] avutil/opt: Support max > INT64_MAX in write_number() with AV_OPT_TYPE_INT64)
Requested-by: ronald ([FFmpeg-devel] [PATCH] avutil/opt: Support max > INT64_MAX in write_number() with AV_OPT_TYPE_INT64)
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-23 02:01:05 +01:00
Philip Langdale
8d6c358ea8 libavutil/hwcontext_cuda: Support P010 and P016 formats
CUVID is now capable of returning 10bit and 12bit decoded content
in P010/P016. Let's support transfering those formats.
2016-11-22 10:09:14 -08:00
Philip Langdale
237421f149 avutil: add P016 pixel format
P016 is the 16-bit variant of NV12 (planar luma, packed chroma), using
two bytes per component.

It may, and in fact is most likely to, be used in situations where
there are less than 16 bits of data. It is the responsibility of
the writer to zero out any unused LSBs.
2016-11-22 10:07:43 -08:00
Timo Rothenpieler
e6464a44ed avutil/hwcontext_cuda: use dynamically loaded CUDA 2016-11-22 10:34:27 +01:00
Diego Biurrun
81a3c42abe Drop some bogus Doxygen documentation. 2016-11-21 14:29:11 +01:00
Diego Biurrun
a1d9de304f Fix some mismatches between function parameter and doxygen parameter names. 2016-11-21 14:29:10 +01:00
Michael Niedermayer
748ce9d702 avutil/opt: Fix setting int64 to its maximum
Found-by: Andreas
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-20 22:39:52 +01:00
Anton Khirnov
e18ba2dfd2 hwcontext_dxva2: make sure the sw frame format is the right one during transfer 2016-11-18 10:31:53 +01:00
Anton Khirnov
5a1d605cea hwcontext_dxva2: split transfer_data() into upload/download functions
Just the presence of a hw frames context is not enough to detect whether
the transfer is an upload or a download, because hw frames mapped to
system memory will have a hw frames context attached.
2016-11-18 10:31:53 +01:00
Anton Khirnov
9d7026574b hwcontext_dxva2: fix handling of the mapping flags
D3DLOCK_READONLY properly corresponds to the absence of the write flag,
not to the presence of the read flag, while D3DLOCK_DISCARD is
equivalent to the overwrite flag.
2016-11-18 10:31:53 +01:00
Anton Khirnov
0d3176e32f hwcontext_dxva2: do not assume the destination format during mapping is always the right one
Handle the cases where it is unsupported or unset.
2016-11-18 10:31:53 +01:00
Michael Niedermayer
721c90f0f9 avutil/frame: fix indention after last commit
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-16 21:25:45 +01:00
Michael Niedermayer
2acee08a4a avutil/frame: Copy size=0 side data in ff_init_buffer_info()
Fixes null pointer dereference
Fixes: 189/FOO

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-16 21:25:45 +01:00
Martin Storsjö
7fe898dbb9 aarch64: Add an offset parameter to the movrel macro
With apple tools, the linker fails with errors like these, if the
offset is negative:

ld: in section __TEXT,__text reloc 8: symbol index out of range for architecture arm64

This is cherry-picked from libav commit
c44a8a3eab.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2016-11-15 15:10:03 -05:00
Martin Storsjö
86c5a23ee5 arm: Clear the gp register alias at the end of functions
We reset .Lpic_gp to zero at the start of each function, which means
that the logic within movrelx for clearing gp when necessary will
be missed.

This fixes using movrelx in different functions with a different
helper register.

This is cherry-picked from libav commit
824e8c2840.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2016-11-15 15:10:03 -05:00
Andreas Cadhalpun
0edd569466 softfloat: handle -INT_MAX correctly
This is similar to commit 9ac61e73d0.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-14 22:57:07 +01:00
Hendrik Leppkes
e122a725fb Merge commit 'd20c118975220a0256027d1c2410bade94b8534d'
* commit 'd20c118975220a0256027d1c2410bade94b8534d':
  hwcontext_qsv: add support for p010

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-11-14 15:18:49 +01:00
Hendrik Leppkes
3dfe97a841 Merge commit '2ef87815fec059504370ae3050cc243a53553915'
* commit '2ef87815fec059504370ae3050cc243a53553915':
  hwcontext_dxva2: add support for p010

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-11-14 15:15:19 +01:00
Carl Eugen Hoyos
3f1b5ca22e lavu/pixfmt: Add GRAY10
Based on 7471352f by Luca Barbato.
2016-11-14 10:16:41 +01:00
Hendrik Leppkes
3aa7b0a273 Merge commit 'f62bb216ac4cfbbff16108c6bac35a0282532972'
* commit 'f62bb216ac4cfbbff16108c6bac35a0282532972':
  hwcontext_vaapi: allow transfers to/from any size of sw frame

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-11-13 22:36:18 +01:00
Hendrik Leppkes
7071924cf2 Merge commit 'fdfe01365d579189d9a55b3741dba2ac46eb1df8'
* commit 'fdfe01365d579189d9a55b3741dba2ac46eb1df8':
  hwcontext: allocate the destination frame for the pool size

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-11-13 22:35:49 +01:00
Hendrik Leppkes
72c38dd66e Merge commit '5fcae3b3f93fd02b3d1e009b9d9b17410fca9498'
* commit '5fcae3b3f93fd02b3d1e009b9d9b17410fca9498':
  hwcontext: clarify the behaviour of transfer_data() for cropped frames

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-11-13 22:35:04 +01:00
Anton Khirnov
775a8477b7 hwcontext_vaapi: add a quirk for the missing MemoryType attribute
The Intel binary iHD driver does not support the
VASurfaceAttribMemoryType, so surface allocation will fail when using
it.

(cherry picked from commit 2124711b95)
2016-11-13 20:39:49 +00:00
Mark Thompson
8d47d84075 hwcontext_vaapi: Try the first render node as the default DRM device
If no string argument is supplied when av_hwdevice_ctx_create() is
called to create a VAAPI device, we currently only try the default
X11 display (that is, $DISPLAY) to find a device, and will therefore
fail in the absence of an X server to connect to.  Change the logic
to also look for a device via the first DRM render node (that is,
"/dev/dri/renderD128"), which is probably the right thing to use in
most simple configurations which only have one DRM device.

(cherry picked from commit 121f34d5f0)
2016-11-13 20:39:49 +00:00
Mark Thompson
a8d51bb424 hwcontext_vaapi: Add driver quirks to the hwdevice
The driver being used is detected inside av_hwdevice_ctx_init() and
the quirks field then set from a table of known device.  If this
behaviour is unwanted, the user can also set the quirks field
manually.

Also adds the Intel i965 driver quirk (it does not destroy parameter
buffers used in a call to vaRenderPicture()) and detects that driver
to set it.

(cherry picked from commit 4926fa9a4a)
2016-11-13 20:39:48 +00:00
Hendrik Leppkes
411ecb0be6 Merge commit '444a36269f853844369af0a9836507e5a2780323'
* commit '444a36269f853844369af0a9836507e5a2780323':
  pixdesc: Fix AVCOL_TRC_BT2020_12 name

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-11-13 18:38:16 +01:00
Hendrik Leppkes
2d7cf6f72b Merge commit 'f172e22d6aed0bff36e975bafb0183b6779f9444'
* commit 'f172e22d6aed0bff36e975bafb0183b6779f9444':
  pixdesc: Add aliases to SMPTE color properties

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-11-13 18:35:28 +01:00
Martin Storsjö
824e8c2840 arm: Clear the gp register alias at the end of functions
We reset .Lpic_gp to zero at the start of each function, which means
that the logic within movrelx for clearing gp when necessary will
be missed.

This fixes using movrelx in different functions with a different
helper register.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-11-10 14:01:04 +02:00
Martin Storsjö
c44a8a3eab aarch64: Add an offset parameter to the movrel macro
With apple tools, the linker fails with errors like these, if the
offset is negative:

ld: in section __TEXT,__text reloc 8: symbol index out of range for architecture arm64

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-11-10 11:06:08 +02:00
Luca Barbato
638b216d4f pixfmt: Add GRAY12
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-10 00:42:48 +01:00
Vittorio Giovara
17dac56b8f lavu: Rename ycgco color space appropriately
Planes are ordered as the name suggests now.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-11-08 11:22:29 -05:00
Luca Barbato
7471352f19 pixfmt: Add GRAY12 2016-11-07 22:42:00 +01:00
Anton Khirnov
e8bbacbf52 hwcontext_qsv: support frame mapping
Signed-off-by: Maxym Dmytrychenko <maxym.dmytrychenko@intel.com>
2016-11-07 12:47:40 +01:00
Anton Khirnov
8ea15afbf2 hwcontext_qsv: transfer data through the child context when VPP fails
Uploading/downloading data through VPP may not work for some formats, in
that case we can still try to call av_hwframe_transfer_data() on the
child context.

Signed-off-by: Maxym Dmytrychenko <maxym.dmytrychenko@intel.com>
2016-11-07 12:47:33 +01:00
Anton Khirnov
b91ce48600 hwcontext_qsv: do not fail when download/upload VPP session creation fails
Certain pixel formats (e.g. P8) might not be supported for
download/upload through VPP operations, but can still be used otherwise.

Signed-off-by: Maxym Dmytrychenko <maxym.dmytrychenko@intel.com>
2016-11-07 12:47:26 +01:00
Anton Khirnov
b115a35ea6 hwcontext_qsv: add support for the P8 format
When using GPU surfaces with QSV, one needs to supply a frame allocator,
which will be invoked to pass surface pools to libmfx.
For encoding, this allocator gets invoked not only for the pool of input
frames, but also for a separate pool of (apparently) reconstructed frames
and another pool of MFX_FOURCC_P8, which on Windows needs to return
D3DFMT_P8 D3D surfaces. Those are probably used to store the encoded
bitstream on the GPU.

Signed-off-by: Maxym Dmytrychenko <maxym.dmytrychenko@intel.com>
2016-11-07 12:47:20 +01:00
Anton Khirnov
10065d9324 hwcontext_dxva2: add support for the P8 format
This format is used internally by the QSV encoder to store the encoded
bitstream.

Signed-off-by: Maxym Dmytrychenko <maxym.dmytrychenko@intel.com>
2016-11-07 12:47:14 +01:00
Anton Khirnov
9109737654 hwcontext_dxva2: frame mapping support
Signed-off-by: Maxym Dmytrychenko <maxym.dmytrychenko@intel.com>
2016-11-07 12:46:59 +01:00
James Almer
9ea69f4808 avutil/softfloat_ieee754: make all functions inline
Removes "defined but not used" warnings

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-11-05 17:53:26 -03:00
Matt Oliver
85db1f97eb avutil/hwcontext_dxva.c: Use new safe dlopen code.
Signed-off-by: Matt Oliver <protogonoi@gmail.com>
2016-11-05 18:08:43 +11:00
Mark Thompson
8ad9f9d675 hwcontext_vaapi: Frame mapping support
Can map to any supported software format (using a GPU copy if it
doesn't actually match the surface format underneath).
2016-11-03 23:49:05 +00:00
Mark Thompson
d06aa24ba5 hwcontext: Hardware frame mapping
Adds the new av_hwframe_map() function, which allows mapping between
hardware frames and normal memory, along with internal support for
implementing it.

Also adds av_hwframe_ctx_create_derived(), for creating a hardware
frames context associated with one device using frames mapped from
another by some hardware-specific means.
2016-11-03 23:49:01 +00:00
Diego Biurrun
67351924fa Drop unreachable break and return statements 2016-11-03 20:17:12 +01:00
Diego Biurrun
99434f4df8 float_dsp: Have implementation match function pointer prototype
libavutil/x86/float_dsp_init.c(144) : warning C4028: formal parameter 1 different from declaration
libavutil/x86/float_dsp_init.c(144) : warning C4028: formal parameter 2 different from declaration
2016-11-03 17:43:55 +01:00
Diego Biurrun
0456e68439 audio_fifo: Drop write-only variable 2016-10-27 12:21:46 +02:00
Michael Niedermayer
1609935b6c Bump minor versions after 3.2 branchpoint to seperate release
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-26 20:52:42 +02:00
Michael Niedermayer
3f3025205f Bump minor versions for 3.2
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-26 20:52:42 +02:00
Michael Behrisch
c5ac86256b lavu: remove comma at final enumeration items to fix pedantic warnings 2016-10-26 19:36:09 +02:00
Michael Niedermayer
051517648b avutil/x86/emms: Document the emms_c() vs alloc/free relation.
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-23 13:02:37 +02:00
Zhou Xiaoyong
b9cd922660 avutil/mips: loongson add mmi utils header file
1.mmiutils.h defined MMI_ load/store macros for loongson2e/2f/3a
2.mmiutils.h defined some mmi assembly macors

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-23 03:23:09 +02:00
Michael Niedermayer
f5495c970c avutil/avassert: Add av_assertX_fpu()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-22 13:50:09 +02:00
Andreas Cadhalpun
c8a6eb58d7 doc: fix spelling errors
Thanks to Mathieu Malaterre <malat@debian.org> for reporting the
Que/Queue typo. (https://bugs.debian.org/839542)

Reviewed-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-10-21 23:58:47 +02:00
Vittorio Giovara
0d9b9bd37f lavu: Add JEDEC P22 color primaries 2016-10-21 11:46:21 -04:00
Diego Biurrun
7911186ed6 emms: Give apriv_emms_yasm() a more general name 2016-10-18 13:09:09 +02:00
Diego Biurrun
6be7944ee2 x86: Add missing colons after assembly labels
This fixes many warnings of the sort
warning: label alone on a line without a colon might be in error
2016-10-17 16:31:26 +02:00
Thomas Turner
09d39177dc avutil: Improved selftest coverage for libavutil/fifo.c
Tested functions: av_fifo_generic_peek(), av_fifo_grow()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-14 23:14:33 +02:00
Michael Niedermayer
d790e48830 avutil/audio_fifo: Use av_fifo_freep() and remove redundant if()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-14 17:08:51 +02:00
Kieran Kunhya
81f1f6c3f6 Add GBRAP12 pixel format support
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-10-12 21:33:34 +02:00
Michael Niedermayer
1e93aa69a6 Add GBRP12 pixel format support
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-10-12 17:39:30 +02:00
Michael Niedermayer
1bda0ee530 avutil/hwcontext_vdpau: Fix warning: "GET_CALLBACK" redefined
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-10 02:41:24 +02:00
Hendrik Leppkes
e8487d71be Merge commit 'fe498ef5144d3712b887f44a0c5e654add99ead7'
* commit 'fe498ef5144d3712b887f44a0c5e654add99ead7':
  hwcontext_vaapi: Return all formats for constraints without config

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-10-07 13:19:53 +02:00
Hendrik Leppkes
3f9137c57d Merge commit '32c8359093d1ff4f45ed19518b449b3ac3769d27'
* commit '32c8359093d1ff4f45ed19518b449b3ac3769d27':
  lavc: export the timestamps when decoding in AVFrame.pts

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-10-07 13:03:36 +02:00
Timothy Gu
54220ce731 pixfmt: Use enum assignment for aliases
This way, Doxygen is happier as aliases are now grouped together, and
it never handled #define's in an enum well in the first place.

Y400A already exists as an enum assignment.
2016-10-05 17:17:50 -07:00
Timothy Gu
bdcd586c0d pixdesc: Order function prototypes semantically 2016-10-05 17:17:50 -07:00
Shivraj Patil
c1cc13cd2a avutil/mips/generic_macros_msa: rename macro variable which causes segfault for mips r6
Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-05 23:44:03 +02:00
Timo Rothenpieler
a0d7ce1406 avutil/hwcontext_cuda: align allocated frames 2016-10-03 15:49:22 +02:00
Vittorio Giovara
310c55f179 pixfmt: Document alternative names for smpte 431 and 432 2016-10-02 15:42:03 -04:00
Mark Thompson
eaaaabf6c9 hwcontext_vaapi: Enable P010 support
This is required for 10-bit surfaces.
2016-10-02 20:23:18 +01:00
Anton Khirnov
5cc0057f49 lavu: remove the custom atomic API
It has been replaced by C11 stdatomic.h and is now unused.
2016-10-02 19:35:55 +02:00
Anton Khirnov
27079a426c buffer: convert to stdatomic 2016-10-02 18:58:04 +02:00
Anton Khirnov
2124711b95 hwcontext_vaapi: add a quirk for the missing MemoryType attribute
The Intel binary iHD driver does not support the
VASurfaceAttribMemoryType, so surface allocation will fail when using
it.
2016-10-02 11:41:45 +02:00
Timo Rothenpieler
97e7f03d35 avutil/hwcontext_cuda: use proper synchronization flag 2016-09-29 22:58:34 +02:00
James Almer
13dd5edb88 avutil/hwcontext: use CONFIG_QSV instead of CONFIG_LIBMFX for qsv
See "[FFmpeg-devel] [PATCH] hwcontext: add a QSV implementation"

Suggested-by: nablet developer <sdk@nablet.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-09-28 15:13:10 -03:00
James Almer
eba0414768 Merge commit '59e7361cc791e5103be1712dc59a2055f118d0da'
* commit '59e7361cc791e5103be1712dc59a2055f118d0da':
  hwcontext: add a QSV implementation

Conflicts:
    doc/APIchanges
    libavutil/version.h

Merged-by: James Almer <jamrial@gmail.com>
2016-09-28 13:30:27 -03:00
James Almer
6e76c9c450 Merge commit 'a8164323374e86ce5f93759230868c98356833a2'
* commit 'a8164323374e86ce5f93759230868c98356833a2':
  pixdesc: Add new SMPTE 431, 432, and 2085 color properties

Conflicts:
    libavcodec/options_table.h
    libavcodec/version.h
    libavutil/pixdesc.c
    libavutil/pixfmt.h
    libavutil/version.h

Merged-by: James Almer <jamrial@gmail.com>
2016-09-28 13:12:18 -03:00
Luca Barbato
0e8d1fc1f0 lavu: Bump version for the 12bit Planar YUV support 2016-09-27 18:48:30 +02:00