Commit Graph

591 Commits

Author SHA1 Message Date
wm4 463b81de2b imgutils: add function to clear an image to black
Black isn't always just memset(ptr, 0, size). Limited YUV in particular
requires relatively non-obvious values, and filling a frame with
repeating 0 bytes is disallowed in some contexts. With component sizes
larger than 8 or packed YUV, this can become relatively complicated. So
having a generic function for this seems helpful.

In order to handle the complex cases in a generic way without destroying
performance, this code attempts to compute a black pixel, and then uses
that value to clear the image data quickly by using a function like
memset.

Common cases like yuv410p10 or rgba can't be handled with a simple
memset, so there is some code to fill memory with 2/4/8 byte patterns.
For the remaining cases, a generic slow fallback is used.

Signed-off-by: Anton Khirnov <anton@khirnov.net>

Merged from Libav commit 45df7adc1d.
2017-08-08 13:37:37 +02:00
wm4 caa12027ba lavc, lavu: move frame cropping to a convenience function
Signed-off-by: Anton Khirnov <anton@khirnov.net>

Merged from Libav commit 47399ccdfd.
2017-08-08 13:35:09 +02:00
Paul B Mahol ab6d89d7ee libavutil: add GRAY9 pixel format 2017-08-07 13:06:51 +02:00
Yogender Gupta 3407d8118c hwcontext_cuda : Support YUV444P16 format
Signed-off-by: Philip Langdale <philipl@overt.org>
2017-08-03 15:25:35 -07:00
wm4 45df7adc1d imgutils: add function to clear an image to black
Black isn't always just memset(ptr, 0, size). Limited YUV in particular
requires relatively non-obvious values, and filling a frame with
repeating 0 bytes is disallowed in some contexts. With component sizes
larger than 8 or packed YUV, this can become relatively complicated. So
having a generic function for this seems helpful.

In order to handle the complex cases in a generic way without destroying
performance, this code attempts to compute a black pixel, and then uses
that value to clear the image data quickly by using a function like
memset.

Common cases like yuv410p10 or rgba can't be handled with a simple
memset, so there is some code to fill memory with 2/4/8 byte patterns.
For the remaining cases, a generic slow fallback is used.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-07-26 23:21:26 +02:00
wm4 47399ccdfd lavc, lavu: move frame cropping to a convenience function
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-07-26 23:20:40 +02:00
Rostislav Pehlivanov 24de4fddca lavu/frame: add new side data type for ICC profiles
Many image formats support embedding of ICC profiles directly in
their bitstreams. Add a new side data type to allow exposing them to
API users.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-07-25 20:11:06 +01:00
Muhammad Faiz a3d3cfa65c avutil: merge slice threading implementation from avcodec and avfilter
Rework it to improve performance. Now mutex is not shared by workers,
instead each worker has its own mutex and condition variable. This
reduces lock contention between workers. Also use atomic variable for
counter.

The interface also allows execute to run special function on main
thread, requested by Ronald.

Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2017-07-19 15:50:07 +07:00
wm4 3303511f33 lavu: add new D3D11 pixfmt and hwcontext
To be used with the new d3d11 hwaccel decode API.

With the new hwaccel API, we don't want surfaces to depend on the
decoder (other than the required dimension and format). The old D3D11VA
pixfmt uses ID3D11VideoDecoderOutputView pointers, which include the
decoder configuration, and thus is incompatible with the new hwaccel
API. This patch introduces AV_PIX_FMT_D3D11, which uses ID3D11Texture2D
and an index. It's simpler and compatible with the new hwaccel API.

The introduced hwcontext supports only the new pixfmt.

Frame upload code untested.

Significantly based on work by Steve Lhomme <robux4@gmail.com>, but with
heavy changes/rewrites.

Merges Libav commit fff90422d1.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-06-27 18:05:02 +02:00
Mark Thompson d59c6a3aeb hwcontext: Improve allocation in derived contexts
Use the flags argument of av_hwframe_ctx_create_derived() to pass the
mapping flags which will be used on allocation.  Also, set the format
and hardware context on the allocated frame automatically - the user
should not be required to do this themselves.

