ffmpeg.git
2 years agolibvmaf: exit gracefully if the library fails.
Ronald S. Bultje [Mon, 18 Dec 2017 12:59:39 +0000 (07:59 -0500)]
libvmaf: exit gracefully if the library fails.

Fixes trac issue #6884 and Netflix/vmaf issue #124.

2 years agoaptx: add codec cap SMALL_LAST_FRAME and INIT_THREADSAFE as appropriate
Aurelien Jacobs [Sun, 17 Dec 2017 22:06:48 +0000 (23:06 +0100)]
aptx: add codec cap SMALL_LAST_FRAME and INIT_THREADSAFE as appropriate

2 years agoavfilter/af_biquads: add missing break statements
Paul B Mahol [Sun, 17 Dec 2017 18:23:37 +0000 (19:23 +0100)]
avfilter/af_biquads: add missing break statements

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2 years agolavu/lavc/lavf/lavfi: Do not use type modifier %zu on Windows MSVCRT.
Carl Eugen Hoyos [Sun, 17 Dec 2017 17:03:47 +0000 (18:03 +0100)]
lavu/lavc/lavf/lavfi: Do not use type modifier %zu on Windows MSVCRT.

2 years agoavfilter/af_biquads: remove unused enum item
Paul B Mahol [Sun, 17 Dec 2017 15:38:07 +0000 (16:38 +0100)]
avfilter/af_biquads: remove unused enum item

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2 years agoavfilter/av_biquads: add support for commands
Paul B Mahol [Sun, 17 Dec 2017 15:37:12 +0000 (16:37 +0100)]
avfilter/av_biquads: add support for commands

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2 years agolibavformat: LibreSSL (libtls) support
sfan5 [Sat, 4 Nov 2017 14:45:16 +0000 (15:45 +0100)]
libavformat: LibreSSL (libtls) support

Signed-off-by: sfan5 <sfan5@live.de>
2 years agoavcodec/hevc_cabac: Fix integer overflow in ff_hevc_cu_qp_delta_abs()
Michael Niedermayer [Fri, 15 Dec 2017 17:17:13 +0000 (18:17 +0100)]
avcodec/hevc_cabac: Fix integer overflow in ff_hevc_cu_qp_delta_abs()

Fixes: signed integer overflow: 2147483647 + 1073741824 cannot be represented in type 'int'
Fixes: 4555/clusterfuzz-testcase-minimized-4505532481142784

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/hevc_sei: Fix integer overflows in decode_nal_sei_message()
Michael Niedermayer [Fri, 15 Dec 2017 16:50:12 +0000 (17:50 +0100)]
avcodec/hevc_sei: Fix integer overflows in decode_nal_sei_message()

Fixes: signed integer overflow: 2147483520 + 255 cannot be represented in type 'int'
Fixes: 4554/clusterfuzz-testcase-minimized-4843714515042304

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/hevcdsp_template: Fix undefined shift in put_hevc_qpel_bi_w_hv()
Michael Niedermayer [Fri, 15 Dec 2017 12:06:30 +0000 (13:06 +0100)]
avcodec/hevcdsp_template: Fix undefined shift in put_hevc_qpel_bi_w_hv()

Fixes: runtime error: left shift of negative value -3
Fixes: 4524/clusterfuzz-testcase-minimized-6055590120914944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavfilter/vf_overlay: add premultiplied alpha mode
Paul B Mahol [Tue, 1 Aug 2017 10:34:44 +0000 (12:34 +0200)]
avfilter/vf_overlay: add premultiplied alpha mode

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2 years agoconfigure: fix probing armv6zk
wang-bin [Fri, 15 Dec 2017 07:05:13 +0000 (15:05 +0800)]
configure: fix probing armv6zk

clang reports 6kz: https://reviews.llvm.org/D14568

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agolibavcodec/magicyuvenc : fix warning
Martin Vignali [Sat, 28 Oct 2017 21:15:23 +0000 (23:15 +0200)]
libavcodec/magicyuvenc : fix warning

2 years agolavc/mediacodec_wrapper: fix potential jni global reference leak
Matthieu Bouron [Fri, 15 Dec 2017 23:16:02 +0000 (00:16 +0100)]
lavc/mediacodec_wrapper: fix potential jni global reference leak

2 years agolavc/mediacodec_wrapper: factorize MediaCodec creation functions
Matthieu Bouron [Wed, 13 Dec 2017 12:49:58 +0000 (13:49 +0100)]
lavc/mediacodec_wrapper: factorize MediaCodec creation functions

2 years agolavc/mediacodec: use AVMediaCodecDeviceContext hw_device_ctx if set
Aman Gupta [Mon, 4 Dec 2017 01:32:22 +0000 (17:32 -0800)]
lavc/mediacodec: use AVMediaCodecDeviceContext hw_device_ctx if set

Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2 years agolavu/hwcontext: add AV_HWDEVICE_TYPE_MEDIACODEC
Aman Gupta [Mon, 4 Dec 2017 01:32:21 +0000 (17:32 -0800)]
lavu/hwcontext: add AV_HWDEVICE_TYPE_MEDIACODEC

Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2 years agodoc/libav-merge: remove line about VP9 superframe parsing
James Almer [Fri, 15 Dec 2017 17:38:55 +0000 (14:38 -0300)]
doc/libav-merge: remove line about VP9 superframe parsing

