Commit Graph

45225 Commits

Author SHA1 Message Date
Zhong Li 4c5e77e0bf 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>
2018-10-13 15:57:06 +02:00
Martin Storsjö 5584abf69d 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>
2018-10-12 23:25:53 +03:00
James Almer 04e8b8b053 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>
2018-10-11 11:37:53 +02:00
James Almer 97c9a50844 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>
2018-10-11 11:32:46 +02:00
James Almer 3365e91b1e 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>
2018-10-06 21:31:54 +02:00
James Almer 6442d8bad6 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>
2018-10-06 21:31:54 +02:00
James Almer 70f11ee998 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>
2018-10-06 21:31:54 +02:00
James Almer be65995d23 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>
2018-10-06 21:31:43 +02:00
Nikolas Bowe aaf7fd1680 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>
2018-10-03 21:03:31 +02:00
Jan Sebechlebsky 87d5686151 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>
2018-10-03 21:03:30 +02:00
Zhong Li 21733b39d0 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>
2018-10-03 11:10:02 +00:00
Maxym Dmytrychenko a2041a6522 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
2018-09-18 17:53:37 +02:00
Martin Storsjö 2a9e1c122e 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>
2018-09-13 22:11:50 +03:00
Martin Storsjö 7e929dac10 libfdk-aacenc: Allow enabling the ELDv2 profile
This is a new feature in FDK v2.

Signed-off-by: Martin Storsjö <martin@martin.st>
2018-09-05 22:40:54 +03:00
Martin Storsjö 2edaafe5b9 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>
2018-09-05 22:40:50 +03:00
Martin Storsjö ffb9b7a6ba 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>
2018-09-05 22:40:46 +03:00
Joe Olivas 642fd4769b 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>
2018-09-04 12:32:22 +00:00
Martin Storsjö 141c960e21 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>
2018-09-03 10:50:51 +03:00
Zhong Li c8bca9fe46 lavc/qsvenc: dump BufferSizeInKB message
Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
2018-09-02 20:02:02 +02:00
Zhong Li e16b20782a 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>
2018-09-02 20:01:42 +02:00
Martin Storsjö 83678dbbae libopenh264dec: Export the decoded profile and level in AVCodecContext
Signed-off-by: Martin Storsjö <martin@martin.st>
2018-08-31 13:25:25 +03:00
Martin Storsjö 8c76bfacf6 tcp: Use ff_connect_parallel for RFC 8305 style connecting
Signed-off-by: Martin Storsjö <martin@martin.st>
2018-08-31 12:26:52 +03:00
Martin Storsjö 9b4c3f5aad 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>
2018-08-31 12:26:51 +03:00
Zhong Li 69caad8959 qsvdec: Release packet on decoding failure for mpeg2/vp8/vc1
H264/265 have been fixed such an issue with commit
559370f2c4.
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>
2018-08-23 08:22:46 +02:00
Zhong Li 76eef04f30 qsvenc: Fix a misleading log message
Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2018-08-23 08:22:45 +02:00
Zhong Li e05e5920a4 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>
2018-08-23 08:22:34 +02:00
James Almer 662558f985 decode: copy the output parameters from the last bsf in the chain back to the AVCodecContext
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-17 14:33:44 -03:00
James Almer ad99cbc9b3 decode: flush the internal bsfs instead of constantly reinitalizing them
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-17 14:33:43 -03:00
James Almer 0e27e27670 h264_redundant_pps_bsf: implement a AVBSFContext.flush() callback
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-17 14:33:43 -03:00
James Almer 7f01c209f2 vp9_superframe_bsf: implement a AVBSFContext.flush() callback
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-17 14:33:43 -03:00
James Almer eb1d1c764c vp9_superframe_split_bsf: implement a AVBSFContext.flush() callback
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-17 14:33:25 -03:00
James Almer d6321851ba h264_mp4toannexb_bsf: implement a AVBSFContext.flush() callback
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-17 14:06:21 -03:00
James Almer e1e1e8dbb2 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>
2018-08-17 14:06:21 -03:00
Martin Storsjö 6a9c00c09d tls_openssl: Fix checks for SSL_ERROR_WANT_WRITE in nonblocking operation
This was a typo in 0671eb2346, spotted by Chris Carroux.

Signed-off-by: Martin Storsjö <martin@martin.st>
2018-08-17 13:08:28 +03:00
Martin Storsjö 22f98ac19c network: Check for EINTR in ff_poll_interrupt
Signed-off-by: Martin Storsjö <martin@martin.st>
2018-08-14 22:30:33 +03:00
Simon Thelen c194b9ad6d 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>
2018-08-14 22:30:29 +03:00
Andrey Utkin 5d01bd181b 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>
2018-08-14 22:30:23 +03:00
Maxym Dmytrychenko 325aa63dd1 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>
2018-08-06 22:30:18 +02:00
Luca Barbato f89ec87afa frame: Simplify the video allocation 2018-08-05 22:45:08 +02:00
Martin Storsjö e1e3a12242 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>
2018-08-01 09:55:41 +03:00
wm4 c011beda26 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>
2018-08-01 09:55:34 +03:00
Dmitry Rogozhkin c1bcd321ea 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>
2018-07-26 09:57:54 +02:00
Sven Dueking f25117a428 libsrt: Pass the correct pointer for the passphrase
The passphrase field is a pointer already.

Bug-Id: https://github.com/Haivision/srt/issues/416
2018-07-13 18:36:11 +02:00
Martin Storsjö b93026777a libfdk-aac: Use enum names instead of literal numbers for the output format
Signed-off-by: Martin Storsjö <martin@martin.st>
2018-07-06 23:03:32 +03:00
John Cox 52fd2afce8 configure: fix inline asm checks
Commit 8c893aa3cd 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>
2018-06-29 13:43:28 +03:00
Zhong Li 4ce701b4e6 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>
2018-06-11 13:33:52 +02:00
Zhong Li f8060865f3 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>
2018-06-11 13:33:23 +02:00
Sven Dueking a507af97ee 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>
2018-06-04 18:47:48 +02:00
Sven Dueking ea8ae27a5e avformat/libsrt: add payload size option
Signed-off-by: Sven Dueking <sven.dueking@nablet.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2018-06-03 17:46:23 +02:00
Zhong Li 35ed7f93db 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>
2018-05-24 14:37:23 +02:00