libav.git
5 days agolibdav1d: update API usage to the first stable release master
James Almer [Tue, 11 Dec 2018 15:59:09 +0000 (12:59 -0300)]
libdav1d: update API usage to the first stable release

The color fields were moved to another struct, and a way to propagate
timestamps and other input metadata was introduced, so the packet
fifo can be removed.

Add support for 12bit streams, an option to disable film grain, and
read the profile from the sequence header referenced by the ouput
picture instead of guessing based on output pix_fmt.

Signed-off-by: James Almer <jamrial@gmail.com>
4 weeks agolibdav1d: fix build after a recent API break github/master gitlab/master videolan/master
James Almer [Thu, 15 Nov 2018 01:04:35 +0000 (22:04 -0300)]
libdav1d: fix build after a recent API break

Signed-off-by: James Almer <jamrial@gmail.com>
5 weeks agoqsvenc: Add VDENC support for H264 and HEVC
Linjie Fu [Mon, 5 Nov 2018 02:28:59 +0000 (10:28 +0800)]
qsvenc: Add VDENC support for H264 and HEVC

Add VDENC(lowpower mode) support for QSV h264 and HEVC

It's an experimental function(like lowpower in vaapi) with
some limitations:
- CBR/VBR require HuC which should be explicitly loaded via i915
module parameter(i915.enable_guc=2 for linux kerner version >= 4.16)
- HEVC VDENC was supported >= ICE LAKE

use option "-low_power 1" to enable VDENC.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
6 weeks agoavcodec: libdav1d AV1 decoder wrapper.
James Almer [Tue, 6 Nov 2018 04:11:22 +0000 (01:11 -0300)]
avcodec: libdav1d AV1 decoder wrapper.

Originally written by Ronald S. Bultje, with fixes, optimizations and
improvements by James Almer.

Signed-off-by: James Almer <jamrial@gmail.com>
6 weeks agoswscale: Add GRAY10
Carl Eugen Hoyos [Tue, 6 Nov 2018 05:08:05 +0000 (02:08 -0300)]
swscale: Add GRAY10

Based on ab839054 by Luca Barbato.

Signed-off-by: James Almer <jamrial@gmail.com>
6 weeks agopixfmt: Add GRAY10
Carl Eugen Hoyos [Tue, 6 Nov 2018 04:39:03 +0000 (01:39 -0300)]
pixfmt: Add GRAY10

Based on 7471352f by Luca Barbato.

Signed-off-by: James Almer <jamrial@gmail.com>
6 weeks agolibx264: Pass the reordered_opaque field through the encoder
Martin Storsjö [Thu, 11 Oct 2018 13:03:10 +0000 (16:03 +0300)]
libx264: Pass the reordered_opaque field through the encoder

libx264 does have a field for opaque data to pass along with frames
through the encoder, but it is a pointer, while the libavcodec
reordered_opaque field is an int64_t. Therefore, allocate an array
within the libx264 wrapper, where reordered_opaque values in flight
are stored, and pass a pointer to this array to libx264.

Update the public libavcodec documentation for the AVCodecContext
field to explain this usage, and add a codec capability that allows
detecting whether an encoder handles this field.

Signed-off-by: Martin Storsjö <martin@martin.st>
6 weeks agolibavutil: Undeprecate the AVFrame reordered_opaque field
Martin Storsjö [Thu, 25 Oct 2018 12:41:26 +0000 (15:41 +0300)]
libavutil: Undeprecate the AVFrame reordered_opaque field

This was marked as deprecated (but only in the doxygen, not with an
actual deprecation attribute) in 81c623fae05 in 2011, but was
undeprecated in ad1ee5fa7.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 weeks agolibaom: remove references to yuva444p pixfmt
James Almer [Fri, 26 Oct 2018 02:12:05 +0000 (23:12 -0300)]
libaom: remove references to yuva444p pixfmt

Support for it was apparently never in the codebase, and the enum
value was recently removed from the public headers [1]

[1] https://aomedia.googlesource.com/aom/+/f1570f0c2f70832dd170285f8de60bd2379c8efa

Signed-off-by: James Almer <jamrial@gmail.com>
7 weeks agoRevert "decode: copy the output parameters from the last bsf in the chain back to...
James Almer [Wed, 12 Sep 2018 18:21:09 +0000 (15:21 -0300)]
Revert "decode: copy the output parameters from the last bsf in the chain back to the AVCodecContext"

This reverts commit 662558f985f50834eebe82d6b6854c66f33ab320.

The avcodec_parameters_to_context() call was freeing and reallocating
AVCodecContext->extradata, essentially taking ownership of it, which according
to the doxy is user owned. This is an API break and has produces crashes in
some library users like Firefox.
Revert until a better solution is found to internally propagate the filtered
extradata back into the decoder context.

Signed-off-by: James Almer <jamrial@gmail.com>
2 months agolavc/qsvenc_jpeg: set a default quality
Zhong Li [Thu, 11 Oct 2018 09:26:13 +0000 (17:26 +0800)]
lavc/qsvenc_jpeg: set a default quality