It was addressed in a5679933c1b8b6bef5c5c3eb7c70d06c695066cf,
0c162854c1fa2a1e43ce5588b67842675f45e3c7 and
5a366f9770dd7b02b0721b2857d6baa96acdb0af.

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agodoc/libav-merge: Remove VAAPI VP8 decode hwaccel merge note
Mark Thompson [Fri, 15 Dec 2017 16:53:13 +0000 (16:53 +0000)]
doc/libav-merge: Remove VAAPI VP8 decode hwaccel merge note

Done in 9f00fa536938130e3c7ad2640a61795770d419a1 and
40b75a943bcb6a4af00c44ef6e52cbfc3e6580d8.

2 years agolavc/vp8: Support resolution changes in the VP8 decoder hwaccel
Jun Zhao [Wed, 29 Nov 2017 23:53:53 +0000 (07:53 +0800)]
lavc/vp8: Support resolution changes in the VP8 decoder hwaccel

Use the following command to reproduce this issue:
make fate-vp8-size-change HWACCEL="vaapi -vaapi_device \
/dev/dri/renderD128 -hwaccel_output_format yuv420p"
SAMPLES=../fate-suite/.

At the same time, reconstruct the public logic as a function.

Signed-off-by: Yun Zhou <yunx.z.zhou@intel.com>
Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2 years agoavformat/hlsenc: Extend persistent http connections to playlists
Karthick J [Fri, 15 Dec 2017 14:11:12 +0000 (22:11 +0800)]
avformat/hlsenc: Extend persistent http connections to playlists

Before this patch persistent http connections would work only for media segments.
The playlists were still opening a new connection everytime.
This patch extends persistent http connections to playlists as well.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2 years agoavformat/hlsenc: Handle NULL input in IO open and close utility functions
Karthick J [Fri, 15 Dec 2017 14:08:31 +0000 (22:08 +0800)]
avformat/hlsenc: Handle NULL input in IO open and close utility functions

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2 years agoavformat/hlsenc: Call avio_flush during persistent http connections
Karthick J [Fri, 15 Dec 2017 13:24:08 +0000 (21:24 +0800)]
avformat/hlsenc: Call avio_flush during persistent http connections

Since close is not called, during http persistent connection,
flush needs to be called so that output is written on time.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2 years agoavfilter/x86/vf_interlace : avfilter/x86/vf_interlace : fix crash when using unaligne...
Martin Vignali [Thu, 14 Dec 2017 16:55:11 +0000 (17:55 +0100)]
avfilter/x86/vf_interlace : avfilter/x86/vf_interlace : fix crash when using unaligned data in low_pass complex

related to ticket 6491

2 years agoavfilter/x86/vf_interlace : avoid crash when data are unaligned
Martin Vignali [Thu, 14 Dec 2017 15:49:55 +0000 (16:49 +0100)]
avfilter/x86/vf_interlace : avoid crash when data are unaligned

ticket 6491

2 years agoavformat/movenc: Add support for more colorspaces
Steven Robertson [Thu, 14 Dec 2017 19:52:45 +0000 (11:52 -0800)]
avformat/movenc: Add support for more colorspaces

With FCPX 10.4, Apple has expanded the set of colorspace, primaries,
and trc flags officially supported in QuickTime files. The expanded set
matches the codepoints used in ffmpeg and many other specs.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/vp9: mark frame as finished on decode_tiles() failure
Michael Niedermayer [Thu, 14 Dec 2017 01:02:55 +0000 (02:02 +0100)]
avcodec/vp9: mark frame as finished on decode_tiles() failure

Fixes deadlock with framethreads
Fixes: Netflix_Aerial_1080p_60fps_8bit_420.y4m.vp9.noaltref.webm.ivf.s69372_r01-05_b6-.ivf
Fixes: Netflix_Aerial_1080p_60fps_10bit_420.y4m.vp9.noaltref.webm.ivf.s149104_r01-05_b6-.ivf
Fixes: ducks_take_off_444_720p50.y4m.vp9.webm.ivf.s107375_r01-05_b6-.ivf

Reported-by: James Zern <jzern@google.com>
Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavfilter/drawbox+drawgrid - add option to prevent overwriting of source pixels
Gyan Doshi [Mon, 11 Dec 2017 17:05:18 +0000 (22:35 +0530)]
avfilter/drawbox+drawgrid - add option to prevent overwriting of source pixels

If the user-supplied color in drawbox and drawgrid filters is non-opaque,
the box & grid painting overwrites the input's pixels (including alpha).
Users typically expect the alpha of the specified color to only act as a key
for compositing on top of the main input.

