libav.git
4 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.

4 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

4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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()

4 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>
4 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>
4 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>
4 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()

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

4 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

4 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.

4 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

4 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

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

5 months 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>
5 months 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

5 months 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.

5 months 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>
5 months 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

5 months 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

5 months 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

5 months 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

5 months 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

5 months 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

5 months 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

5 months 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.

5 months 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>
5 months 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>
5 months 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>
5 months 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.

5 months 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>
5 months 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>
5 months 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.)

5 months 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

5 months 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.

5 months 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.

5 months 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

5 months 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

5 months 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).

5 months 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.

5 months 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

5 months 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.

5 months agovaapi_h265: Mark unused entries in RefPicList[01] as explicitly invalid
Mark Thompson [Sun, 17 Dec 2017 19:50:29 +0000 (19:50 +0000)]
vaapi_h265: Mark unused entries in RefPicList[01] as explicitly invalid

The iHD driver looks at entries beyond num_ref_idx_l[01]_active_minus1
for unknown reasons.

5 months agovaapi_encode: Destroy output buffer pool before VA context
Mark Thompson [Sun, 17 Dec 2017 19:48:35 +0000 (19:48 +0000)]
vaapi_encode: Destroy output buffer pool before VA context

The buffers are created associated with the context, so they should be
destroyed before the context is.  This is enforced by the iHD driver.

5 months agovaapi_encode: Allocate slice structures and parameter buffers dynamically
Jun Zhao [Thu, 24 Aug 2017 01:13:01 +0000 (09:13 +0800)]
vaapi_encode: Allocate slice structures and parameter buffers dynamically

This removes the arbitrary limit on the allowed number of slices and
parameter buffers.

From ffmpeg commit e4a6eb70f471eda36592078e8fa1bad87fc9df73.

Signed-off-by: Mark Thompson <sw@jkqxz.net>
5 months agocbs: Minor comment fixes / cosmetics
Mark Thompson [Thu, 9 Nov 2017 01:04:15 +0000 (01:04 +0000)]
cbs: Minor comment fixes / cosmetics

5 months agocbs: Add an explicit type for coded bitstream unit types
Mark Thompson [Thu, 9 Nov 2017 01:04:02 +0000 (01:04 +0000)]
cbs: Add an explicit type for coded bitstream unit types

Also fix conversion specifiers used for the unit type.

5 months agocbs: Allocate the context inside the init function
Mark Thompson [Thu, 9 Nov 2017 01:03:57 +0000 (01:03 +0000)]
cbs: Allocate the context inside the init function

... instead of making callers allocate it themselves.  This is more
consistent with other APIs in libav.

5 months agoconfigure: Pass the right machine types to dlltool for arm and arm64 mingw
Martin Storsjö [Fri, 16 Feb 2018 22:17:21 +0000 (00:17 +0200)]
configure: Pass the right machine types to dlltool for arm and arm64 mingw

These are supported by llvm-dlltool.

Signed-off-by: Martin Storsjö <martin@martin.st>
5 months agoRevert "configure: Stop using dlltool to create an import library"
Martin Storsjö [Fri, 16 Feb 2018 22:08:45 +0000 (00:08 +0200)]
Revert "configure: Stop using dlltool to create an import library"

This reverts commit 67c72f08a4707c18a67a4734660e3a23cc9488b6.

While the linker produced import libraries might work with MSVC in
simple test cases, they don't if e.g. linking to multiple GNU ld
produced import libraries at the same time. (They end up importing
functions from the wrong libraries.) The ones produced by dlltool
work fine though.

This issue was pointed out by Hendrik Leppkes.

Signed-off-by: Martin Storsjö <martin@martin.st>
6 months agobuild: Ignore generated mpeg12framerate test binary
Diego Biurrun [Fri, 9 Feb 2018 17:48:27 +0000 (17:48 +0000)]
build: Ignore generated mpeg12framerate test binary

6 months agoavcodec/vc1dec: fix mby_start for interlaced content
Michael Niedermayer [Sat, 14 Dec 2013 16:11:21 +0000 (17:11 +0100)]
avcodec/vc1dec: fix mby_start for interlaced content