(cherry picked from commit c5714b51aa)
2017-06-14 22:27:32 +01:00
Mark Thompson 0b1794a43e hwcontext: Make it easier to work with device types
Adds functions to convert to/from strings and a function to iterate
over all supported device types.  Also adds a new invalid type
AV_HWDEVICE_TYPE_NONE, which acts as a sentinel value.

(cherry picked from commit b7487f4f3c)
2017-06-14 22:26:29 +01:00
Mark Thompson b22172f6f3 hwcontext: Add device derivation
Creates a new device context from another of a different type which
refers to the same underlying hardware.

(cherry picked from commit b266ad56fe)
2017-06-14 22:25:57 +01:00
wm4 fff90422d1 lavu: add new D3D11 pixfmt and hwcontext
To be used with the new d3d11 hwaccel decode API.

With the new hwaccel API, we don't want surfaces to depend on the
decoder (other than the required dimension and format). The old D3D11VA
pixfmt uses ID3D11VideoDecoderOutputView pointers, which include the
decoder configuration, and thus is incompatible with the new hwaccel
API. This patch introduces AV_PIX_FMT_D3D11, which uses ID3D11Texture2D
and an index. It's simpler and compatible with the new hwaccel API.

The introduced hwcontext supports only the new pixfmt.

Frame upload code untested.

Significantly based on work by Steve Lhomme <robux4@gmail.com>, but with
heavy changes/rewrites.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-06-08 20:55:36 +02:00
wm4 532b23f079 videotoolbox: add hwcontext support
This adds tons of code for no other benefit than making VideoToolbox
support conform with the new hwaccel API (using hw_device_ctx and
hw_frames_ctx).

Since VideoToolbox decoding does not actually require the user to
allocate frames, the new code does mostly nothing.

One benefit is that ffmpeg_videotoolbox.c can be dropped once generic
hwaccel support for ffmpeg.c is merged from Libav.

Does not consider VDA or VideoToolbox encoding.

Fun fact: the frame transfer functions are copied from vaapi, as the
mapping makes copying generic boilerplate. Mapping itself is not
exported by the VT code, because I don't know how to test.
2017-05-15 11:30:36 +02:00
James Almer a47bd5d77e Merge commit '52627248e49e58eb4b78e4fcda90a64f4c476ea3'
* commit '52627248e49e58eb4b78e4fcda90a64f4c476ea3':
  frame: add a cropping rectangle to AVFrame

Merged-by: James Almer <jamrial@gmail.com>
2017-05-08 13:08:02 -03:00
Clément Bœsch 651ee93461 Merge commit 'e435beb1ea5380a90774dbf51fdc8c941e486551'
* commit 'e435beb1ea5380a90774dbf51fdc8c941e486551':
  crypto: consistently use size_t as type for length parameters

Merged-by: Clément Bœsch <cboesch@gopro.com>
2017-05-05 13:04:38 +02:00
Mark Thompson c5714b51aa hwcontext: Improve allocation in derived contexts
Use the flags argument of av_hwframe_ctx_create_derived() to pass the
mapping flags which will be used on allocation.  Also, set the format
and hardware context on the allocated frame automatically - the user
should not be required to do this themselves.
2017-04-30 17:33:18 +01:00
James Almer ad52eef997 spherical: add functions to retrieve and request projection names
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-04-27 09:59:54 -04:00
Steven Liu 8378466507 doc/APIChages: Add av_strireplace()
Add av_strireplace() into APIChanges

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-04-11 12:46:28 +08:00
Paul B Mahol 4dc2dd80dc avutil/float_dsp: add vector_dmac_scalar()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-10 12:04:14 +02:00
Steve Lhomme b378f5bd64 lavu: add support for Content Light Level side metadata
As found in HEVC.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-06 11:26:25 -03:00
Michael Niedermayer 22b0daa1b3 Bump versions for master after 3.3
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-02 19:54:12 +02:00
Michael Niedermayer e1cc7f83df Bump minor for 3.3
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-02 19:49:45 +02:00
James Almer 9033e8723c avutil/spherical: add av_spherical_projection_name()
Reviewed-by: Benoit Fouet <benoit.fouet@free.fr>
Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-03-31 13:26:56 -03:00
Michael Niedermayer 58b867a7cf Bump minor versions for master after release/3.3 branchpoint
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-03-31 13:21:06 +02:00
Michael Niedermayer fc332f3e29 Bump minor versions for staring release/3.3 branch
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-03-31 13:21:06 +02:00
Clément Bœsch 82ad9cbd32 Merge commit '17dac56b8fdd80c594c39b76de3f27a7949afbde'
* commit '17dac56b8fdd80c594c39b76de3f27a7949afbde':
  lavu: Rename ycgco color space appropriately

