Commit Graph

44892 Commits

Author SHA1 Message Date
Mark Thompson 3cae7f8b9b cbs: Add some read/write tests
Use the appropriate metadata filter for each codec - in the absence of any
options to modify the stream, the output bitstream should be identical to
the input (though the output file may differ in padding).

All tests use conformance bitstreams, the MPEG-2 streams are newly added
from the conformance test streams
<http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_IEC_13818-4_2004_Conformance_Testing/Video/>
2017-09-26 23:33:36 +01:00
Jacek Jendrzej 9b1c091114 http: Reset compressed header flag when starting to read a request
This fixes redirects, where the original redirect response indicated
support for compression, while the actual redirected content didn't.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-09-26 13:36:21 +03:00
Mark Thompson 9ed18f302b cbs_h264: Fix writing streams with auxiliary pictures
Tested with the alphaconformanceG sample.
2017-09-25 20:42:42 +01:00
Michael Niedermayer ec683ed527 smacker: fix integer overflow with pts_inc
Bug-Id: 1073

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Sean McGovern <gseanmcg@gmail.com>
2017-09-24 12:58:42 +02:00
Sean McGovern 9e36102278 smacker: return meaningful error codes on failure 2017-09-24 12:57:54 +02:00
Vittorio Giovara 2b50847e0f pixdesc: Add API to map color property names to enum values
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-09-21 13:23:21 +02:00
Huang, Zhengxu a5a6ac1a12 libavfilter/overlay_qsv: Add QSV overlay vpp filter
The filter supports two inputs and (implicitly) scaling the second input
during composition, unlike the software overlay.

The code has been separated into common interface and qsv overlay
implementation. The common part mainly creates the qsv session and
manages the surface which is nearly the same for all qsv filters.
So the qsvvpp.c/qsvvpp.h API can be used by other QSV vpp filters
to reduce code redundancy.

Usage:
 -hwaccel qsv -c:v mpeg2_qsv -r 25 -i in.m2v -hwaccel qsv -c:v h264_qsv
 -i in.h264 -filter_complex
 "overlay_qsv=eof_action=repeat:x=(W-w)/2:y=(H-h)/2"  -b 2M -maxrate 3M
 -c:v h264_qsv -y out.h264

Two inputs should have different sizes otherwise one will be completely
covered or you need to scale the second input as follows:
  -hwaccel qsv -c:v mpeg2_qsv -r 25 -i in.m2v -hwaccel qsv -c:v h264_qsv
  -i in.h264 -filter_complex
  "overlay_qsv=w=720:h=576:x=(W-w)/2:y=(H-h)/2" -b 2M -maxrate 3M -c:v
  h264_qsv -y out.h264

  Signed-off-by: ChaoX A Liu <chaox.a.liu@gmail.com>
  Signed-off-by: Zhengxu Huang <zhengxu.maxwell@gmail.com>
  Signed-off-by: Andrew Zhang <huazh407@gmail.com>
  Change-Id: I5c381febb0af6e2f9622c54ba00490ab99d48297
  Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
2017-09-17 19:59:06 +02:00
Huang, Zhengxu 8d3666c425 libavfilter/vf_vpp: Add common filters of the qsv vpp
Add common filters of the qsv vpp features including scale,denosie,
deinterlace,frc,crop and procAmp.

Performance will be significantly reduced in the test if using cascade
mode just like qsv framerate + qsv scale + qsv deinterlace + qsv denoise in
separated way no matter in system or video memmory cases.
And the code is so redundant because so much the same just as session and
surface's creation and management.
So we add a common qsv filter.

Usage:
-hwaccel qsv -c:v h264_qsv -r 25 -i in -vf
vpp_qsv=w=iw/2:h=400:deinterlace=1:framerate=60:detail=50:denoise=50
-b 2M -maxrate 3M -c:v h264_qsv -y out.h264

Signed-off-by: ChaoX A Liu <chaox.a.liu@gmail.com>
Signed-off-by: Zhengxu Huang <zhengxu.maxwell@gmail.com>
Signed-off-by: Andrew Zhang <huazh407@gmail.com>
Change-Id: I130392ce722138c209ab658c5f03f0009b6e8024
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
2017-09-17 19:57:13 +02:00
James Almer ac6691ab99 avio: update avio_alloc_context() doxy
It must be freed using avio_context_free() starting with commit
99684f3ae7.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-09-14 09:53:31 +02:00
Mark Thompson 10eb496d9a vaapi_mpeg2: Convert to use coded bitstream infrastructure 2017-09-12 22:12:00 +01:00
Mark Thompson b5859e0b04 mpeg12: Move finding the best frame rate to common code
Previously in the mpeg2_metadata filter.  Also adds a test.
2017-09-12 22:11:56 +01:00
Mark Thompson a41b69b5eb cbs_mpeg2: Add support for picture display extension 2017-09-12 22:11:56 +01:00
Mark Thompson 067a9ddeb8 cbs_h265: Fix ranges of prediction weight offsets
The bracketing was wrong - '-' binds before '<<'.  This would
previously incorrectly reject the streams in the WP_A and WP_B
conformance tests.
2017-09-12 22:11:55 +01:00
Mark Thompson f763489364 cbs_h265: Fix reading of unknown parameter set extension data 2017-09-12 22:11:55 +01:00
Mark Thompson 30645174e3 vaapi_h264: Fix CPB/DPB delays
This should be ticks, not time_scale steps - it was wrong for all
framerates not a multiple of 1/2.
2017-09-12 22:11:55 +01:00
Mark Thompson f940c859c2 Revert "vaapi_h265: Reduce the amount of padding in the stream"
This reverts commit a14a12ca13.