Keep alignment with vaapi mjpeg encoder.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2 months agolavc/qsvenc_jpeg: add async_depth support
Zhong Li [Thu, 11 Oct 2018 09:26:12 +0000 (17:26 +0800)]
lavc/qsvenc_jpeg: add async_depth support

Currently qsv (m)jpeg encoding is broken.
Regression introducing by the commit(id: c1bcd3): fix async support,
which requires the minimum async_depth to be 1, instead previous zero.
But the default async_depth of qsv (m)jpeg encoding is still initialized
(mostly) as zero.

This patch also abviously improves qsv (m)jpeg encoding performance
due to the default async_depth is changed to 4.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2 months agoarm: Emit .thumb_func directives
Martin Storsjö [Fri, 12 Oct 2018 10:29:51 +0000 (13:29 +0300)]
arm: Emit .thumb_func directives

Prior to Xcode 9.3, the clang built-in assembler didn't support
altmacro, and gas-preprocessor was used for assembling for arm/darwin.

For thumb functions, gas-preprocessor took care of adding the .thumb_func
directives, but when now being able to assemble without gas-preprocessor,
we need to add these directives ourselves.

Signed-off-by: Martin Storsjö <martin@martin.st>
2 months agoavcodec/libaomenc: export the Sequence Header OBU as extradata
James Almer [Mon, 8 Oct 2018 16:19:06 +0000 (13:19 -0300)]
avcodec/libaomenc: export the Sequence Header OBU as extradata

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2 months agoavcodec/libaomenc: remove AVOption related to frame partitions
James Almer [Wed, 12 Sep 2018 14:44:56 +0000 (11:44 -0300)]
avcodec/libaomenc: remove AVOption related to frame partitions

Support for it was apparently never in the codebase, and the enum
value was recently removed from the public headers [1]

[1] https://aomedia.googlesource.com/aom/+/df4ffb73140fe31bebdabd17c1a7b53721e74838

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2 months agoavcodec/extract_extradata: don't uninitialize the H2645Packet on every processed...
James Almer [Sat, 10 Mar 2018 22:57:35 +0000 (19:57 -0300)]
avcodec/extract_extradata: don't uninitialize the H2645Packet on every processed packet

Based on hevc_parser code. This prevents repeated unnecessary allocations
and frees on every packet processed by the bsf.

Reviewed-by: Jun Zhao <mypopydev@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2 months agoavcodec/extract_extradata: Move the reference in the bsf internal buffer
James Almer [Sun, 11 Mar 2018 16:45:05 +0000 (13:45 -0300)]
avcodec/extract_extradata: Move the reference in the bsf internal buffer

There is no need to allocate a new packet for it.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2 months agoavcodec/extract_extradata: Do not allocate more space than needed when removing NALUs...
James Almer [Fri, 9 Mar 2018 17:31:30 +0000 (14:31 -0300)]
avcodec/extract_extradata: Do not allocate more space than needed when removing NALUs in h264/hevc

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2 months agoavcodec/extract_extradata: Zero-initialize the padding bytes in all allocated buffers
James Almer [Fri, 9 Mar 2018 16:00:55 +0000 (13:00 -0300)]
avcodec/extract_extradata: Zero-initialize the padding bytes in all allocated buffers

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2 months agoavcodec/extract_extradata_bsf: Fix leak discovered via fuzzing
Nikolas Bowe [Tue, 5 Dec 2017 23:11:26 +0000 (15:11 -0800)]
avcodec/extract_extradata_bsf: Fix leak discovered via fuzzing

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2 months agoavcodec/bsf: Add ff_bsf_get_packet_ref() function
Jan Sebechlebsky [Thu, 28 Jul 2016 16:18:13 +0000 (18:18 +0200)]
avcodec/bsf: Add ff_bsf_get_packet_ref() function

Use of this function can save unnecessary malloc operation
in bitstream filter.

Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2 months agolavu/qsv: fix a random hwupload failure regression
Zhong Li [Sun, 30 Sep 2018 09:59:52 +0000 (17:59 +0800)]
lavu/qsv: fix a random hwupload failure regression

Variable 'ret' hasn't been initialized,thus introducing a random
hwupload failure regression due to qsv session uninitialized.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2 months agoqsvenc: AV_PIX_FMT_QSV path should release frame
Maxym Dmytrychenko [Tue, 18 Sep 2018 07:47:52 +0000 (09:47 +0200)]
qsvenc: AV_PIX_FMT_QSV path should release frame

Fixes high memory usage and prevents over allocation of the frames via
proper unref.

Can be checked as:
-hwaccel qsv -c:v h264_qsv -i ../h264-conformance/CANL2_Sony_E.jsv -c:v
h264_qsv -b:v 2000k -y qsv.mp4