Added option allows users to select between replacement and composition.
Tested and documented.

2 years agoMerge commit '47687a2f8aca3f65b6fdd117b1cb66a7409a7fd1'
James Almer [Thu, 14 Dec 2017 22:10:12 +0000 (19:10 -0300)]
Merge commit '47687a2f8aca3f65b6fdd117b1cb66a7409a7fd1'

* commit '47687a2f8aca3f65b6fdd117b1cb66a7409a7fd1':
  avcodec: add metadata to identify wrappers and hardware decoders

This commit is a noop, see b945fed629a872d393f59d16fc5773574126ca88

Merged-by: James Almer <jamrial@gmail.com>
2 years agoMerge commit '508378556631dc18d32247b4a4e35703758e1ca9'
James Almer [Thu, 14 Dec 2017 22:04:37 +0000 (19:04 -0300)]
Merge commit '508378556631dc18d32247b4a4e35703758e1ca9'

* commit '508378556631dc18d32247b4a4e35703758e1ca9':
  qsv: Support explicit lookahead downscaling

Merged-by: James Almer <jamrial@gmail.com>
2 years agoMerge commit 'f2e9a0ecbef5027f9532c49ffcdfc11d199f6150'
James Almer [Thu, 14 Dec 2017 21:46:43 +0000 (18:46 -0300)]
Merge commit 'f2e9a0ecbef5027f9532c49ffcdfc11d199f6150'

* commit 'f2e9a0ecbef5027f9532c49ffcdfc11d199f6150':
  qsv/vp8dec: fixes memory leak issue

Merged-by: James Almer <jamrial@gmail.com>
2 years agoMerge commit '7c65a76b16bc3a44f1592acde2176f187a058797'
James Almer [Thu, 14 Dec 2017 21:46:10 +0000 (18:46 -0300)]
Merge commit '7c65a76b16bc3a44f1592acde2176f187a058797'

* commit '7c65a76b16bc3a44f1592acde2176f187a058797':
  lavc/qsvenc: add error messeage if ICQ unsupported.

Merged-by: James Almer <jamrial@gmail.com>
2 years agoMerge commit 'bddb2ce179c57db6e3c79fdc3363c165d90850b0'
James Almer [Thu, 14 Dec 2017 21:45:20 +0000 (18:45 -0300)]
Merge commit 'bddb2ce179c57db6e3c79fdc3363c165d90850b0'

* commit 'bddb2ce179c57db6e3c79fdc3363c165d90850b0':
  lavc/qsvenc: ICQ/VCM/QVBR are not avilable on Linux

Merged-by: James Almer <jamrial@gmail.com>
2 years agoMerge commit '6ff29343b01923e9b125fe7404ac8701cdfb1fe5'
James Almer [Thu, 14 Dec 2017 21:44:42 +0000 (18:44 -0300)]
Merge commit '6ff29343b01923e9b125fe7404ac8701cdfb1fe5'

* commit '6ff29343b01923e9b125fe7404ac8701cdfb1fe5':
  lavc/qsvenc: set HRD buffer size

Merged-by: James Almer <jamrial@gmail.com>
2 years agoMerge commit '18a0f420269ff4c730422361c5c4d8eea096e900'
James Almer [Thu, 14 Dec 2017 21:44:04 +0000 (18:44 -0300)]
Merge commit '18a0f420269ff4c730422361c5c4d8eea096e900'

* commit '18a0f420269ff4c730422361c5c4d8eea096e900':
  checkasm: Use LOCAL_ALIGNED for aligned variables on the stack

This commit is a noop, see
https://ffmpeg.org/pipermail/ffmpeg-devel/2015-December/184777.html

Merged-by: James Almer <jamrial@gmail.com>
2 years agoavcodec: add metadata to identify wrappers and hardware decoders
wm4 [Mon, 11 Dec 2017 15:18:44 +0000 (16:18 +0100)]
avcodec: add metadata to identify wrappers and hardware decoders

Explicitly identify decoder/encoder wrappers with a common name. This
saves API users from guessing by the name suffix. For example, they
don't have to guess that "h264_qsv" is the h264 QSV implementation, and
instead they can just check the AVCodec .codec and .wrapper_name fields.

Explicitly mark AVCodec entries that are hardware decoders or most
likely hardware decoders with new AV_CODEC_CAPs. The purpose is allowing
API users listing hardware decoders in a more generic way. The proposed
AVCodecHWConfig does not provide this information fully, because it's
concerned with decoder configuration, not information about the fact
whether the hardware is used or not.

AV_CODEC_CAP_HYBRID exists specifically for QSV, which can have software
implementations in case the hardware is not capable.

Based on a patch by Philip Langdale <philipl@overt.org>.

Merges Libav commit 47687a2f8aca3f65b6fdd117b1cb66a7409a7fd1.

