libav.git
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years agoframe: Simplify the video allocation
Luca Barbato [Fri, 27 Jul 2018 06:34:08 +0000 (08:34 +0200)]
frame: Simplify the video allocation

2 years 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>
2 years 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>
2 years 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>
2 years 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

2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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]

2 years 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.

2 years 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>
2 years 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

2 years 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

2 years 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.

2 years 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.

2 years 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

2 years 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>
2 years 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>
2 years 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.

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

2 years 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>
2 years 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.

2 years 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

2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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()

2 years 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>
2 years 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>
2 years 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>
2 years 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()

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

2 years 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

2 years 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.

2 years 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

2 years 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

2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years agoSupport AV1 encoding using libaom
Luca Barbato [Sun, 11 Feb 2018 20:33:25 +0000 (21:33 +0100)]
Support AV1 encoding using libaom

2 years agoAdd AV1 video decoding support through libaom
Luca Barbato [Thu, 25 Aug 2016 15:28:17 +0000 (17:28 +0200)]
Add AV1 video decoding support through libaom

Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2 years agoivf: Support VP9 and AV1 as well
Luca Barbato [Sun, 11 Feb 2018 20:32:04 +0000 (21:32 +0100)]
ivf: Support VP9 and AV1 as well

2 years agoconfigure: Restore original endianness test
Diego Biurrun [Thu, 8 Mar 2018 10:47:04 +0000 (11:47 +0100)]
configure: Restore original endianness test

Previously the bit pattern for the endianness test was declared as a
global, instead of a local, variable. This ensures that the pattern
appears unchanged in the object file and is not optimized out.

2 years agoamf: Replace writer_id option with LIBAV_AMF_WRITER_ID constant
Alexander Kravchenko [Wed, 28 Feb 2018 06:33:05 +0000 (06:33 +0000)]
amf: Replace writer_id option with LIBAV_AMF_WRITER_ID constant

AMFTraceWriter is an abstraction to configure how AMF outputs its logs
for the current process and can be configured to output different levels
of trace output. If multiple LibavWriter objects are used in one process,
there will be duplication of output in av_log. Use a constant writer_id
to prevent this scenario.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2 years agoconfigure: Add check_as() helper function to simplify some expressions
Diego Biurrun [Fri, 20 Oct 2017 02:43:13 +0000 (04:43 +0200)]
configure: Add check_as() helper function to simplify some expressions

2 years agoconfigure: Add check_ld() helper function to simplify some expressions
Diego Biurrun [Fri, 20 Oct 2017 01:43:58 +0000 (03:43 +0200)]
configure: Add check_ld() helper function to simplify some expressions

2 years agoconfigure: Add check_cc/require_cc helper functions to simplify some expressions
Diego Biurrun [Tue, 17 Oct 2017 01:00:50 +0000 (03:00 +0200)]
configure: Add check_cc/require_cc helper functions to simplify some expressions

2 years agoconfigure: Add check_cpp_condition() helper function to simplify some expressions
Diego Biurrun [Sat, 7 Oct 2017 19:20:36 +0000 (21:20 +0200)]
configure: Add check_cpp_condition() helper function to simplify some expressions

2 years agoconfigure: Add check_cmd() helper function to simplify some expressions
Diego Biurrun [Sun, 24 Sep 2017 16:55:28 +0000 (18:55 +0200)]
configure: Add check_cmd() helper function to simplify some expressions

2 years agoconfigure: Use test_ prefix for helper functions that do not set variables
Diego Biurrun [Sun, 4 Feb 2018 19:21:57 +0000 (20:21 +0100)]
configure: Use test_ prefix for helper functions that do not set variables

2 years agoconfigure: Drop unnecessary variables, shifts, and quotes in helper functions
Diego Biurrun [Fri, 20 Oct 2017 23:27:23 +0000 (01:27 +0200)]
configure: Drop unnecessary variables, shifts, and quotes in helper functions

2 years agoconfigure: Fix logic of AMF external library check
Diego Biurrun [Wed, 7 Mar 2018 12:27:39 +0000 (13:27 +0100)]
configure: Fix logic of AMF external library check

Fail if AMF is requested but unavailable, as we do for all
other external libraries that need to be explicitly enabled.

2 years agoexamples: Use new API for transcoding example
Andreas Unterweger [Tue, 27 Feb 2018 16:48:03 +0000 (17:48 +0100)]
examples: Use new API for transcoding example

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2 years agohls: Add a discontinuity marker on recover
Luca Barbato [Fri, 16 Feb 2018 15:09:25 +0000 (16:09 +0100)]
hls: Add a discontinuity marker on recover