Bug-Id: 1100
Bug-Id: ffmpeg/Ticket2531
Cc: libav-stable@libav.org
6 months agolavc/qsv: default la_ds to MFX_LOOKAHEAD_DS_UNKNOWN
Ruiling Song [Sun, 11 Feb 2018 07:43:45 +0000 (15:43 +0800)]
lavc/qsv: default la_ds to MFX_LOOKAHEAD_DS_UNKNOWN

MFX_LOOKAHEAD_DS_UNKNOWN means auto.
-1 is not a valid value.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
6 months agoqsvenc: AVBR is not supported on non-windows OS
Zhong Li [Tue, 30 Jan 2018 10:07:23 +0000 (18:07 +0800)]
qsvenc: AVBR is not supported on non-windows OS

AVBR is supported from API 1.3 but only available for Windows

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
6 months agohwcontext: Perform usual uninitialisation on derived frames contexts
Mark Thompson [Mon, 26 Jun 2017 19:28:07 +0000 (20:28 +0100)]
hwcontext: Perform usual uninitialisation on derived frames contexts

6 months agohwcontext: Perform usual initialisation on derived device contexts
Mark Thompson [Sun, 8 Oct 2017 14:19:17 +0000 (15:19 +0100)]
hwcontext: Perform usual initialisation on derived device contexts

The initialisation should be common.  For libmfx, it was previously
happening in the derivation function and this moves it out.

6 months agovf_hwupload/hwmap: Support setting a fixed pool size
Mark Thompson [Sat, 5 Aug 2017 21:10:46 +0000 (22:10 +0100)]
vf_hwupload/hwmap: Support setting a fixed pool size