3 months agolibfdk-aac: Don't use defined() in a #define
Martin Storsjö [Wed, 12 Sep 2018 20:03:12 +0000 (23:03 +0300)]
libfdk-aac: Don't use defined() in a #define

MSVC expands the preprocessor directives differently, making the
version check fail in the previous form.

Clang can warn about this with -Wexpansion-to-defined (not currently
enabled by default):
warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]

Signed-off-by: Martin Storsjö <martin@martin.st>
3 months agolibfdk-aacenc: Allow enabling the ELDv2 profile
Martin Storsjö [Tue, 4 Sep 2018 08:45:35 +0000 (11:45 +0300)]
libfdk-aacenc: Allow enabling the ELDv2 profile

This is a new feature in FDK v2.

Signed-off-by: Martin Storsjö <martin@martin.st>
3 months agolibfdk-aacdec: Allow setting the new dynamic range control effect setting
Martin Storsjö [Tue, 4 Sep 2018 08:36:37 +0000 (11:36 +0300)]
libfdk-aacdec: Allow setting the new dynamic range control effect setting

This is a new setting in FDK v2.

Signed-off-by: Martin Storsjö <martin@martin.st>
3 months agolibfdk-aac: Consistently use a proper version check macro for detecting features
Martin Storsjö [Tue, 4 Sep 2018 08:29:37 +0000 (11:29 +0300)]
libfdk-aac: Consistently use a proper version check macro for detecting features

The previous version checks checked explicitly for the version
where the version define was added to the installed headers,
making an "#ifdef AACDECODER_LIB_VL0" enough. Now that we have
a need for more diverse version checks than this, convert all checks
to such checks.

Signed-off-by: Martin Storsjö <martin@martin.st>
3 months agoqsvvpp: Perform full init only when needed
Joe Olivas [Sun, 2 Sep 2018 18:06:48 +0000 (20:06 +0200)]
qsvvpp: Perform full init only when needed

Removing unused VPP sessions by initializing only when used in order to help
reduce CPU utilization.

Thanks to Maxym for the guidance.

Signed-off-by: Joe Olivas <joseph.k.olivas@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
3 months agolibfdk-aacenc: Fix building with libfdk-aac v2
Martin Storsjö [Fri, 31 Aug 2018 11:25:30 +0000 (14:25 +0300)]
libfdk-aacenc: Fix building with libfdk-aac v2

When flushing the encoder, we now need to provide non-null buffer
parameters for everything, even if they are unused.

The encoderDelay parameter has been replaced by two, nDelay and
nDelayCore.

Signed-off-by: Martin Storsjö <martin@martin.st>
3 months agolavc/qsvenc: dump BufferSizeInKB message
Zhong Li [Mon, 27 Aug 2018 11:15:46 +0000 (19:15 +0800)]
lavc/qsvenc: dump BufferSizeInKB message

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
3 months agolavc/qsvenc: allow to set qp range for h264 BRC
Zhong Li [Mon, 27 Aug 2018 08:23:31 +0000 (16:23 +0800)]
lavc/qsvenc: allow to set qp range for h264 BRC

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
3 months agolibopenh264dec: Export the decoded profile and level in AVCodecContext
Martin Storsjö [Fri, 31 Aug 2018 09:25:40 +0000 (12:25 +0300)]
libopenh264dec: Export the decoded profile and level in AVCodecContext

Signed-off-by: Martin Storsjö <martin@martin.st>
3 months agotcp: Use ff_connect_parallel for RFC 8305 style connecting
Martin Storsjö [Fri, 10 Aug 2018 07:39:41 +0000 (10:39 +0300)]
tcp: Use ff_connect_parallel for RFC 8305 style connecting

Signed-off-by: Martin Storsjö <martin@martin.st>
3 months agonetwork: Add RFC 8305 style "Happy Eyeballs"/"Fast Fallback" helper function
Martin Storsjö [Fri, 10 Aug 2018 07:25:59 +0000 (10:25 +0300)]
network: Add RFC 8305 style "Happy Eyeballs"/"Fast Fallback" helper function

For cases with dual stack (IPv4 + IPv6) connectivity, but where one
stack potentially is less reliable, strive to trying to connect over
both protocols in parallel, using whichever address connected first.

In cases with a hostname resolving to multiple IPv4 and IPv6
addresses, the current connection mechanism would try all addresses
in the order returned by getaddrinfo (with all IPv6 addresses ordered
before the IPv4 addresses normally). If connection attempts to the
IPv6 addresses return quickly with an error, this was no problem, but
if they were unsuccessful leading up to timeouts, the connection process
would have to wait for timeouts on all IPv6 target addresses before
attempting any IPv4 address.

Similar to what RFC 8305 suggests, reorder the list of addresses to
try connecting to, interleaving address families. After starting one
connection attempt, start another one in parallel after a small delay
(200 ms as suggested by the RFC).

For cases with unreliable IPv6 but reliable IPv4, this should make
connection attempts work as reliably as with plain IPv4, with only an
extra 200 ms of connection delay.