2 years agoavcodec: add metadata to identify wrappers and hardware decoders
wm4 [Tue, 12 Dec 2017 10:03:43 +0000 (11:03 +0100)]
avcodec: add metadata to identify wrappers and hardware decoders

Explicitly identify decoder/encoder wrappers with a common name. This
saves API users from guessing by the name suffix. For example, they
don't have to guess that "h264_qsv" is the h264 QSV implementation, and
instead they can just check the AVCodec .codec and .wrapper_name fields.

Explicitly mark AVCodec entries that are hardware decoders or most
likely hardware decoders with new AV_CODEC_CAPs. The purpose is allowing
API users listing hardware decoders in a more generic way. The proposed
AVCodecHWConfig does not provide this information fully, because it's
concerned with decoder configuration, not information about the fact
whether the hardware is used or not.

AV_CODEC_CAP_HYBRID exists specifically for QSV, which can have software
implementations in case the hardware is not capable.

Based on a patch by Philip Langdale <philipl@overt.org>.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2 years agolavf/mpegts: mark packets with TEI flag as corrupted
Rodger Combs [Thu, 19 Oct 2017 06:58:10 +0000 (01:58 -0500)]
lavf/mpegts: mark packets with TEI flag as corrupted

2 years agolibavcodec/decode: remove duplicate includes
Michael Niedermayer [Wed, 13 Dec 2017 20:51:31 +0000 (21:51 +0100)]
libavcodec/decode: remove duplicate includes

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoivfenc: add AV1 support
Tristan Matthews [Sun, 10 Dec 2017 23:28:50 +0000 (18:28 -0500)]
ivfenc: add AV1 support

libaom tools work with ivf files.

2 years agopatcheck: Add 'threshhold' to common typo list
Kelly Ledford [Tue, 12 Dec 2017 19:31:24 +0000 (11:31 -0800)]
patcheck: Add 'threshhold' to common typo list

Signed-off-by: Kelly Ledford <kelly.ledford@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agolibavfilter/af_dcshift.c: Fixed repeated spelling error
Kelly Ledford [Tue, 12 Dec 2017 19:31:23 +0000 (11:31 -0800)]
libavfilter/af_dcshift.c: Fixed repeated spelling error

'threshhold' should be 'threshold'

Signed-off-by: Kelly Ledford <kelly.ledford@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agocheckasm/vf_hflip : add test for vf_hflip byte and short simd
Martin Vignali [Mon, 11 Dec 2017 10:26:44 +0000 (11:26 +0100)]
checkasm/vf_hflip : add test for vf_hflip byte and short simd

2 years agoavfilter/vf_hflip : move context func init in ff_hflip_init
Martin Vignali [Mon, 11 Dec 2017 10:22:56 +0000 (11:22 +0100)]
avfilter/vf_hflip : move context func init in ff_hflip_init

2 years agolibavcodec/mpegvideo_parser: improve detection of progressive mpeg2
Aman Gupta [Wed, 6 Dec 2017 22:54:12 +0000 (14:54 -0800)]
libavcodec/mpegvideo_parser: improve detection of progressive mpeg2

Previously many progressive mpeg2video samples were detected as interlaced
by ffmpeg/ffprobe. For example, https://tmm1.s3.amazonaws.com/720p.ts

Before:

    Input #0, mpegts, from 'https://tmm1.s3.amazonaws.com/720p.ts':
      Duration: 00:00:08.62, start: 18974.073233, bitrate: 9734 kb/s
      Program 2
     Stream #0:0[0x12eb]: Video: mpeg2video (Main), yuv420p(tv, bottom first), 1280x720 ...

After:

    Input #0, mpegts, from 'https://tmm1.s3.amazonaws.com/720p.ts':
      Duration: 00:00:08.62, start: 18974.073233, bitrate: 9734 kb/s
      Program 2
     Stream #0:0[0x12eb]: Video: mpeg2video (Main), yuv420p(tv, progressive), 1280x720 ...

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavfilter/formats: fix wrong function name in error message
Jun Zhao [Mon, 4 Dec 2017 04:50:34 +0000 (12:50 +0800)]
avfilter/formats: fix wrong function name in error message

Use perdefined micro __FUNCTION__ rather than hard coding function name
to fix wrong function name in error message.

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavformat/mux: factorize AVFormatContext->avoid_negative_ts initialization
James Almer [Mon, 11 Dec 2017 04:02:30 +0000 (01:02 -0300)]
avformat/mux: factorize AVFormatContext->avoid_negative_ts initialization

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavfilter/vf_pseudocolor: add support for more formats
Paul B Mahol [Tue, 12 Dec 2017 18:31:50 +0000 (19:31 +0100)]
avfilter/vf_pseudocolor: add support for more formats

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2 years agoqsv: Support explicit lookahead downscaling
Luca Barbato [Tue, 12 Dec 2017 14:27:52 +0000 (14:27 +0000)]
qsv: Support explicit lookahead downscaling