It seems to improve the compatibility with the js demuxers.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2 years agoqsvenc: Provide a detailed error message if the parameters are invalid
Zhong Li [Fri, 2 Mar 2018 03:26:27 +0000 (11:26 +0800)]
qsvenc: Provide a detailed error message if the parameters are invalid

Currently it always shows "Selected ratecontrol mode is not supported
by the QSV runtime. Choose a different mode", but sometimes it is not
accurate.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2 years agofate: Error out more gracefully on configure failure
Diego Biurrun [Thu, 15 Feb 2018 12:26:20 +0000 (13:26 +0100)]
fate: Error out more gracefully on configure failure

If configure fails before config.fate is generated, the report file misses
some values and gets discarded by the FATE server. In these cases, print
those values as "failed" along with the failing configure command line.

2 years agohvcc: zero initialize the nal buffers past the last written byte
James Almer [Fri, 23 Feb 2018 03:09:38 +0000 (00:09 -0300)]
hvcc: zero initialize the nal buffers past the last written byte

Bug-Id: 1116
Cc: libav-stable@libav.org
Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoqsv: Default PicStruct to progressive
Ruiling Song [Mon, 12 Feb 2018 08:37:16 +0000 (16:37 +0800)]
qsv: Default PicStruct to progressive

The PicStruct is required by MediaSDK, so give a default value.
hwupload does not work without this.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2 years agoh264_metadata: Add option to delete filler data
Mark Thompson [Mon, 11 Dec 2017 00:30:54 +0000 (00:30 +0000)]
h264_metadata: Add option to delete filler data

Deletes both filler NAL units and filler SEI messages.  (Annex B zero_bytes
between NAL units are already discarded by the read/write process.)

2 years agocbs_h264: Add support for filler NAL units
Mark Thompson [Sun, 11 Feb 2018 17:33:15 +0000 (17:33 +0000)]
cbs_h264: Add support for filler NAL units

2 years agocbs_h264: Move slice_group_id array out of PPS structure
Mark Thompson [Sun, 11 Feb 2018 00:57:46 +0000 (00:57 +0000)]
cbs_h264: Move slice_group_id array out of PPS structure

It's very large, and is only used in some FMO streams.

2 years agoh264_metadata: Always add the SEI user data to the first access unit
Mark Thompson [Sun, 11 Feb 2018 15:41:07 +0000 (15:41 +0000)]
h264_metadata: Always add the SEI user data to the first access unit

This should be added even if the first access unit does not contain
parameter sets.

2 years agoh264_metadata: Use common SEI addition function
Mark Thompson [Sun, 11 Feb 2018 15:38:02 +0000 (15:38 +0000)]
h264_metadata: Use common SEI addition function

2 years agocbs_h264: Add utility functions to insert/delete SEI messages
Mark Thompson [Sun, 11 Feb 2018 15:37:34 +0000 (15:37 +0000)]
cbs_h264: Add utility functions to insert/delete SEI messages

2 years agocbs: Refcount all the things!
Mark Thompson [Sun, 11 Feb 2018 00:51:33 +0000 (00:51 +0000)]
cbs: Refcount all the things!

This makes it easier for users of the CBS API to get alloc/free right -
all subelements use the buffer API so that it's clear how to free them.
It also allows eliding some redundant copies: the packet -> fragment copy
disappears after this change if the input packet is refcounted, and more
codec-specific cases are now possible (but not included in this patch).

2 years agocbs_h264: Add hack for pic_timing with no active SPS
Mark Thompson [Mon, 11 Dec 2017 00:22:42 +0000 (00:22 +0000)]
cbs_h264: Add hack for pic_timing with no active SPS

If there is exactly one possible SPS but it is not yet active then just
assume that it should be the active one.

2 years agocbs_h2645: Remove active ps references when it is replaced
Mark Thompson [Mon, 11 Dec 2017 00:38:57 +0000 (00:38 +0000)]
cbs_h2645: Remove active ps references when it is replaced

2 years agocbs: Demote the "decomposition unimplemented" warning
Mark Thompson [Mon, 11 Dec 2017 00:28:40 +0000 (00:28 +0000)]
cbs: Demote the "decomposition unimplemented" warning

This is harmless and should not be a warning - unknown units are passed
through to the write functions unchanged, and no other code will interact
with them.