Signed-off-by: Martin Storsjö <martin@martin.st>
3 months agoqsvdec: Release packet on decoding failure for mpeg2/vp8/vc1
Zhong Li [Wed, 15 Aug 2018 09:39:35 +0000 (17:39 +0800)]
qsvdec: Release packet on decoding failure for  mpeg2/vp8/vc1

H264/265 have been fixed such an issue with commit
559370f2c45110afd8308eec7194437736c323d4.
Similar fixing is needed for other codecs.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
3 months agoqsvenc: Fix a misleading log message
Zhong Li [Wed, 15 Aug 2018 09:39:34 +0000 (17:39 +0800)]
qsvenc: Fix a misleading log message

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
3 months agoqsv: Error out if getting session handle failed in avfilter
Zhong Li [Wed, 15 Aug 2018 09:39:33 +0000 (17:39 +0800)]
qsv: Error out if getting session handle failed in avfilter

Solve some issues found by an automated code scansion.
Suppress the complain "variables 'handle' is used but maybe
uninitialized".

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
4 months agodecode: copy the output parameters from the last bsf in the chain back to the AVCodec...
James Almer [Fri, 27 Jul 2018 16:29:03 +0000 (13:29 -0300)]
decode: copy the output parameters from the last bsf in the chain back to the AVCodecContext

Signed-off-by: James Almer <jamrial@gmail.com>
4 months agodecode: flush the internal bsfs instead of constantly reinitalizing them
James Almer [Fri, 27 Jul 2018 16:27:45 +0000 (13:27 -0300)]
decode: flush the internal bsfs instead of constantly reinitalizing them

Signed-off-by: James Almer <jamrial@gmail.com>
4 months agoh264_redundant_pps_bsf: implement a AVBSFContext.flush() callback
James Almer [Fri, 27 Jul 2018 16:24:53 +0000 (13:24 -0300)]
h264_redundant_pps_bsf: implement a AVBSFContext.flush() callback

Signed-off-by: James Almer <jamrial@gmail.com>
4 months agovp9_superframe_bsf: implement a AVBSFContext.flush() callback
James Almer [Fri, 27 Jul 2018 16:23:44 +0000 (13:23 -0300)]
vp9_superframe_bsf: implement a AVBSFContext.flush() callback

Signed-off-by: James Almer <jamrial@gmail.com>
4 months agovp9_superframe_split_bsf: implement a AVBSFContext.flush() callback
James Almer [Fri, 27 Jul 2018 16:22:34 +0000 (13:22 -0300)]
vp9_superframe_split_bsf: implement a AVBSFContext.flush() callback

Signed-off-by: James Almer <jamrial@gmail.com>
4 months agoh264_mp4toannexb_bsf: implement a AVBSFContext.flush() callback
James Almer [Fri, 27 Jul 2018 16:21:16 +0000 (13:21 -0300)]
h264_mp4toannexb_bsf: implement a AVBSFContext.flush() callback

Signed-off-by: James Almer <jamrial@gmail.com>
4 months agobsf: add a flushing mechanism to AVBSFContext
James Almer [Fri, 27 Jul 2018 16:18:29 +0000 (13:18 -0300)]
bsf: add a flushing mechanism to AVBSFContext

Meant to reset the internal bsf state without the need to reinitialize it.

Signed-off-by: James Almer <jamrial@gmail.com>
4 months agotls_openssl: Fix checks for SSL_ERROR_WANT_WRITE in nonblocking operation
Martin Storsjö [Thu, 16 Aug 2018 07:55:41 +0000 (09:55 +0200)]
tls_openssl: Fix checks for SSL_ERROR_WANT_WRITE in nonblocking operation

This was a typo in 0671eb2346c, spotted by Chris Carroux.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 months agonetwork: Check for EINTR in ff_poll_interrupt
Martin Storsjö [Thu, 9 Aug 2018 18:30:48 +0000 (21:30 +0300)]
network: Check for EINTR in ff_poll_interrupt

Signed-off-by: Martin Storsjö <martin@martin.st>
4 months agonetwork: Use ff_neterrno instead of AVERROR(errno) for poll errors
Simon Thelen [Sat, 8 Apr 2017 12:21:28 +0000 (14:21 +0200)]
network: Use ff_neterrno instead of AVERROR(errno) for poll errors

This makes sure to pick up the actual error codes on windows.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 months agohttp: pass return code from http_open_cnx_internal() on its failure
Andrey Utkin [Thu, 23 Oct 2014 16:55:46 +0000 (20:55 +0400)]
http: pass return code from http_open_cnx_internal() on its failure

Previously, AVERROR(EIO) was returned on failure of
http_open_cnx_internal(). Now the value is passed to upper level, thus
it is possible to distinguish ECONNREFUSED, ETIMEDOUT, ENETUNREACH etc.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 months agoqsv: enforcing continuous memory layout
Maxym Dmytrychenko [Mon, 30 Jul 2018 16:02:37 +0000 (18:02 +0200)]
qsv: enforcing continuous memory layout