2 years agoqsv/vp8dec: fixes memory leak issue
Li, Zhong [Thu, 7 Dec 2017 07:26:38 +0000 (15:26 +0800)]
qsv/vp8dec: fixes memory leak issue

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
2 years agolavc/qsvenc: add error messeage if ICQ unsupported.
Li, Zhong [Thu, 7 Dec 2017 06:44:27 +0000 (14:44 +0800)]
lavc/qsvenc: add error messeage if ICQ unsupported.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
2 years agolavc/qsvenc: ICQ/VCM/QVBR are not avilable on Linux
Li, Zhong [Thu, 7 Dec 2017 06:44:26 +0000 (14:44 +0800)]
lavc/qsvenc: ICQ/VCM/QVBR are not avilable on Linux

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
2 years agolavc/qsvenc: set HRD buffer size
Li, Zhong [Fri, 1 Dec 2017 08:48:45 +0000 (16:48 +0800)]
lavc/qsvenc: set HRD buffer size

Hypothetical Reference Decoding (HRD) model assumes that data flows
into a buffer of the fixed size BufferSizeInKB with a constant bitrate.
Smaller BufferSizeInKB means smaller frame size variations,
but more difficult to maintain HRD.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
2 years agocheckasm: Use LOCAL_ALIGNED for aligned variables on the stack
Martin Storsjö [Mon, 11 Dec 2017 20:25:16 +0000 (22:25 +0200)]
checkasm: Use LOCAL_ALIGNED for aligned variables on the stack

This fixes fate-checkasm-hevc_mc on ARMCC 5.0 after adding
NEON HEVC MC assembly.

Signed-off-by: Martin Storsjö <martin@martin.st>
2 years agoavformat/hlsenc: reindent after previous commits
Steven Liu [Tue, 12 Dec 2017 03:50:23 +0000 (11:50 +0800)]
avformat/hlsenc: reindent after previous commits

2 years agodoc/filters: re-arrange options for testsrc family
Lou Logan [Mon, 11 Dec 2017 21:46:02 +0000 (12:46 -0900)]
doc/filters: re-arrange options for testsrc family

Additionally:
* Mention that allrgb and allyuv do not support the "size" option.
* Separate examples into subsection.

Fixes ticket #6906.

Signed-off-by: Lou Logan <lou@lrcd.com>
2 years agoavfilter/avfiltergraph: remove ugly dead code
Paul B Mahol [Mon, 11 Dec 2017 21:39:26 +0000 (22:39 +0100)]
avfilter/avfiltergraph: remove ugly dead code

Remnant of old merge.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2 years agoRevert "libavcodec/utils.c: simplify avcodec locking with atomics"
Hendrik Leppkes [Mon, 11 Dec 2017 19:59:56 +0000 (20:59 +0100)]
Revert "libavcodec/utils.c: simplify avcodec locking with atomics"

This reverts commit 590136e78da3d091ea99ab5432543d47a559a461.

Atomics are not required for this variable, because it is protected
through the lock manager, and the use of atomics here is not compatible
with the c11 emulation wrappersi.

Fixes FATE on MSVC, among other setups which use the compat wrappers.

2 years agoavcodec/libvpx: remove disabled code
James Almer [Mon, 11 Dec 2017 03:42:26 +0000 (00:42 -0300)]
avcodec/libvpx: remove disabled code

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavformat/hlsenc: move init operations from write_header to init
Steven Liu [Mon, 11 Dec 2017 03:03:25 +0000 (11:03 +0800)]
avformat/hlsenc: move init operations from write_header to init

Reviewed-by: Vishwanath Dixit <vdixit@akamai.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2 years agoh264dec: Remove mpeg4video.h header dependency
Kieran Kunhya [Sun, 10 Dec 2017 23:51:37 +0000 (23:51 +0000)]
h264dec: Remove mpeg4video.h header dependency

2 years agolibavcodec: Move ff_print_debug_info2 to mpegutils.c
Kieran Kunhya [Mon, 11 Dec 2017 00:04:44 +0000 (00:04 +0000)]
libavcodec: Move ff_print_debug_info2 to mpegutils.c

2 years agodoc/libav-merge: add a line about the skipped HEVC MC arm functions
James Almer [Mon, 11 Dec 2017 00:03:28 +0000 (21:03 -0300)]
doc/libav-merge: add a line about the skipped HEVC MC arm functions

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoMerge commit '7993ec19af394fdc58ec64165bc0b12619543a5d'
James Almer [Mon, 11 Dec 2017 00:02:45 +0000 (21:02 -0300)]
Merge commit '7993ec19af394fdc58ec64165bc0b12619543a5d'

* commit '7993ec19af394fdc58ec64165bc0b12619543a5d':
  hevc: Add hevc_get_pixel_4/8/12/16/24/32/48/64

This commit is a noop, see
https://ffmpeg.org/pipermail/ffmpeg-devel/2015-December/184777.html