Merged-by: Clément Bœsch <cboesch@gopro.com>
2017-03-31 09:46:51 +02:00
Clément Bœsch 4cda23f1f1 Merge commit 'd06aa24ba583ad08025da9e1b29afcd8218ff9b0'
* commit 'd06aa24ba583ad08025da9e1b29afcd8218ff9b0':
  hwcontext: Hardware frame mapping

Merged-by: Clément Bœsch <cboesch@gopro.com>
2017-03-30 10:36:37 +02:00
Clément Bœsch bfdcdd6d82 lavu: add av_fourcc_make_string() and av_fourcc2str() 2017-03-29 14:49:29 +02: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
Vittorio Giovara 35cf146a33 lavu: Drop deprecated av_dlog macro
Deprecated in 05/2015.
2017-03-23 10:09:17 +01:00
Vittorio Giovara 619a433eca lavu: Drop deprecated option type
Deprecated in 02/2014.
2017-03-23 10:09:17 +01:00
Vittorio Giovara dd343fd986 lavu: Drop deprecated VDPAU pixel formats
Deprecated in 07/2013.
2017-03-23 10:09:17 +01:00
Vittorio Giovara 0648dec19d lavc: Drop deprecated stream codec tag
Deprecated in 07/2015.
2017-03-23 10:09:17 +01:00
Diego Biurrun dcc39ee10e lavc: Remove deprecated XvMC support hacks
Deprecated in 11/2013.
2017-03-23 10:09:14 +01:00
Vittorio Giovara 07a2b15594 Bump major versions of all libraries
This disables everything that was deprecated at least 18 months ago.

Readjust the minimum API version as needed, postponing any
API-incompatible changes until the next bump.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-03-23 09:56:20 +01:00
Mark Thompson b7487f4f3c hwcontext: Make it easier to work with device types
Adds functions to convert to/from strings and a function to iterate
over all supported device types.  Also adds a new invalid type
AV_HWDEVICE_TYPE_NONE, which acts as a sentinel value.
2017-03-20 23:15:43 +00:00
Mark Thompson b266ad56fe hwcontext: Add device derivation
Creates a new device context from another of a different type which
refers to the same underlying hardware.
2017-03-20 23:15:43 +00: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
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
Vittorio Giovara 6bce6aa17d spherical: Add tiled equirectangular type and projection-specific properties
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-03-07 11:07:02 -05: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
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
Anton Khirnov 4de220d2e3 frame: allow align=0 (meaning automatic) for av_frame_get_buffer()
This will avoid every caller from hardcoding some specific alignment,
which may break in the future with new instruction sets.
2017-02-11 11:37:45 +01:00
Anton Khirnov e6bff23f1e cpu: add a function for querying maximum required data alignment 2017-02-11 11:37:45 +01:00
wm4 04f3bd3496 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>
2017-02-11 11:37:45 +01: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 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
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
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
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
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
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
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
Carl Eugen Hoyos 3f1b5ca22e lavu/pixfmt: Add GRAY10
Based on 7471352f by Luca Barbato.
2016-11-14 10:16:41 +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 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 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
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
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
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 Niedermayer f5495c970c avutil/avassert: Add av_assertX_fpu()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-22 13:50:09 +02:00
Vittorio Giovara 0d9b9bd37f lavu: Add JEDEC P22 color primaries 2016-10-21 11:46:21 -04: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
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
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
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
Sasi Inguva 3cb400c11a avutil/frame: Add a flag to discard frame after decode.
Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-19 19:51:13 +02:00
Anton Khirnov d7bc52bf45 imgutils: add a function for copying image data from GPU mapped memory
See https://software.intel.com/en-us/articles/copying-accelerated-video-decode-frame-buffers
2016-08-31 08:15:47 +02:00
Michael Niedermayer ac028794ad avutil/version: Improve lib versioning scheme for release branches with the next major release
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-29 22:32:08 +02:00
Michael Niedermayer adbf1c9054 avutil/version: Mention similarities and differences to semver
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-29 22:27:52 +02:00
Paul B Mahol 9876d8fc6d swresample: add int64 sample format 2016-08-18 15:30:05 +02:00
Timothy Gu 58c7bf789f doxygen: Standardize root-level modules 2016-08-02 22:15:25 -07:00
Diego Biurrun 7d7355aa92 x86: Add SSSE3_SLOW CPU flag and related convenience macros 2016-07-20 18:43:28 +02:00
Mark Thompson 4926fa9a4a 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.
2016-07-02 14:09:54 +01:00
Hendrik Leppkes b7c5f88523 pixfmt: add P010 pixel format
P010 is the 10-bit variant of NV12 (planar luma, packed chroma), using two
bytes per component to store 10-bit data plus 6-bit zeroes in the LSBs.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-07-02 09:35:23 +02:00
Michael Niedermayer 042fb69deb avutil/frame: Move new field to the end of AVFrame
This fixes part of Ticket5676
This fixes kodi, mpv, chromium and ffplay build against 3.0 and linked to 3.1