we need to make sure that memory allocation for Y/UV planes is continuous and re-used from a
pool

Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
4 months agoframe: Simplify the video allocation
Luca Barbato [Fri, 27 Jul 2018 06:34:08 +0000 (08:34 +0200)]
frame: Simplify the video allocation

4 months agolibopenh264: Add support for decoding of b-frames
Martin Storsjö [Mon, 30 Jul 2018 11:58:37 +0000 (14:58 +0300)]
libopenh264: Add support for decoding of b-frames

The current git master version of libopenh264 supports decoding of
b-frames.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 months agoavconv: make sure packets put into the muxing FIFO are refcounted
wm4 [Wed, 8 Feb 2017 08:53:26 +0000 (09:53 +0100)]
avconv: make sure packets put into the muxing FIFO are refcounted

Some callers (like do_subtitle_out(), or do_streamcopy()) call this
with an AVPacket that is not refcounted. This can cause undefined
behavior.

Calling av_packet_move_ref() does not make a packet refcounted if it
isn't yet. (And it can't be made to, because it always succeeds,
and can't return ENOMEM.)

Call av_packet_ref() instead to make sure it's refcounted.

Cc: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
4 months agoavcodec/qsv: fix async support
Dmitry Rogozhkin [Tue, 24 Jul 2018 17:36:19 +0000 (10:36 -0700)]
avcodec/qsv: fix async support

Current implementations of qsv components incorrectly work with async level, they
actually try to work in async+1 level stepping into MFX_WRN_DEVICE_BUSY and polling
loop. This change address this misbehaviour.

Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Cc: Maxym Dmytrychenko <maxim.d33@gmail.com>
Cc: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
5 months agolibsrt: Pass the correct pointer for the passphrase
Sven Dueking [Fri, 13 Jul 2018 00:08:50 +0000 (02:08 +0200)]
libsrt: Pass the correct pointer for the passphrase

The passphrase field is a pointer already.

Bug-Id: https://github.com/Haivision/srt/issues/416

5 months agolibfdk-aac: Use enum names instead of literal numbers for the output format
Martin Storsjö [Thu, 5 Jul 2018 20:05:02 +0000 (23:05 +0300)]
libfdk-aac: Use enum names instead of literal numbers for the output format

Signed-off-by: Martin Storsjö <martin@martin.st>
5 months agoconfigure: fix inline asm checks
John Cox [Wed, 30 May 2018 16:30:31 +0000 (17:30 +0100)]
configure: fix inline asm checks

Commit 8c893aa3cd5 removed quotes that were required to detect
inline asm:

check_insn armv5te qadd r0, r0, r0
.../test.c:1:34: error: expected string literal in 'asm'
void foo(void){ __asm__ volatile(qadd r0, r0, r0); }

The correct code is:

void foo(void){ __asm__ volatile("qadd r0, r0, r0"); }

Commit message written by Frank Liberato <liberato@chromium.org>

Signed-off-by: Martin Storsjö <martin@martin.st>
6 months agoqsvenc: remove vcm option on Linux
Zhong Li [Thu, 7 Jun 2018 08:51:54 +0000 (16:51 +0800)]
qsvenc: remove vcm option on Linux

1. vcm mode is only available for H264.
2. vcm is not supported on Linux, but it is shown when run "./avconv -h
encoder=h264_qsv |grep vcm". This shouldn't happen.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
6 months agoqsvenc: use the compression_level to replace private option
Zhong Li [Thu, 7 Jun 2018 23:00:18 +0000 (07:00 +0800)]
qsvenc: use the compression_level to replace private option

Use a common way to control target_usage, keeping consistent with vaapi
encoders. The private option preset is kept only for compatibility.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
6 months agoavformat/libsrt: add latency options and deprecate tspbdelay
Sven Dueking [Mon, 21 May 2018 07:40:17 +0000 (14:40 +0700)]
avformat/libsrt: add latency options and deprecate tspbdelay

Signed-off-by: Sven Dueking <sven.dueking@nablet.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
6 months agoavformat/libsrt: add payload size option
Sven Dueking [Mon, 21 May 2018 06:55:25 +0000 (13:55 +0700)]
avformat/libsrt: add payload size option

Signed-off-by: Sven Dueking <sven.dueking@nablet.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
6 months agoqsvenc: Add an option to disable MFE mode
Zhong Li [Wed, 23 May 2018 10:01:32 +0000 (18:01 +0800)]
qsvenc: Add an option to disable MFE mode

Provide proper aliases to enable/disable MFE.

The numeric values are ambiguous and misleading (e.g: user may misunderstand
setting mfmode to 1 is to enable MFE but actually it is to disable MFE, and
set it to be 5 or above is meaningless).

MFX_MF_MANUAL hasn't been exposed since it is to be implemented.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
7 months agotls_mbedtls: Use non-deprecated header file
Diego Biurrun [Wed, 25 Apr 2018 10:51:14 +0000 (10:51 +0000)]
tls_mbedtls: Use non-deprecated header file