These filters do not directly know whether the API they are using will
support dynamic frame pools, so this is somewhat tricky.  If the user
sets extra_hw_frames, we assume that they are aware of the problem and
set a fixed size based on that.  If not, most cases use dynamic sizing
just like they did previously.  The hardware-reverse-mapping case for
hwmap previously had a large fixed size (64) here, primarily as a hack
for QSV use - this is removed and extra_hw_frames will need to be set
for QSV to work since it requires fixed-size pools (as the other cases
do, and which didn't work before).

6 months agovf_scale_qsv: Support increasing hardware frame pool size
Mark Thompson [Mon, 27 Mar 2017 20:10:23 +0000 (21:10 +0100)]
vf_scale_qsv: Support increasing hardware frame pool size

The deinterlacer does not change, because it does not allocate any new
frames (for output it uses the same pool as the input).

6 months agovf_*_vaapi: Support increasing hardware frame pool size
Mark Thompson [Mon, 27 Mar 2017 20:10:10 +0000 (21:10 +0100)]
vf_*_vaapi: Support increasing hardware frame pool size

Defaults to 10 frames to preserve compatibility, but can allocate
fewer if extra_hw_frames is set explicitly.

6 months agolavfi: Add support for increasing hardware frame pool sizes
Mark Thompson [Mon, 27 Mar 2017 20:10:53 +0000 (21:10 +0100)]
lavfi: Add support for increasing hardware frame pool sizes

AVFilterContext.extra_hw_frames functions identically to the field of
the same name in AVCodecContext.

6 months agolavc: Add per-thread surfaces in get_hw_frame_parameters()
Mark Thompson [Mon, 29 Jan 2018 22:55:11 +0000 (22:55 +0000)]
lavc: Add per-thread surfaces in get_hw_frame_parameters()

This number is definitely required when frame threading is enabled, so
add it here rather than forcing all users to handle it themselves.

DXVA2 contained this addition in specific code as well (therefore being
added twice in the internal case) - just remove it from there.

6 months agolavc: Add support for increasing hardware frame pool sizes
Mark Thompson [Mon, 29 Jan 2018 22:18:00 +0000 (22:18 +0000)]
lavc: Add support for increasing hardware frame pool sizes

AVCodecContext.extra_hw_frames is added to the size of hardware frame
pools created by libavcodec for APIs which require fixed-size pools.
This allows the user to keep references to a greater number of frames
after decode, which may be necessary for some use-cases.

It is also added to the initial_pool_size value returned by
avcodec_get_hw_frames_parameters() if a fixed-size pool is required.

6 months agoconfigure: Factorize check_64_bit()
Diego Biurrun [Fri, 20 Oct 2017 02:42:13 +0000 (04:42 +0200)]
configure: Factorize check_64_bit()

6 months agoconfigure: Simplify restrict keyword handling
Diego Biurrun [Fri, 10 Nov 2017 14:40:30 +0000 (15:40 +0100)]
configure: Simplify restrict keyword handling

Skip a variable indirection and only redefine restrict if necessary.

6 months agoDrop some unnecessary config.h #includes
Diego Biurrun [Fri, 3 Nov 2017 16:20:49 +0000 (17:20 +0100)]
Drop some unnecessary config.h #includes

6 months agoconfigure: Group code that sets the license string with licensing checks
Diego Biurrun [Mon, 5 Feb 2018 12:53:49 +0000 (13:53 +0100)]
configure: Group code that sets the license string with licensing checks

This also moves the setting of the licensing string out of a block that
is skipped when quiet operation is requested.

6 months agohwcontext: Fix memory leak on derived frame allocation failure
Mark Thompson [Fri, 26 Jan 2018 23:12:18 +0000 (23:12 +0000)]
hwcontext: Fix memory leak on derived frame allocation failure

6 months agohwcontext: Fix documentation for av_hwdevice_ctx_alloc()
Jun Zhao [Sun, 19 Mar 2017 07:44:46 +0000 (15:44 +0800)]
hwcontext: Fix documentation for av_hwdevice_ctx_alloc()

From ffmpeg commit 9365dfcbf665b83b2e60c5ec5e2abf1f0a49e2c3.

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
6 months agoavpacket: Initialize the allocated padding area in side data
Martin Storsjö [Thu, 1 Feb 2018 12:56:49 +0000 (14:56 +0200)]
avpacket: Initialize the allocated padding area in side data

This makes sure that consumers of the side data actually can
rely on the padding as intended, without having the callers of
av_packet_new_side_data to explicitly zero initialize it.

Signed-off-by: Martin Storsjö <martin@martin.st>
6 months agovc1: skip motion compensation when data for last picture is invalid
Sean McGovern [Sun, 28 Jan 2018 02:19:30 +0000 (21:19 -0500)]
vc1: skip motion compensation when data for last picture is invalid

Bug-Id: 1101
Cc: libav-stable@libav.org
6 months agoqsvdec: Relax the surface vs coded dimension check
Zhong Li [Thu, 25 Jan 2018 10:19:12 +0000 (18:19 +0800)]
qsvdec: Relax the surface vs coded dimension check

Fix a common vp8 decoding failure.

Many vp8 clips cannot decode if hw_frames_ctx is enabled, reporting
"Error during QSV decoding.: incompatible video parameters (-14)".

It is due to mfx.FrameInfo.Width/Height not matching coded_w/coded_h.

See: avconv -hwaccel qsv -init_hw_device qsv -c:v vp8_qsv -i vp8-test-vectors-r1/vp80-00-comprehensive-001.ivf
-vf "hwdownload,format=nv12" -pix_fmt yuv420p -f md5 -

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
6 months agoqsv: Skip the packet if decoding failure
Ruiling, Song [Wed, 24 Jan 2018 02:14:51 +0000 (10:14 +0800)]
qsv: Skip the packet if decoding failure

MediaSDK may fail to decode some frame, just skip it.
Otherwise, it will keep decoding the failure packet repeatedly
without processing any packet afterwards.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
6 months agortmp: Plug leak if sending bytes read report fails.
Josh Allmann [Wed, 24 Jan 2018 00:47:12 +0000 (16:47 -0800)]
rtmp: Plug leak if sending bytes read report fails.

Signed-off-by: Martin Storsjö <martin@martin.st>
6 months agointreadwrite: Use __unaligned in MSVC for ARM64 as well
Martin Storsjö [Tue, 16 Jan 2018 13:40:24 +0000 (15:40 +0200)]
intreadwrite: Use __unaligned in MSVC for ARM64 as well

This attribute is supported for this architecture in MSVC as well
(but produces errors if used for 32 bit x86).

Signed-off-by: Martin Storsjö <martin@martin.st>
7 months agoqsv: better to use alignment by 16 and HEVC 10b requires alignment by 32
Maxym Dmytrychenko [Mon, 8 Jan 2018 14:10:23 +0000 (15:10 +0100)]
qsv: better to use alignment by 16 and HEVC 10b requires alignment by 32

7 months agoAdd support for H.264 and HEVC hardware encoding for AMD GPUs based on AMF SDK
Michael Wootton [Wed, 3 Jan 2018 17:55:53 +0000 (12:55 -0500)]
Add support for H.264 and HEVC hardware encoding for AMD GPUs based on AMF SDK

Requires AMF headers for at least version 1.4.4.1.

Signed-off-by: Mikhail Mironov <mikhail.mironov@amd.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
7 months agocmdutils: update copyright year to 2018
Sean McGovern [Mon, 1 Jan 2018 07:51:51 +0000 (02:51 -0500)]
cmdutils: update copyright year to 2018

7 months agoexamples/qsvdec: do not set the deprecated field refcounted_frames
Zhong Li [Thu, 28 Dec 2017 09:38:33 +0000 (17:38 +0800)]
examples/qsvdec: do not set the deprecated field refcounted_frames

It is used by the deprecated API avcodec_decode_video2 and ignored by the
new decode APIs (avcodec_send_packet/avcodec_receive_frame).

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
7 months agolavu/qsv: add log message for libmfx version
Zhong Li [Thu, 28 Dec 2017 09:38:32 +0000 (17:38 +0800)]
lavu/qsv: add log message for libmfx version

It is benefit to diagnose issues related to different libmfx version.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
7 months agox264: Support version 153
Luca Barbato [Tue, 26 Dec 2017 11:32:42 +0000 (12:32 +0100)]
x264: Support version 153

It has native simultaneus 8 and 10 bit support.

7 months agommaldec: Fix compilation after 2fcb0090
Martin Storsjö [Wed, 20 Dec 2017 07:45:14 +0000 (09:45 +0200)]
mmaldec: Fix compilation after 2fcb0090

Signed-off-by: Martin Storsjö <martin@martin.st>
7 months agoavconv: Use codec hardware config to configure hwaccels
Mark Thompson [Wed, 25 Oct 2017 23:18:47 +0000 (00:18 +0100)]
avconv: Use codec hardware config to configure hwaccels

Removes specific support for all hwaccels supported by the generic code
(CUVID, DXVA2, D3D11VA, VAAPI and VDPAU).

7 months agolavc: Mark all AVHWAccel structures as const
Mark Thompson [Sat, 4 Nov 2017 18:53:26 +0000 (18:53 +0000)]
lavc: Mark all AVHWAccel structures as const

7 months agolavc: Delete all fake hwaccels
Mark Thompson [Wed, 25 Oct 2017 23:18:46 +0000 (00:18 +0100)]
lavc: Delete all fake hwaccels

They are now unused.

7 months agolavc: Remove register mechanism for hwaccels
Mark Thompson [Wed, 25 Oct 2017 23:18:45 +0000 (00:18 +0100)]
lavc: Remove register mechanism for hwaccels

There is no longer any need for a list of them at runtime, because
decoders now carry the pointers to their associated hwaccels internally.
The file containing external declarations is now used to make the list
of hwaccels for configure.

7 months agolavc: Deprecate av_hwaccel_next() and av_register_hwaccel()
Mark Thompson [Wed, 25 Oct 2017 23:18:44 +0000 (00:18 +0100)]
lavc: Deprecate av_hwaccel_next() and av_register_hwaccel()

7 months agolavc: Use hardware config information in ff_get_format()
Mark Thompson [Wed, 25 Oct 2017 23:18:43 +0000 (00:18 +0100)]
lavc: Use hardware config information in ff_get_format()

This removes the dependency that hardware pixel formats previously had on
AVHWAccel instances, meaning only those which actually do something need
exist after this patch.

Also updates avcodec_default_get_format() to be able to choose hardware
formats if either a matching device has been supplied or no additional
external configuration is required, and avcodec_get_hw_frames_parameters()
to use the hardware config rather than searching the old hwaccel list.