This is a similar ABI fix to 1eb43af1a0

Approved-by: BBB
Approved-by: jamrial
Approved-by: BtbN
Approved-by: nevcairiel
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-30 17:43:01 +02:00
Vittorio Giovara f172e22d6a pixdesc: Add aliases to SMPTE color properties
Drop ST from names and symbols, it does not add anything distinctive or
descriptive.
2016-06-27 12:27:13 -04:00
Hendrik Leppkes 481f320aa3 Merge commit '1c9e8616c535ef496e7ee8a5cbc5e9e972a6977d'
* commit '1c9e8616c535ef496e7ee8a5cbc5e9e972a6977d':
  hwcontext: add a function for opening devices

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-06-26 15:23:24 +02:00
Clément Bœsch abb3cc46d5 Merge commit '0c4468dc185fa8b9e7d6add914595c5e928b24fd'
* commit '0c4468dc185fa8b9e7d6add914595c5e928b24fd':
  stereo3d: Add API to get name from value or value from name

Merged-by: Clément Bœsch <clement@stupeflix.com>
2016-06-23 12:38:51 +02:00
Hendrik Leppkes 3689efea3d Merge commit 'c46db38cde8e8fd8ecb1c6602f10ec0e002f29a8'
* commit 'c46db38cde8e8fd8ecb1c6602f10ec0e002f29a8':
  hwcontext: add a dxva2 implementation

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-06-22 22:38:49 +02:00
Anton Khirnov 32c8359093 lavc: export the timestamps when decoding in AVFrame.pts
Currently it's exported as AVFrame.pkt_pts, which is also the only use
for that field. The reason it is done like this is that lavc used to
export various codec-specific "timing" information in AVFrame.pts, which
is not done anymore.