/usr/include/mbedtls/net.h:29:2: warning: #warning "Deprecated header file: Superseded by mbedtls/net_sockets.h" [-Wcpp]

7 months agoconfigure: Rename require_header() --> require_headers()
Diego Biurrun [Sun, 1 Apr 2018 20:13:55 +0000 (22:13 +0200)]
configure: Rename require_header() --> require_headers()

This renaming was overlooked in the previous check_header() rename.

7 months agolibavformat: add mbedTLS based TLS
Thomas Volkert [Sat, 21 Apr 2018 13:53:31 +0000 (15:53 +0200)]
libavformat: add mbedTLS based TLS

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
7 months agoconfigure: Move add_fooflags() helper functions into canonical order
Diego Biurrun [Fri, 20 Oct 2017 22:43:15 +0000 (00:43 +0200)]
configure: Move add_fooflags() helper functions into canonical order

7 months agoconfigure: Group toolchain parameter mangling functions together
Diego Biurrun [Fri, 20 Oct 2017 19:18:51 +0000 (21:18 +0200)]
configure: Group toolchain parameter mangling functions together

7 months agoconfigure: Rename check_header() --> check_headers()
Diego Biurrun [Tue, 13 Feb 2018 08:31:57 +0000 (09:31 +0100)]
configure: Rename check_header() --> check_headers()

The plural in the name clarifies the fact that the function
can check for multiple headers at once.

7 months agoconfigure: Make require_cc() and require_cpp_condition() functions consistent
Diego Biurrun [Wed, 28 Mar 2018 07:11:17 +0000 (09:11 +0200)]
configure: Make require_cc() and require_cpp_condition() functions consistent

Their API and implementation is different from other require_foo() functions,
which violates the rule of least astonishment.

7 months agobuild: Group external library protocols separately
Diego Biurrun [Thu, 22 Mar 2018 13:57:53 +0000 (14:57 +0100)]
build: Group external library protocols separately

7 months agoamfenc: Retain a reference to D3D frames used as input during the encoding process
Alexander Kravchenko [Thu, 12 Apr 2018 15:41:35 +0000 (18:41 +0300)]
amfenc: Retain a reference to D3D frames used as input during the encoding process

This fixes frame corruption issue when decoder started reusing frames
while they are still in use of encoding process

Issue with frame corruption  was reproduced using:

    avconv.exe -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i input.h264 -an -c:v h264_amf output.mkv

It is recommended to use -extra_hw_frames 16 option in case if hw frames
number in pool is not enough

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 months agorandom_seed: use bcrypt instead of the old wincrypt API
Steve Lhomme [Tue, 3 Apr 2018 09:44:25 +0000 (11:44 +0200)]
random_seed: use bcrypt instead of the old wincrypt API

Remove the wincrypt API calls since we don't support XP anymore and
bcrypt is available since Vista, even on Windows Store builds.

Signed-off-by: Martin Storsjö <martin@martin.st>
8 months agox86: Don't declare a non-static function as inline
Martin Storsjö [Sat, 14 Apr 2018 10:37:03 +0000 (13:37 +0300)]
x86: Don't declare a non-static function as inline

This fixes building with clang in msvc mode, which does support
gcc style inline assembly.

8 months agoDrop Windows XP support remnants
Diego Biurrun [Sun, 1 Apr 2018 23:06:18 +0000 (01:06 +0200)]
Drop Windows XP support remnants

8 months agow32pthreads: always use Vista+ API, drop XP support
wm4 [Thu, 21 Dec 2017 19:23:14 +0000 (20:23 +0100)]
w32pthreads: always use Vista+ API, drop XP support

This removes the XP compatibility code, and switches entirely to SRW
locks, which are available starting at Windows Vista.

This removes CRITICAL_SECTION use, which allows us to add
PTHREAD_MUTEX_INITIALIZER, which will be useful later.

Windows XP is hereby not a supported build target anymore.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
8 months agoavprobe: Print a user-friendly version of the display matrix
Vittorio Giovara [Wed, 4 Apr 2018 15:29:35 +0000 (17:29 +0200)]
avprobe: Print a user-friendly version of the display matrix

Shift fixed point numbers to be actual decimal numbers.

8 months agoavprobe: Support printing strings with empty keys
Vittorio Giovara [Wed, 4 Apr 2018 15:29:34 +0000 (17:29 +0200)]
avprobe: Support printing strings with empty keys

8 months agolibx265: Support tiny video sizes
Vittorio Giovara [Fri, 16 Mar 2018 15:34:25 +0000 (11:34 -0400)]
libx265: Support tiny video sizes

Where tiny is less than the default CTU size.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 months agolavc/qsvdec: set complete_frame flags for progressive picture
Zhong Li [Sat, 7 Apr 2018 17:38:55 +0000 (19:38 +0200)]
lavc/qsvdec: set complete_frame flags for progressive picture