Merged-by: James Almer <jamrial@gmail.com>
2 years agoMerge commit '3ff8fbbf5a7bc40c09db74d4952364997fd3c611'
James Almer [Sun, 10 Dec 2017 23:54:49 +0000 (20:54 -0300)]
Merge commit '3ff8fbbf5a7bc40c09db74d4952364997fd3c611'

* commit '3ff8fbbf5a7bc40c09db74d4952364997fd3c611':
  vaapi_h265: Add named options for setting profile and level
  vaapi_h264: Add named options for setting profile and level
  vaapi: Make the decode profile matching more explicit
  vaapi_h264: Fix VUI max_dec_frame_buffering
  vaapi_h265: Enable VBR mode

This commit is a noop, see
385cafb07ac1e46433931ea9749a134efd7350be
f31478ba1472afe5c1eed60f219ae331816425a2
efd0612fdcb7490ed371899f532d73ef8bb7cba0
c490fc9536dcea7fdf1245a340bf075533610bc2
71421f382f5c53b1a109489a906a80c1b7e3eed7

Merged-by: James Almer <jamrial@gmail.com>
2 years agoMerge commit '5a6707e49b7710f48d658b2f2591b9a6337fb9b7'
James Almer [Sun, 10 Dec 2017 23:49:50 +0000 (20:49 -0300)]
Merge commit '5a6707e49b7710f48d658b2f2591b9a6337fb9b7'

* commit '5a6707e49b7710f48d658b2f2591b9a6337fb9b7':
  cbs_mpeg2: Fix marker_bit type
  cbs: Add padding to slice data allocations

This commit is a noop, see
b4c915f4b3e15c3e787e319b961e4389762f6309
5b2c71bb94d7cab23ee81b5c29388f5fadbcaf22

Merged-by: James Almer <jamrial@gmail.com>
2 years agoMerge commit 'f6161fccf8c5720ceac1ed1df8ba60ff8fed69f5'
James Almer [Sun, 10 Dec 2017 23:44:26 +0000 (20:44 -0300)]
Merge commit 'f6161fccf8c5720ceac1ed1df8ba60ff8fed69f5'

* commit 'f6161fccf8c5720ceac1ed1df8ba60ff8fed69f5':
  rtsp: only break on parse_rtsp_message on error

Merged-by: James Almer <jamrial@gmail.com>
2 years agolavc/huffyuvenc: Move a variable declaration up.
Carl Eugen Hoyos [Sun, 10 Dec 2017 19:46:55 +0000 (20:46 +0100)]
lavc/huffyuvenc: Move a variable declaration up.

Fixes a warning with gcc-6.3:
libavcodec/huffyuvenc.c:93:5: warning: ISO C90 forbids mixed declarations and code

2 years agoavcodec/vp9_superframe_split_bsf: Fix integer overflow in frame_size/total_size checks
Michael Niedermayer [Wed, 6 Dec 2017 21:42:05 +0000 (22:42 +0100)]
avcodec/vp9_superframe_split_bsf: Fix integer overflow in frame_size/total_size checks

Fixes: signed integer overflow: -1698586465 + -551542752 cannot be represented in type 'int'
Fixes: 4490/clusterfuzz-testcase-minimized-5210014592532480

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/amrwbdec: Fix division by 0 in voice_factor()
Michael Niedermayer [Thu, 7 Dec 2017 14:32:54 +0000 (15:32 +0100)]
avcodec/amrwbdec: Fix division by 0 in voice_factor()

The added value matches "Digital cellular telecommunications system (Phase 2+) (GSM); Universal Mobile Telecommunications System (UMTS); LTE; Extended Adaptive Multi-Rate - Wideband (AMR-WB+) codec; Floating-point ANSI-C code (3GPP TS 26.304 version 14.0.0 Release 14)
Extended Adaptive Multi-Rate - Wideband (AMR-WB+) codec; Floating-point ANSI-C code"

Fixes: runtime error: division by zero
Fixes: 4415/clusterfuzz-testcase-minimized-4677752314658816

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoconfigure: Move V4L2 M2M help line to the hardware library section
Mark Thompson [Sun, 10 Dec 2017 17:15:06 +0000 (17:15 +0000)]
configure: Move V4L2 M2M help line to the hardware library section

2 years agolavc: Make hardware config method support more explicit for hwaccels
Thomas Guillem [Fri, 8 Dec 2017 15:59:39 +0000 (15:59 +0000)]
lavc: Make hardware config method support more explicit for hwaccels

This fixes the use of old ad-hoc methods which are still supported by some
hwaccels which also support newer methods (DXVA2, VAAPI, VDPAU,
videotoolbox) - without the method being visible here, ff_get_format()
would refuse to use it.

Signed-off-by: Mark Thompson <sw@jkqxz.net>
2 years agofix MSVC compilation errors
Mateusz [Fri, 8 Dec 2017 07:46:52 +0000 (08:46 +0100)]
fix MSVC compilation errors