The CTU size is always 32x32; the surface size is what actually sets
the desired property, and it is already correct.
2017-09-12 22:11:52 +01:00
Mark Thompson c42b62d1f9 h264_metadata: Fix double-free
Whether the udu string should be freed depends on whether the SEI it
gets added to was created internally by cbs or externally by the bsf.
The current code frees it twice in the former case.
2017-09-12 22:11:50 +01:00
Mark Thompson e7f64191b2 cbs: Add buffer padding when splitting fragments
Remove any trailing zeroes from H.26[45] NAL units at the same time.
2017-09-12 22:11:47 +01:00
Mark Thompson 44cde38c8a cbs: Always check for bitstream end before reading 2017-09-12 22:11:41 +01:00
Luca Barbato b05128f3c9 qsv: Load the hw hevc plugin by default on Linux
Only on Windows the software plugin is available.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-09-11 17:17:56 +02:00
Martin Storsjö f19fbfbdc6 aviocat: Check for output write errors
Signed-off-by: Martin Storsjö <martin@martin.st>
2017-09-04 09:42:52 +03:00
Martin Storsjö 585dc1aece flvdec: Check the avio_seek return value after reading a metadata packet
If the metadata packet is corrupted, flv_read_metabody can accidentally
read past the start of the next packet. If the start of the next packet
had been flushed out of the IO buffer, we would be unable to seek to
the right position (on a nonseekable stream).

Prefer to clearly error out instead of silently trying to read from a
desynced stream which will only be interpreted as garbage.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-09-04 09:42:51 +03:00
Martin Storsjö e12f1cd616 Revert "checkasm: Test more h264 idct variants"
This reverts commit 547db1eaec.

This commit wasn't supposed to be pushed (yet) since it hasn't
been reviewed.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-09-02 22:23:30 +03:00
Martin Storsjö 9dde6ab06c arm: Fix SIGBUS on ARM when compiled with binutils 2.29
In binutils 2.29, the behavior of the ADR instruction changed so that 1 is
added to the address of a Thumb function (previously nothing was added). This
allows the loaded address to be passed to a BLX instruction and the correct
mode change will occur.

See: https://sourceware.org/bugzilla/show_bug.cgi?id=21458