Set the flag MFX_BITSTREAM_COMPLETE_FRAME when it is a progressive picture.
This can fix vc1 decoding segment fault issues because can't set the start
code correctly.

See: ./avconv -hwaccel qsv -c:v vc1_qsv -i /fate-suite/vc1/SA00040.vc1
-vf "hwdownload, format=nv12" -f rawvideo /dev/null

v2: fix some h264 interlaced clips regression
a. field_order of some h264 interlaced video (e.g: cama3_vtc_b.avc) is marked as AV_FIELD_UNKNOWN
   in h264_parser.c. This is not a completed frames.
   So only set the MFX_BITSTREAM_COMPLETE_FRAME when it is progressive.
b. some clips have both progressive and interlaced frames (e.g.CAPAMA3_Sand_F.264),
   the parsed field_order maybe changed druing the decoding progress.

This patch has been verified for other codecs(mpeg2/hevc/vp8).

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
8 months agoqsv: adding Multi Frame Encode support
Maxym Dmytrychenko [Mon, 2 Apr 2018 13:17:23 +0000 (15:17 +0200)]
qsv: adding Multi Frame Encode support

Starting from API 1.25 helps to improve performance of the simultaneous
encode, 1:N scenario, like:

./avconv  -y -hwaccel qsv -c:v h264_qsv -r 30000/1001 -i
~/bbb_sunflower_1080p_60fps_normal.mp4  -vframes 600 -an \
    -filter_complex "split=2[s1][s2]; [s1]scale_qsv=1280:720[o1];
[s2]scale_qsv=960:540[o2]" \
    -map [o1] -c:v h264_qsv -b:v 3200k -minrate 3200k -maxrate 3200k -f
rawvideo /tmp/3200a.264 \
    -map [o2] -c:v h264_qsv -b:v 1750k -minrate 1750k -maxrate 1750k -f
rawvideo /tmp/1750a.264

Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
8 months agolavf/qsvvpp: bypass vpp if not needed.
Zhong Li [Wed, 4 Apr 2018 09:51:30 +0000 (17:51 +0800)]
lavf/qsvvpp: bypass vpp if not needed.

Currently vpp pipeline is always created, even for the unnecessary
cases such as setting the option "vpp_qsv=w=1280:h=720" for an input
with native resolution 1280x720. Thus introduces unnecessary performance
dropping, so bypass vpp if not needed.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
8 months agolavc/qsvdec: expose frame pic_type and key_frame
Zhong Li [Wed, 4 Apr 2018 09:51:29 +0000 (17:51 +0800)]
lavc/qsvdec: expose frame pic_type and key_frame

Currently pict_type and key_frame are unset.
Add an extra param to fetch the picture type from qsv decoder

The judgement “key frame is equal to IDR frame” only suitable for H264.
For HEVC, all IRAP frames are key frames, and other codecs have no IDR
frame.

Signed-off-by: ChaoX A Liu <chaox.a.liu@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
8 months agolibaom: remove references to RGB pixfmts
James Almer [Wed, 4 Apr 2018 23:12:41 +0000 (20:12 -0300)]
libaom: remove references to RGB pixfmts

Support for it was apparently never in the codebase, and the enum
values were recently removed from the public headers [1]

Fixes build with latest libaom build.

[1] https://aomedia.googlesource.com/aom/+/3f29cc20e3a4c348cb41a797c68de856ddb84e12

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agolibaom: remove references to yuv440p pixfmt
James Almer [Mon, 2 Apr 2018 01:50:34 +0000 (22:50 -0300)]
libaom: remove references to yuv440p pixfmt

Support for it was apparently never in the codebase, and the enum
values were recently removed from the public headers [1]

Fixes build with latest libaom build.

[1] https://aomedia.googlesource.com/aom/+/2e3cd5c5c30fa02134681cda900c32486807af3f

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoarm: Produce .const_data instead of .section .rodata for Mach-O
Martin Storsjö [Fri, 30 Mar 2018 09:33:46 +0000 (12:33 +0300)]
arm: Produce .const_data instead of .section .rodata for Mach-O

This is the same combination of .section directives as used in
aarch64/asm.S.

Since Xcode 9.3, the bundled clang supports altmacro and doesn't
require using gas-preprocessor any longer.

Signed-off-by: Martin Storsjö <martin@martin.st>
8 months agoarm: vc1dsp: Add commas between macro arguments
Martin Storsjö [Fri, 30 Mar 2018 09:31:09 +0000 (12:31 +0300)]
arm: vc1dsp: Add commas between macro arguments

When targeting darwin, clang requires commas between arguments,
while the no-comma form is allowed for other targets.

Since Xcode 9.3, the bundled clang supports altmacro and doesn't
require using gas-preprocessor any longer.

Signed-off-by: Martin Storsjö <martin@martin.st>
8 months agoconfigure: Revert some incorrect uses of check_cc()
Diego Biurrun [Thu, 29 Mar 2018 07:24:34 +0000 (09:24 +0200)]
configure: Revert some incorrect uses of check_cc()