Since it is confusing to the callers to have a separate field which is
used only for decoder timestamps and nothing else, deprecate pkt_pts and
use just AVFrame.pts everywhere.
2016-06-21 19:54:42 +02:00
Anton Khirnov 59e7361cc7 hwcontext: add a QSV implementation 2016-06-21 19:53:37 +02:00
Vittorio Giovara a816432337 pixdesc: Add new SMPTE 431, 432, and 2085 color properties
Appeared in H.264 2016/02.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-06-21 09:29:04 -04:00
Neil Birkbeck 5d560d38de pixfmt: Add ARIB STD-B76 color transfer characteristic
Adding hybrid log-gamma (https://en.wikipedia.org/wiki/Hybrid_Log-Gamma)
based on the standardization in ARIB STD-B67:
http://www.arib.or.jp/english/html/overview/doc/2-STD-B67v1_0.pdf

The choice of enum value of 18 is consistent with HEVC:
http://phenix.it-sudparis.eu/jct/doc_end_user/current_document.php?id=10481

And also with latest proposal for color format in mkv:
https://mailarchive.ietf.org/arch/search/?email_list=cellar&gbt=1&q=Colour+Format+proposal

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-06-21 09:02:46 -04:00
Anton Khirnov 1c9e8616c5 hwcontext: add a function for opening devices 2016-05-26 15:40:32 +02:00
Vittorio Giovara 0c4468dc18 stereo3d: Add API to get name from value or value from name
Use it in av_dump_format() instead of a huge switch case.
2016-05-17 12:25:27 -04:00
Anton Khirnov c46db38cde hwcontext: add a dxva2 implementation 2016-05-17 09:11:25 +02:00
Muhammad Faiz 83065939cb avutil/parsing: add '\r' as whitespace
for compatibility with platforms that treat it
as newline

Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2016-05-06 07:35:45 +07:00
Andreas Weis fb9187129c avutil/log: added av_log_format_line2 which returns buffer length
The new function behaves the same as av_log_format_line, but also forwards
the return value from the underlying snprintf call. This will allow
callers to accurately determine the size requirements for the line buffer.

Signed-off-by: Andreas Weis <github@ghulbus-inc.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-27 19:23:05 +02:00
Derek Buitenhuis e344646c80 Merge commit '564b4591bbe223bdc5f36a1131eaef103f23f5d0'
* commit '564b4591bbe223bdc5f36a1131eaef103f23f5d0':
  opt: Add av_opt_copy()

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-19 19:19:53 +01:00
Derek Buitenhuis 28abb216cb Merge commit '551c6775abb5e0ad34c26d7e23bc6fbbe8ccc9d4'
* commit '551c6775abb5e0ad34c26d7e23bc6fbbe8ccc9d4':
  lavu: VAAPI hwcontext implementation

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-14 13:49:55 +01:00
Derek Buitenhuis afccfaf26a Merge commit 'b1f01e85a92d401a9b29c79f23db36b7685e8c09'
* commit 'b1f01e85a92d401a9b29c79f23db36b7685e8c09':
  lavu: add a way to query hwcontext frame constraints

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-14 13:33:37 +01:00
Stefano Sabatini e8a9b64410 lavu/base64: add AV_BASE64_DECODE_SIZE() macro
This is consistent with the AV_BASE64_SIZE macro and avoids the literal
use of constants in the code.
2016-04-02 12:48:21 +02:00
Michael Niedermayer 564b4591bb opt: Add av_opt_copy()
This includes documentation and other modifications by
Lukasz Marek and Martin Storsjö.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-03-24 10:34:15 +02:00
Lukasz Marek 8833f1508b opt: Add const to av_opt_next
Also add const to pointers in static functions within opt.c where
possible/necessary.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-03-24 10:34:09 +02:00
Mark Thompson 551c6775ab lavu: VAAPI hwcontext implementation
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-03-19 15:40:22 +01:00
Mark Thompson d264c720f7 lavu: deprecate AV_PIX_FMT_VAAPI_*, replace with AV_PIX_FMT_VAAPI
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-03-19 15:40:22 +01:00
Mark Thompson b1f01e85a9 lavu: add a way to query hwcontext frame constraints
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-03-19 15:38:00 +01:00
Kieran Kunhya 4170a44bbc Add GBRAP12 pixel format
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-24 03:22:31 +01:00
Derek Buitenhuis 26abd5149e Merge commit '721a4efc0545548a241080b53ab480e34f366240'
* commit '721a4efc0545548a241080b53ab480e34f366240':
  buffer: add support for pools using caller data in allocation

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-17 16:07:16 +00:00
Michael Niedermayer 0eb4092c1b avutil/imgutils: remove special case for aligning the palette
This was suggested by wm4 and stefano.
After this patch using align=1 the size used by various functions would not
contain padding, while the palette would be aligned at align>1

This patch makes it required to use align>=4 if the palette is to be accessed
as uint32

As a side-effect It fixes storing pal8 in nut with odd with&height

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-14 21:30:32 +01:00
Anton Khirnov 721a4efc05 buffer: add support for pools using caller data in allocation
This should allow using more complex allocators than simple malloc
wrappers.
2016-02-14 21:24:39 +01:00
Michael Niedermayer 4c920ce777 avutil/imgutils: only align the palette in av_image_copy_to_buffer() if there is enough space
This allows disabling the alignment by using a compact buffer

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-13 19:49:34 +01:00
Michael Niedermayer a9b81bfd1c avutil/avstring: add a "ALL" entry and the possibility to negate matches to av_match_name()
This will extend the whitelist features to allow blacklisting individual protocols and to
explicitly force everything to be enabled.

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-13 16:40:11 +01:00
Derek Buitenhuis 66e9d2f44e avutil: Add GOP timecode frame side data
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-01 18:18:17 +00:00
Neil Birkbeck c323c98ee3 libavutil/mastering_display_metadata.h: change fields to be rationals as this is how they are typically coded.
(this structure is not referenced anywhere yet)

Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-29 19:08:52 +01:00
Derek Buitenhuis 21f9468402 avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPAT
Libav, for some reason, merged this as a public API function. This will
aid in future merges.

A define is left for backwards compat, just in case some person
used it, since it is in a public header.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-27 16:36:46 +00:00
Hendrik Leppkes c2869b4640 avutil: add P010 pixel format
P010 is the 10-bit variant of NV12 (planar luma, packed chroma), using two
bytes per component to store 10-bit data plus 6-bit zeroes in the LSBs.
2016-01-26 11:54:01 +01:00
Neil Birkbeck d91718107c libavutil: add mastering display metadata sidedata
Adding mastering display metadata struct to avutil. The mastering display metadata contains information
about the mastering display color volume (SMPTE 2086:2014).

This info comes from HEVC in the SEI_TYPE_MASTERING_DISPLAY_INFO and is soon to be included in MKV:
https://mailarchive.ietf.org/arch/search/?email_list=cellar&gbt=1&index=sZyfPTM-QY69P-0omfOIiTN622o
so it is similar to SEI FPA / stereo_mode in MKV and as such this patch follows how AVStereo3D is implemented.

I'll add support to HEVC in a follow-up (and MKV when spec is approved).

Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-19 16:43:31 +01:00
Clément Bœsch e8bc642202 lavu: add AV_CEIL_RSHIFT and use it in various places
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-11 15:32:56 -05:00
James Almer 28d5a3a74a lavu: rename and move ff_parity to av_parity
av_popcount is not defined in intmath.h.

Reviewed-by: ubitux
Signed-off-by: James Almer <jamrial@gmail.com>
2016-01-07 20:04:24 -03:00
Hendrik Leppkes e754c8e8ca Merge commit 'e2710e790c09e49e86baa58c6063af0097cc8cb0'
* commit 'e2710e790c09e49e86baa58c6063af0097cc8cb0':
  arm: add a cpu flag for the VFPv2 vector mode

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-02 11:01:29 +01:00
erankor 23ac99dc17 libavutil: add aes-ctr support
for supporting mp4 cenc encoding/decoding

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-15 14:16:28 +01:00
Janne Grunau e2710e790c arm: add a cpu flag for the VFPv2 vector mode
The vector mode was deprecated in ARMv7-A/VFPv3 and various cpu
implementations do not support it in hardware. Vector mode code will
depending the OS either be emulated in software or result in an illegal
instruction on cpus which does not support it. This was not really
problem in practice since NEON implementations of the same functions are
preferred. It will however become a problem for checkasm which tests
every cpu flag separately.

Since this is a cpu feature newer cpu do not support anymore the
behaviour of this flag differs from the other flags. It can be only
activated by runtime cpu feature selection.
2015-12-14 16:42:35 +01:00
Reynaldo H. Verdejo Pinochet 21c34cb261 libavutil: add version component accessor macros
Pretty standard macros, these should help libav*
users avoid repeating ver.si.on parsing code,
which aids in compatibility-checking tasks like
identifying FFmpeg from Libav (_MICRO >= 100 check).
Something many are doing since we are not
intercompatible anymore.

Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
2015-12-06 01:01:51 -08:00
Ganesh Ajjanagadde 1bb7db217d avutil/crc: avoid needless space wastage of hardcoded crc table
There was no reason AFAIK for making AV_CRC_24_IEEE 12. This simply
resulted in wasted space under --enable-hardcoded-tables:
dynamic: 1318672 libavutil/libavutil.so.55
old    : 1330680 libavutil/libavutil.so.55
new    : 1326488 libavutil/libavutil.so.55

Minor version number is bumped, with ifdefry due to API breakage.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-12-02 18:31:56 -05:00
Clément Bœsch 56bdf61baa avutil/motion_vector: export subpel motion information
FATE test changes because of the switch from shift to division.
2015-11-23 10:55:15 +01:00
Derek Buitenhuis e12f403678 Merge commit '588b6215b4c74945994eb9636b0699028c069ed2'
* 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-22 14:29:09 +00:00
Michael Niedermayer fc91eeab0b avutil/mem: Add av_fast_mallocz()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-18 22:05:16 +01:00
Ganesh Ajjanagadde 6f520ce1a6 avutil/common: add av_rint64_clip
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-13 21:48:16 -05:00
Martin Storsjö 92d107a171 xtea: Add functions for little endian mode
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-11-13 21:53:54 +02:00
Rodger Combs 1e477a970f lavu: add AESNI CPU flag 2015-10-28 04:23:14 -05:00
James Almer 3d1690b8c6 avutil: undo FF_API_CRYPTO_CONTEXT deprecation
It's been argued that the benefits of the current implementation far outweight
those of making the structs opaque.

This deprecation is not present in any release, so it can be safely removed.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-10-16 19:13:38 -03:00
Hendrik Leppkes b994788353 Merge commit '11c5f438ff83da5040e85bfa6299f56b321d32ef'
* commit '11c5f438ff83da5040e85bfa6299f56b321d32ef':
  dict: Change return type of av_dict_copy()

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-14 14:01:11 +02:00
Vittorio Giovara 11c5f438ff dict: Change return type of av_dict_copy()
av_dict_set() could return an error, so forward it appropriately.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-12 13:35:01 +02:00
Rodger Combs 0562f95902 lavu/opt: add flag to return NULL when applicable in av_opt_get
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-09 04:12:57 -05:00
Hendrik Leppkes 5fa5e73e81 Merge commit '1aa24df74c052a73175c43e57d35b4835e537ec8'
* commit '1aa24df74c052a73175c43e57d35b4835e537ec8':
  lavu: Deprecate AVFrame.error[]

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-03 09:52:39 +02:00
Vittorio Giovara 1aa24df74c lavu: Deprecate AVFrame.error[]
These field are difficult to interpret, and are provided by a single
encoder (mpegvideoenc). In general they do not belong to a structure
containing raw data only, so remove them from AVFrame.

Mpegvideoenc now uses a private field in Picture for its internal
computations.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-30 16:44:33 +02:00
Kevin Wheatley 4a66422450 pixfmt: Add new SMPTE color primaries and transfer characteristic values
Appeared in ITU-T Rec H.265 10/2014.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-17 10:31:43 +02:00
Michael Niedermayer 77d03b0ebb avutil/version: Bump for avpriv_get_trc_function_from_trc() and AVCOL_PRI/TRC_SMPTEST428_1 and AVCOL_TRC_SMPTEST2084
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-11 01:12:28 +02:00
Clément Bœsch 9117748cff avutil/opt: add AV_OPT_TYPE_BOOL 2015-09-08 22:39:20 +02:00
Hendrik Leppkes 151aa2ebff Merge commit '2268db2cd052674fde55c7d48b7a5098ce89b4ba'
* commit '2268db2cd052674fde55c7d48b7a5098ce89b4ba':
  lavu: Drop the {minus,plus}1 suffix from AVComponentDescriptor fields

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-08 16:35:28 +02:00
Vittorio Giovara 2268db2cd0 lavu: Drop the {minus,plus}1 suffix from AVComponentDescriptor fields
The new fields can be accessed directly and are more intelligible.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-07 12:37:47 +02:00
Hendrik Leppkes 160e92c8bf Merge commit 'e88103a7f92cf27a2868b50acc8a9912f6088249'
* commit 'e88103a7f92cf27a2868b50acc8a9912f6088249':
  Bump major versions of all libraries

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 21:35:46 +02:00
Hendrik Leppkes d83dd630a0 lavu: Drop FF_API_GET_CHANNEL_LAYOUT_COMPAT cruft
FATE refs changed to accomodate for the new default behavior of the function.
Numbers are now interpreted as a channel layout, instead of a number of channels.
2015-09-05 20:36:19 +02:00
Hendrik Leppkes 237cf3786e lavu: Drop old deprecated AVOption API
Deprecated in 2011/10
2015-09-05 18:30:35 +02:00
Hendrik Leppkes 137f075993 lavu/hmac: remove deprecated type ids 2015-09-05 18:07:20 +02:00
Hendrik Leppkes 545559e43d Remove FF_CONST_AVUTIL55 cruft 2015-09-05 17:56:28 +02:00