By using adr with a label that isn't annotated as a thumb function,
we avoid the new behaviour in binutils 2.29 and get the same behaviour
as in prior releases, and as in other assemblers (ms armasm.exe,
clang's built in assembler) - an idea that Janne Grunau came up with.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-09-02 22:18:20 +03:00
Martin Storsjö 547db1eaec checkasm: Test more h264 idct variants 2017-08-31 14:55:34 +03:00
Martin Storsjö 39e16ee228 Revert "fate: Skip the checkasm test if CONFIG_STATIC is disabled"
When we use dllexport properly for shared libraries on windows,
there's no longer any issue with linking the object files for
e.g. libavcodec statically into checkasm. (It's still not possible
to link the built object files for e.g. libavformat statically to
libavcodec though, since libavformat exepcts to load av_export_*
symbols from a DLL.)

This reverts commit 4e62b57ee0.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-08-31 14:22:47 +03:00
Martin Storsjö accb06120c configure: Use dllexport/dllimport for data symbols across DLLs with mingw
This avoids having to use pseudo relocations.

The version script used for exporting functions is skipped as soon
as the set of object files contains symbols marked with dllexport,
therefore we need to use makedef to produce the full list of symbols
to be exported.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-08-31 14:22:22 +03:00
Martin Storsjö 1a7bf48eed makedef: Extend the script for use with mingw tools as well
This is invoked by setting the NM and AR variables to the names of
those specific tools. The ARCH variable also needs to be provided,
to choose the symbol prefix (nm doesn't provide any option that
dumps the architecture easily).

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-08-31 14:22:18 +03:00
Martin Storsjö 44aa9105c5 makedef: Fold as much text transformations as possible into the initial dump
This avoids redoing them for each expression in the list.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-08-31 14:22:15 +03:00
Martin Storsjö abf1c058d1 msvc: Properly specify dllexport for data symbols shared across dll boundaries
We currently only have exported data symbols within libavcodec, but
the concept is easy to extend to other libraries if necessary.
The attribute declaration needs to be in a private header though,
since we can't use CONFIG_SHARED in public installed headers.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-08-31 14:22:06 +03:00
Martin Storsjö e41daa6246 Remove support for building for mingw32ce (Windows CE)
The toolchain for this target is unmaintained since many years.

While it has been continuously build tested on fate, it hasn't
actually been tested at runtime since many, many years (and back
then, only a few codecs in libavcodec were tested).

So far, keeping support for it has been mostly effortless, but
the compiler does seem to have issues with dllimported data symbols,
ending up as internal compiler errors in some cases. Instead of
jumping through further hoops to work around that, just remove the
target.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-08-31 14:21:08 +03:00
wm4 173b56218f lavf: make avio_read_partial() public
Main use-case is proxying avio through a foreign I/O layer and a custom
AVIO context, without losing latency and performance characteristics.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-08-30 14:29:14 +02:00
Derek Buitenhuis 5e3f6dc701 swscale: Do not expand a macro with 'defined' in it
Fixes:

    libswscale/utils.c:1632:5: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
    #if USE_MMAP
        ^
    libswscale/utils.c:1577:49: note: expanded from macro 'USE_MMAP'
    #define USE_MMAP (HAVE_MMAP && HAVE_MPROTECT && defined MAP_ANONYMOUS)
                                                    ^
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-08-28 10:26:14 +02:00
Martin Storsjö 29ba1e6076 configure: Include d3d11va_extralibs in libavutil
This fixes shared WinRT/UWP builds with d3d11va enabled.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-08-25 09:22:42 +03:00
Michael Niedermayer feed239021 yadif: Account for the buffer alignment while processing the frame edges
Avoid out of bound reads.

Bug-Id: 1031
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-08-22 22:31:19 +02:00
Martin Storsjö 7b7760ad6e aarch64: Fix negative movrel offsets for windows
On windows, the offset for the relocation doesn't get stored in
the relocation itself, but as an unsigned immediate in the opcode.
Therefore, negative offsets has to be handled via a separate sub
instruction, just as on MachO.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-08-22 13:41:08 +03:00
Luca Barbato 0c99b900d8 png: Support RGBA64 pixel format 2017-08-21 09:23:44 +02:00
Luca Barbato 9f5b77c16f png: Report more details regarding unsupported pixel formats 2017-08-21 09:23:44 +02:00
Mark Thompson 4c0588b456 mpeg2enc: Don't mark all streams as component video
Since there is no information about the source format, "unspecified"
is the correct value to write here.

All tests using the MPEG-2 encoder are updated, as this changes the
header on all outputs.
2017-08-20 15:14:37 +01:00
Mark Thompson b78c30d7ec lavc: Add mpeg2_metadata bitstream filter 2017-08-20 15:14:33 +01:00
Mark Thompson 2bc9ba8d3c lavc: Add coded bitstream read/write support for MPEG-2
Also enable MPEG-2 support in the trace_headers filter.
2017-08-20 13:59:17 +01:00
Mark Thompson 768eb9182e cbs_h2645: Return error if writing fails 2017-08-20 13:59:17 +01:00
Anton Khirnov f70f71d60c h264dec: use a large enough field for reference list modification values
pic_num can be at most 17-bit, so uint8_t is not sufficient.

Found-By: Bradley Sepos <bradley@bradleysepos.com>
CC: libav-stable@libav.org
2017-08-18 14:55:31 +02:00
Piotr Bandurski a05c6e8c11 xwddec: support 8bpp grayscale
(cherry picked from commit b9c94e826e)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-08-13 19:58:40 +02:00
Diego Biurrun d34a133b78 dfa: Disallow odd width/height and add proper bounds check for DDS1 chunks
DDS1 chunks are decoded in 2x2 blocks, odd chunk width or height is not
allowed in that case. Also ensure that the decode buffer is big enough
for all blocks being processed.

Bug-Id: CVE-2017-9992
CC: libav-stable@libav.org
2017-08-13 19:58:40 +02:00
Mark Thompson a14a12ca13 vaapi_h265: Reduce the amount of padding in the stream
It is not necessary to pad to the CTU size.  The CB size of 8x8 should be
sufficient, but due to constraints in the Intel driver (the one usable
implementation of this) it has to be padded to 16x16 like in H.264.
2017-08-13 17:55:02 +01:00
Mark Thompson e3e8eab359 vaapi_h265: Add support for AUD NAL units
Matching the H.264 encoder.
2017-08-13 17:55:02 +01:00
Mark Thompson ac12486714 vaapi_h265: Convert to use coded bitstream infrastructure
Also improves the metadata and generally makes the configuration
a bit cleaner.
2017-08-13 17:55:02 +01:00
Mark Thompson a49ee60d5f vaapi_h264: Add support for SEI recovery points
Included by default with non-IDR intra frames.
2017-08-13 17:55:02 +01:00
Mark Thompson 820a4483af vaapi_h264: Add support for AUD NAL units
Adds a new private option to enable them (off by default).
2017-08-13 17:55:02 +01:00