8 months agolibaomenc: fix profile setting
James Almer [Thu, 29 Mar 2018 16:03:04 +0000 (13:03 -0300)]
libaomenc: fix profile setting

Main Profile is yuv420p 8 and 10 bit
High Profile is yuv444p 8 and 10 bit
Professional Profile is yuv422p 8, 10, and 12 bit, plus every other pixfmt at 12 bit

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavcodec: rename the AV1 profiles
James Almer [Thu, 29 Mar 2018 16:02:56 +0000 (13:02 -0300)]
avcodec: rename the AV1 profiles

Use the proper names instead of numbers

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoAdd Haivision SRT protocol
Sven Dueking [Mon, 26 Mar 2018 15:37:49 +0000 (11:37 -0400)]
Add Haivision SRT protocol

The protocol requires libsrt (https://github.com/Haivision/srt) to be
installed

Signed-off-by: Sven Dueking <sven.dueking@nablet.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 months agoconfigure: Drop unused helper function test_cflags_cpp()
Diego Biurrun [Tue, 13 Mar 2018 10:03:11 +0000 (11:03 +0100)]
configure: Drop unused helper function test_cflags_cpp()

8 months agoconfigure: Simplify vararg check
Diego Biurrun [Thu, 8 Mar 2018 14:42:32 +0000 (15:42 +0100)]
configure: Simplify vararg check

8 months agoconfigure: Add check_x86asm() helper function to simplify some expressions
Diego Biurrun [Fri, 20 Oct 2017 23:07:34 +0000 (01:07 +0200)]
configure: Add check_x86asm() helper function to simplify some expressions

8 months agoconfigure: Use indirection for the -o assembler flag also for x86asm
Diego Biurrun [Wed, 14 Mar 2018 13:47:43 +0000 (14:47 +0100)]
configure: Use indirection for the -o assembler flag also for x86asm

Similar indirections are used for the -o compiler/assembler flag to
account for differences in compiler/assembler syntax. For x86asm half
the infrastructure for doing the same currently exists unused.
Finish and use that infrastructure for consistency.

8 months agoconfigure: Use a more sensible suffix for x86 assembly tempfiles
Diego Biurrun [Fri, 9 Mar 2018 16:28:51 +0000 (17:28 +0100)]
configure: Use a more sensible suffix for x86 assembly tempfiles

8 months agoconfigure: Document available options for the --toolchain parameter
Diego Biurrun [Fri, 9 Mar 2018 16:19:15 +0000 (17:19 +0100)]
configure: Document available options for the --toolchain parameter

8 months agoqsv: align surface width/height to 16.
Ruiling Song [Tue, 6 Mar 2018 02:35:56 +0000 (10:35 +0800)]
qsv: align surface width/height to 16.

Per MediaSDK documentation, it requires width/height to 16 alignment.
Without this patch, hwupload pipeline may fail if 16 alignment is
not met. Although this patch also apply 16 alignment to qsv encoder/decoder,
it will not bring any side-effect to them as they are already aligned.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 months agoconfigure: Don't assume a 16 byte aligned stack on BSDs on i386
Martin Storsjö [Thu, 15 Mar 2018 21:47:22 +0000 (23:47 +0200)]
configure: Don't assume a 16 byte aligned stack on BSDs on i386

With GCC, request it to maintain 16 byte alignment, and the existing
entry points already align it via attribute_align_arg.

With clang, do the same as for mingw; disable the aligned stack
and let the assembly functions that require it do the alignment
instead.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 months agoqsvenc: add the Access Unit Delimiter NAL Unit support
Zhong Li [Thu, 15 Mar 2018 10:02:12 +0000 (18:02 +0800)]
qsvenc: add the Access Unit Delimiter NAL Unit support

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 months agoqsvenc: Fix a typo of FrameRateExtD/FrameRateExtN
Zhong Li [Thu, 15 Mar 2018 10:02:11 +0000 (18:02 +0800)]
qsvenc: Fix a typo of FrameRateExtD/FrameRateExtN

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 months agoconfigure: Don't assume an aligned stack on clang on windows
Martin Storsjö [Mon, 12 Mar 2018 22:13:55 +0000 (00:13 +0200)]
configure: Don't assume an aligned stack on clang on windows

If we'd enable a 16 byte aligned stack, clang/llvm would also assume
that alignment everywhere and produce code that strictly requires it.
That would require adding realignment (via attribute_align_arg) on every
single public library function or enable -mstackrealign (which does the
same on every single function).

Also relatedly; the parameter currently tested (-mllvm
-stack-alignment=16) hasn't actually been supported for quite some
time; current clang versions use -mstack-alignment=16 for the same.
Actually testing for that parameter would be a different change
though, since it has a real risk of changing behaviour on any other
platform where clang is used.

Signed-off-by: Martin Storsjö <martin@martin.st>