After commit 3701d49 'error_resilience: remove avpriv_atomic usage'
we have included windows.h in much more files and we should
avoid conflicts with defines/function declarations.

Signed-off-by: Mateusz Brzostek <mateuszb@poczta.onet.pl>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agocheckasm/llviddsp: fix mixed code and declarations
James Almer [Sun, 10 Dec 2017 03:51:35 +0000 (00:51 -0300)]
checkasm/llviddsp: fix mixed code and declarations

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agox86/lossless_videodsp: rename ff_add_left_pred_int16_sse4 to ff_add_left_pred_int16_u...
James Almer [Sun, 10 Dec 2017 03:51:01 +0000 (00:51 -0300)]
x86/lossless_videodsp: rename ff_add_left_pred_int16_sse4 to ff_add_left_pred_int16_unaligned_ssse3

SSSE3_FAST is the proper check for it.

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agox86/lossless_videodsp: don't overread the dst buffer in ff_add_left_pred_unaligned_avx2
James Almer [Sun, 10 Dec 2017 03:38:05 +0000 (00:38 -0300)]
x86/lossless_videodsp: don't overread the dst buffer in ff_add_left_pred_unaligned_avx2

Fixes valgrind

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoamf: fix wrong profile level after auto-correction in H264 and HEVC
Mironov, Mikhail [Fri, 8 Dec 2017 19:23:38 +0000 (19:23 +0000)]
amf: fix wrong profile level after auto-correction in H264 and HEVC

Moved bitrate parameters set before Init() call because bitrate is used in
profile level correction code inside Init().

Signed-off-by: Mikhail Mironov <mikhail.mironov@amd.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agolavf/mov: modify code indentation
tiejun.peng [Fri, 8 Dec 2017 16:39:29 +0000 (00:39 +0800)]
lavf/mov: modify code indentation

Signed-off-by: tiejun.peng <tiejun.peng@foxmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agolavf/mov: add some useful warning log of eof
tiejun.peng [Fri, 8 Dec 2017 16:28:41 +0000 (00:28 +0800)]
lavf/mov: add some useful warning log of eof

Signed-off-by: tiejun.peng <tiejun.peng@foxmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/Makefile: Fix opus parser dependency.
Jacob Trimble [Thu, 7 Dec 2017 19:05:46 +0000 (11:05 -0800)]
avcodec/Makefile: Fix opus parser dependency.

The opus.c file uses ff_celt_freq_range and ff_celt_freq_bands which are
defined in opustab.c.  The opus parser needs to include that file to
avoid linker errors when not including the opus encoder/decoder.

Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/decode: reset codec on receiving packet after EOF in compat_decode
James Cowgill [Thu, 9 Nov 2017 12:21:23 +0000 (12:21 +0000)]
avcodec/decode: reset codec on receiving packet after EOF in compat_decode

In commit 061a0c14bb57 ("decode: restructure the core decoding code"), the
deprecated avcodec_decode_* APIs were reworked so that they called into the
new avcodec_send_packet / avcodec_receive_frame API. This had the side effect
of prohibiting sending new packets containing data after a drain
packet, but in previous versions of FFmpeg this "worked" and some
applications relied on it.

To restore some compatibility, reset the codec if we receive a new non-drain
packet using the old API after draining has completed. While this does
not give the same behaviour as the old API did, in the majority of cases
it works and it does not require changes to any other part of the decoding
code.

Fixes ticket #6775
Signed-off-by: James Cowgill <jcowgill@debian.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
2 years agoarm/hevc_idct: fix compilation on Android
James Almer [Fri, 8 Dec 2017 22:14:13 +0000 (19:14 -0300)]
arm/hevc_idct: fix compilation on Android

Compilation error "out of range" fixed for armeabi-v7a. Compilation failed
trying to build libvlc.aar for ARM7 android on ubuntu 16.04 host. Error
messages is "Offset out of range". The reason of the error is assembler LDR
directives in function "ff_hevc_transform_luma_4x4_neon_8" need local storage
in range <1k, but no such storage provided.

Based on a patch by Ihor Bobalo <bob@eleks.com>

Suggested-by: wbs
Signed-off-by: James Almer <jamrial@gmail.com>
2 years agocheckasm/llviddsp : add test for add_gradient_pred
Martin Vignali [Sat, 2 Dec 2017 18:47:24 +0000 (19:47 +0100)]
checkasm/llviddsp : add test for add_gradient_pred

2 years agoavcodec/utvideodec : add SIMD (SSSE3 and AVX2) for gradient_pred
Martin Vignali [Sat, 2 Dec 2017 18:46:42 +0000 (19:46 +0100)]
avcodec/utvideodec : add SIMD (SSSE3 and AVX2) for gradient_pred

2 years agoavcodec/x86/lossless_videodsp : add avx2 version for add_left_pred
Martin Vignali [Sat, 2 Dec 2017 18:09:58 +0000 (19:09 +0100)]
avcodec/x86/lossless_videodsp : add avx2 version for add_left_pred

2 years agoavcodec/x86/lossless_videodsp.asm : make macro for add_left_pred_unaligned in order...
Martin Vignali [Sat, 2 Dec 2017 18:04:11 +0000 (19:04 +0100)]
avcodec/x86/lossless_videodsp.asm : make macro for add_left_pred_unaligned in order to add avx2 version

2 years agocheckasm/llviddsp : test return of add_left_pred(16)
Martin Vignali [Sat, 2 Dec 2017 18:03:30 +0000 (19:03 +0100)]
checkasm/llviddsp : test return of add_left_pred(16)

2 years agoavcodec/huffyuvenc : sub_left_prediction_bgr32, call dsp after 32 first byte of the...
Martin Vignali [Sat, 2 Dec 2017 17:33:25 +0000 (18:33 +0100)]
avcodec/huffyuvenc : sub_left_prediction_bgr32, call dsp after 32 first byte of the line in order to try to call the align version (diff bytes have avx2 version)

2 years agoavcodec/huffyuvenc : remove code duplication in sub_left_prediction
Martin Vignali [Sat, 2 Dec 2017 17:32:05 +0000 (18:32 +0100)]
avcodec/huffyuvenc : remove code duplication in sub_left_prediction

start of the line (before dsp call), can be merge with width < 32 part

2 years agoavcodec/huffyuvenc : increase scalar loop count
Martin Vignali [Sat, 2 Dec 2017 17:30:26 +0000 (18:30 +0100)]
avcodec/huffyuvenc : increase scalar loop count

in order to try to call dsp in aligned mode
(diff_int16 have AVX2 now)

2 years agoavcodec/utvideodec : use dsp add_median_pred for second line
Martin Vignali [Sun, 26 Nov 2017 18:18:48 +0000 (19:18 +0100)]
avcodec/utvideodec : use dsp add_median_pred for second line

process start of the line in scalar, before call dsp
(dsp need align 16)

2 years agocheckasm/vf_threshold : add test for threshold16
Martin Vignali [Thu, 7 Dec 2017 21:03:44 +0000 (22:03 +0100)]
checkasm/vf_threshold : add test for threshold16

2 years agoavfilter/x86/vf_threshold : add threshold16 SIMD (SSE4 and AVX2)
Martin Vignali [Thu, 7 Dec 2017 21:01:54 +0000 (22:01 +0100)]
avfilter/x86/vf_threshold : add threshold16 SIMD (SSE4 and AVX2)

2 years agohevc: Add hevc_get_pixel_4/8/12/16/24/32/48/64
Alexandra Hájková [Sun, 3 Dec 2017 08:15:23 +0000 (09:15 +0100)]
hevc: Add hevc_get_pixel_4/8/12/16/24/32/48/64

Checkasm timings:
block size bitdepth  C       NEON
4           8 bit:    146.7   48.7
           10 bit:    146.7   52.7
8           8 bit:    430.3   84.4
           10 bit:    430.4  119.5
12          8 bit:    812.8  141.0
           10 bit:    812.8  195.0
16          8 bit:   1499.1  268.0
           10 bit:   1498.9  368.4
24          8 bit:   4394.2  574.8
           10 bit:   3696.3  804.8
32          8 bit:   5108.6  568.9
           10 bit:   4249.6  918.8
48          8 bit:  16819.6 2304.9
           10 bit:  13882.0 3178.5
64          8 bit:  13490.8 1799.5
           10 bit:  11018.5 2519.4

Signed-off-by: Martin Storsjö <martin@martin.st>
2 years agoavfilter/vf_scale: add more aliases for "range" options
Paul B Mahol [Fri, 8 Dec 2017 19:35:08 +0000 (20:35 +0100)]
avfilter/vf_scale: add more aliases for "range" options

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2 years agofate: Fix fate-mov-bbi-elst-starts-b on ARM
Michael Niedermayer [Fri, 8 Dec 2017 15:58:10 +0000 (16:58 +0100)]
fate: Fix fate-mov-bbi-elst-starts-b on ARM

2 years agofate/mxf: add reel name test
Mark Reid [Tue, 5 Dec 2017 04:46:23 +0000 (20:46 -0800)]
fate/mxf: add reel name test

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavformat/mxfenc: write reel_name if metadata key is present
Mark Reid [Tue, 5 Dec 2017 04:46:22 +0000 (20:46 -0800)]
avformat/mxfenc: write reel_name if metadata key is present

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavformat/mxfenc: use track count to generate component instance uuid
Mark Reid [Tue, 5 Dec 2017 04:46:21 +0000 (20:46 -0800)]
avformat/mxfenc: use track count to generate component instance uuid

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agolibavcodec/hevc_filter: move AVDISCARD_NONREF switch-case into function
sfan5 [Thu, 7 Dec 2017 19:37:48 +0000 (20:37 +0100)]
libavcodec/hevc_filter: move AVDISCARD_NONREF switch-case into function

In preparation for implementation of skip_frame.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>