ffmpeg.git
2 years agofate/fits: add missing png & gif dependencies
Paras Chadha [Fri, 15 Sep 2017 21:54:07 +0000 (03:24 +0530)]
fate/fits: add missing png & gif dependencies

Signed-off-by: Paras Chadha <paraschadha18@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agolibavcodec/hapdec : add support HapAlphaOnly
Martin Vignali [Sat, 23 Sep 2017 19:50:54 +0000 (21:50 +0200)]
libavcodec/hapdec : add support HapAlphaOnly

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agolibavformat : add mov dataformat tag for HapAlphaOnly and HapQAlpha
Martin Vignali [Sat, 23 Sep 2017 19:43:44 +0000 (21:43 +0200)]
libavformat : add mov dataformat tag for HapAlphaOnly and HapQAlpha

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/takdec: Fix integer overflow in decode_lpc()
Michael Niedermayer [Fri, 22 Sep 2017 18:45:27 +0000 (20:45 +0200)]
avcodec/takdec: Fix integer overflow in decode_lpc()

Fixes: runtime error: signed integer overflow: 16748560 + 2143729712 cannot be represented in type 'int'
Fixes: 3202/clusterfuzz-testcase-minimized-4988291642294272

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/proresdec2: Check bits in DECODE_CODEWORD(), fixes invalid shift
Michael Niedermayer [Fri, 22 Sep 2017 18:45:28 +0000 (20:45 +0200)]
avcodec/proresdec2: Check bits in DECODE_CODEWORD(), fixes invalid shift

Fixes: runtime error: shift exponent 42 is too large for 32-bit type 'unsigned int'
Fixes: 3410/clusterfuzz-testcase-minimized-5313377960198144

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/takdec: Fix integer overflows in decode_subframe()
Michael Niedermayer [Fri, 22 Sep 2017 18:45:26 +0000 (20:45 +0200)]
avcodec/takdec: Fix integer overflows in decode_subframe()

Fixes: runtime error: signed integer overflow: -1562477869 + -691460395 cannot be represented in type 'int'
Fixes: 3196/clusterfuzz-testcase-minimized-4528307146063872

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 agoavformat/libopenmpt: Query duration and metadata after selecting subsong
Jörn Heusipp [Sun, 17 Sep 2017 13:35:50 +0000 (15:35 +0200)]
avformat/libopenmpt: Query duration and metadata after selecting subsong

Duration depends on the selected subsong and thus must be queried after
selecting the subsong. There is no compelling reason to query other
metadata earlier either.

Tested with libopenmpt version: 0.2.8760-beta27
Libopenmpt configure options: --without-ogg --without-vorbis
--without-vorbisfile --without-portaudio --without-portaudiocpp
--without-mpg123 --without-pulseaudio --without-sndfile --without-flac

Signed-off-by: Jörn Heusipp <osmanx@problemloesungsmaschine.de>
Signed-off-by: Josh de Kock <josh@itanimul.li>
2 years agoavcodec/mips: Improve avc chroma horiz mc msa functions
Kaustubh Raste [Thu, 21 Sep 2017 13:59:39 +0000 (19:29 +0530)]
avcodec/mips: Improve avc chroma horiz mc msa functions

Replace generic with block size specific function.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/mips: Unrolled loops avc intra msa functions
Kaustubh Raste [Thu, 21 Sep 2017 13:32:30 +0000 (19:02 +0530)]
avcodec/mips: Unrolled loops avc intra msa functions

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/mips: Improve hevc uni-w copy mc msa functions
Kaustubh Raste [Thu, 21 Sep 2017 08:15:34 +0000 (13:45 +0530)]
avcodec/mips: Improve hevc uni-w copy mc msa functions

Load the specific destination bytes instead of MSA load and pack.
Pack the data to half word before clipping.
Use immediate unsigned saturation for clip to max saving one vector register.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/flacenc: Replace "return -1" by named constant
Michael Niedermayer [Fri, 22 Sep 2017 23:44:27 +0000 (01:44 +0200)]
avcodec/flacenc: Replace "return -1" by named constant

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/snowenc: Replace "return -1" by named constants
Michael Niedermayer [Sat, 23 Sep 2017 00:19:25 +0000 (02:19 +0200)]
avcodec/snowenc: Replace "return -1" by named constants

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agolibavdevice/v4l2: fix invalid access to struct v4l2_buffer
Jaroslav Beran [Wed, 20 Sep 2017 13:14:54 +0000 (15:14 +0200)]
libavdevice/v4l2: fix invalid access to struct v4l2_buffer

In case we are short of queued buffers, at first v4l2_buffer was enqueued to kernel so it's not owned by
user-space anymore. After that it's timestamp field was read, but it might be overwritten by driver at
that moment. It resulted in invalid timestamp sometimes.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoffplay: zero initialize copy avpacket
James Almer [Sat, 23 Sep 2017 23:13:58 +0000 (20:13 -0300)]
ffplay: zero initialize copy avpacket

Prevents potential use of uninitialized stack.

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavformat/mpeg: zero initialize idx_pkt
James Almer [Sat, 23 Sep 2017 22:37:21 +0000 (19:37 -0300)]
avformat/mpeg: zero initialize idx_pkt

Prevents use of uninitialized stack.

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavcodec/v4l2_m2m: add missing header inclusions
James Almer [Sat, 23 Sep 2017 21:12:56 +0000 (18:12 -0300)]
avcodec/v4l2_m2m: add missing header inclusions

Should fix checkheaders on systems where v4l2_m2m is enabled.

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavcodec/Makefile: skip v4l2_m2m headers if needed
James Almer [Sat, 23 Sep 2017 21:08:07 +0000 (18:08 -0300)]
avcodec/Makefile: skip v4l2_m2m headers if needed

Fixes checkheaders on systems where v4l2_m2m is unavailable.

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavcodec/frame_thread_encoder: use av_packet_alloc()
James Almer [Sat, 23 Sep 2017 20:50:58 +0000 (17:50 -0300)]
avcodec/frame_thread_encoder: use av_packet_alloc()

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavfilter/interlace: add support for 10 and 12 bit
Thomas Mundt [Tue, 19 Sep 2017 20:23:23 +0000 (22:23 +0200)]
avfilter/interlace: add support for 10 and 12 bit

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Thomas Mundt <tmundt75@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavfilter/tinterlace: use drawutils for pad mode
Thomas Mundt [Mon, 18 Sep 2017 21:57:17 +0000 (23:57 +0200)]
avfilter/tinterlace: use drawutils for pad mode

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Thomas Mundt <tmundt75@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavformat/mxfdec: use the common packet pts setter function for opatom files
Marton Balint [Thu, 7 Sep 2017 14:17:59 +0000 (16:17 +0200)]
avformat/mxfdec: use the common packet pts setter function for opatom files

Fixes ticket #6631.

Signed-off-by: Marton Balint <cus@passwd.hu>
2 years agoavformat/mxfdec: factorize packet pts setter function
Marton Balint [Thu, 7 Sep 2017 14:09:13 +0000 (16:09 +0200)]
avformat/mxfdec: factorize packet pts setter function

Signed-off-by: Marton Balint <cus@passwd.hu>
2 years agoavcodec/opusenc_psy: use av_clip_uintp2()
James Almer [Sat, 23 Sep 2017 16:23:27 +0000 (13:23 -0300)]
avcodec/opusenc_psy: use av_clip_uintp2()

Fixes fate-source.

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavcodec/opusenc_utils: add missing preprocessor guards
James Almer [Sat, 23 Sep 2017 16:22:51 +0000 (13:22 -0300)]
avcodec/opusenc_utils: add missing preprocessor guards

Fixes fate-source.

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agolavfi: make window_func an inline function
Rostislav Pehlivanov [Sat, 23 Sep 2017 13:21:22 +0000 (14:21 +0100)]
lavfi: make window_func an inline function

Eliminate lavc->lavfi dependency. The function isn't big and doesn't
deserve its own file.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2 years agoopusenc: implement a psychoacoustic system
Rostislav Pehlivanov [Fri, 22 Sep 2017 23:38:37 +0000 (00:38 +0100)]
opusenc: implement a psychoacoustic system

This commit implements a psychoacoustic system for the native Opus
encoder. Its unlike any other psychoacoustic system known since its
capable of using a lookahead to make better choices on how to treat the
current frame and how many bits to allocate for it (and future frames).

Also, whilst the main bulk of the analysis function has to run in a
single thread, the per-frame anaylsis functions does not modify the main
psychoacoustic context, so in the future it will be fairly trivial to
run those as slice threads.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2 years agolibavcodec: v4l2: add support for v4l2 mem2mem codecs
Jorge Ramirez-Ortiz [Thu, 21 Sep 2017 01:55:40 +0000 (18:55 -0700)]
libavcodec: v4l2: add support for v4l2 mem2mem codecs

    This patchset enhances Alexis Ballier's original patch and validates
    it using Qualcomm's Venus hardware (driver recently landed upstream
    [1]).

    This has been tested on Qualcomm's DragonBoard 410c and 820c
    Configure/make scripts have been validated on Ubuntu 10.04 and
    16.04.

    Tested decoders:
           - h264
           - h263
           - mpeg4
           - vp8
           - vp9
           - hevc

    Tested encoders:
           - h264
           - h263
           - mpeg4

    Tested transcoding (concurrent encoding/decoding)

    Some of the changes introduced:
        - v4l2: code cleanup and abstractions added
        - v4l2: follow the new encode/decode api.
        - v4l2: fix display size for NV12 output pool.
        - v4l2: handle EOS (EPIPE and draining)
        - v4l2: vp8 and mpeg4 decoding and encoding.
        - v4l2: hevc and vp9 support.
        - v4l2: generate EOF on dequeue errors.
        - v4l2: h264_mp4toannexb filtering.
        - v4l2: fixed make install and fate issues.
        - v4l2: codecs enabled/disabled depending on pixfmt defined
        - v4l2: pass timebase/framerate to the context
        - v4l2: runtime decoder reconfiguration.
        - v4l2: add more frame information
        - v4l2: free hardware resources on last reference being released
        - v4l2: encoding: disable b-frames for upstreaming (patch required)

    [1] https://lwn.net/Articles/697956/

    System Level view:
        v42l_m2m_enc/dec --> v4l2_m2m --> v4l2_context --> v4l2_buffers

Reviewed-by: Jorge Ramirez <jorge.ramirez-ortiz@linaro.org>
Reviewed-by: Alexis Ballier <aballier@gentoo.org>
Tested-by: Jorge Ramirez <jorge.ramirez-ortiz@linaro.org>
Signed-off-by: wm4 <nfxjfg@googlemail.com>
2 years agoavformat/gif: use av_packet_alloc()
James Almer [Sat, 23 Sep 2017 05:18:47 +0000 (02:18 -0300)]
avformat/gif: use av_packet_alloc()

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavformat/apngenc: use av_packet_alloc()
James Almer [Sat, 23 Sep 2017 05:15:16 +0000 (02:15 -0300)]
avformat/apngenc: use av_packet_alloc()

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavcodec/dirac_dwt: Fix integer overflow in COMPOSE_FIDELITYi*()
Michael Niedermayer [Mon, 18 Sep 2017 00:53:25 +0000 (02:53 +0200)]
avcodec/dirac_dwt: Fix integer overflow in COMPOSE_FIDELITYi*()

Fixes: runtime error: signed integer overflow: 161 * 13872281 cannot be represented in type 'int'

Fixes: 3295/clusterfuzz-testcase-minimized-4738998142500864

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/ffv1dec: Fix integer overflow in read_quant_table()
Michael Niedermayer [Mon, 18 Sep 2017 15:26:09 +0000 (17:26 +0200)]
avcodec/ffv1dec: Fix integer overflow in read_quant_table()

Fixes: runtime error: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 3361/clusterfuzz-testcase-minimized-5065842955911168

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/svq3: Fix overflow in svq3_add_idct_c()
Michael Niedermayer [Mon, 18 Sep 2017 15:03:55 +0000 (17:03 +0200)]
avcodec/svq3: Fix overflow in svq3_add_idct_c()

Fixes: runtime error: signed integer overflow: 2147392585 + 524288 cannot be represented in type 'int'
Fixes: 3348/clusterfuzz-testcase-minimized-4809500517203968

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/mips: Remove generic func use in hevc non-uni copy mc msa functions
Kaustubh Raste [Thu, 21 Sep 2017 07:15:28 +0000 (12:45 +0530)]
avcodec/mips: Remove generic func use in hevc non-uni copy mc msa functions

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/mips: preload data in hevc sao edge 90 degree filter msa functions
Kaustubh Raste [Thu, 21 Sep 2017 06:47:40 +0000 (12:17 +0530)]
avcodec/mips: preload data in hevc sao edge 90 degree filter msa functions

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavfilter/thumbnail_cuda: add cuda thumbnail filter
Yogender Gupta [Mon, 4 Sep 2017 12:48:16 +0000 (18:18 +0530)]
avfilter/thumbnail_cuda: add cuda thumbnail filter

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2 years agoFix several typos
Lou Logan [Thu, 21 Sep 2017 23:10:56 +0000 (15:10 -0800)]
Fix several typos

"apix_fmts" found by Marc Péchaud.
"speedloss" found by Mikhail V.

Signed-off-by: Lou Logan <lou@lrcd.com>
2 years agoRemove some unneeded casts of bit_rate.
Carl Eugen Hoyos [Thu, 21 Sep 2017 23:33:22 +0000 (01:33 +0200)]
Remove some unneeded casts of bit_rate.

2 years agoavformat/hlsenc: support http method for hls fmp4 init file
Steven Liu [Thu, 21 Sep 2017 15:10:57 +0000 (23:10 +0800)]
avformat/hlsenc: support http method for hls fmp4 init file

Signed-off-by: Steven Liu <lq@onvideo.cn>
2 years agoMAINTAINERS: modify the hlsenc description
Steven Liu [Thu, 21 Sep 2017 15:08:55 +0000 (23:08 +0800)]
MAINTAINERS: modify the hlsenc description

change the hlsenc from hls encryption to hlsenc

Suggested-by: Aman Gupta <aman@tmm1.net>
Reviewed-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Steven Liu <lq@onvideo.cn>
2 years agoavformat/hlsenc: fix CID 1418106
Steven Liu [Thu, 21 Sep 2017 15:08:00 +0000 (23:08 +0800)]
avformat/hlsenc: fix CID 1418106

fix the "Uninitialized scalar variable (UNINIT)" problem.

Signed-off-by: Steven Liu <lq@onvideo.cn>
2 years agopixdesc: Add API to map color property names to enum values
Vittorio Giovara [Wed, 20 Sep 2017 11:27:10 +0000 (13:27 +0200)]
pixdesc: Add API to map color property names to enum values

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2 years agoavcodec/mips: Reduced conditional cases in avc inter lpf msa functions
Kaustubh Raste [Mon, 18 Sep 2017 08:38:37 +0000 (14:08 +0530)]
avcodec/mips: Reduced conditional cases in avc inter lpf msa functions

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/mips: Unrolled loops and expanded functions in avc put mc 10 & 30 msa functions
Kaustubh Raste [Mon, 18 Sep 2017 08:30:13 +0000 (14:00 +0530)]
avcodec/mips: Unrolled loops and expanded functions in avc put mc 10 & 30 msa functions

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoGnuTLS: eat PREMATURE_TERMINATION error
Tatsuyuki Ishi [Fri, 15 Sep 2017 08:04:38 +0000 (17:04 +0900)]
GnuTLS: eat PREMATURE_TERMINATION error

GnuTLS is too strict on the SSL shutdown alert, and it's neither
mandatory in the spec or critical. As it's ignored in OpenSSL, we
should also suppress it in GnuTLS as well.

Ticket: #6667

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavformat/cafdec: reject multichannel Opus streams
Anton Khirnov [Wed, 20 Sep 2017 02:04:55 +0000 (23:04 -0300)]
avformat/cafdec: reject multichannel Opus streams

Multichannel Opus streams require channel mapping information in extradata.

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agolavf/caf: Support demuxing Opus.
Carl Eugen Hoyos [Wed, 20 Sep 2017 01:31:48 +0000 (03:31 +0200)]
lavf/caf: Support demuxing Opus.

Introduced in macOS High Sierra and iOS 11.

2 years agoavcodec/mips: preload data in hevc sao edge 0 degree filter msa functions
Kaustubh Raste [Mon, 18 Sep 2017 08:24:40 +0000 (13:54 +0530)]
avcodec/mips: preload data in hevc sao edge 0 degree filter msa functions

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/mips: Fixed rnd_val variable to 6 in hevc uni mc msa functions
Kaustubh Raste [Mon, 18 Sep 2017 08:18:48 +0000 (13:48 +0530)]
avcodec/mips: Fixed rnd_val variable to 6 in hevc uni mc msa functions

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoMAINTAINERS: add myself for bwdif and (t)interlace
Thomas Mundt [Fri, 15 Sep 2017 23:57:27 +0000 (01:57 +0200)]
MAINTAINERS: add myself for bwdif and (t)interlace

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/pngdec: Clean up on av_frame_ref() failure
Michael Niedermayer [Sun, 17 Sep 2017 00:42:11 +0000 (02:42 +0200)]
avcodec/pngdec: Clean up on av_frame_ref() failure

Fixes: memleak
Fixes: 3203/clusterfuzz-testcase-minimized-4514553595428864

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agolavf/mpegts: Consider stream_type 0x0f just a hint towards AAC.
Carl Eugen Hoyos [Wed, 13 Sep 2017 17:05:10 +0000 (19:05 +0200)]
lavf/mpegts: Consider stream_type 0x0f just a hint towards AAC.

It is also used in the wild to signal latm.

Fixes ticket #6657.

2 years agolavfi/stereo3d: Set SAR for every output frame.
Carl Eugen Hoyos [Mon, 18 Sep 2017 21:10:06 +0000 (23:10 +0200)]
lavfi/stereo3d: Set SAR for every output frame.

Fixes ticket #6672.

2 years agolavf/utils: Do not force chapter end time before chapter start.
Carl Eugen Hoyos [Sun, 17 Sep 2017 21:34:58 +0000 (23:34 +0200)]
lavf/utils: Do not force chapter end time before chapter start.

Fixes ticket #6671.

2 years agolavd/kmsgrab: Remove the mapping for AV_PIX_FMT_RGB8.
Carl Eugen Hoyos [Tue, 19 Sep 2017 22:56:29 +0000 (00:56 +0200)]
lavd/kmsgrab: Remove the mapping for AV_PIX_FMT_RGB8.

The definitions are different: 3:3:2 vs 2:3:3.

2 years agoavutil/hwcontext_dxva2: return an error when buffer allocation fails
James Almer [Sun, 17 Sep 2017 03:17:42 +0000 (00:17 -0300)]
avutil/hwcontext_dxva2: return an error when buffer allocation fails

This also prevents the use of an uninitialized variable.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2 years agokmsgrab: Add more DRM plane formats
Carl Eugen Hoyos [Fri, 15 Sep 2017 20:24:48 +0000 (21:24 +0100)]
kmsgrab: Add more DRM plane formats

2 years agohwcontext_vaapi: Fix DRM format mapping
Mark Thompson [Fri, 15 Sep 2017 20:05:49 +0000 (21:05 +0100)]
hwcontext_vaapi: Fix DRM format mapping

2 years agokmsgrab: Remove multiple-plane formats
Mark Thompson [Fri, 15 Sep 2017 19:54:26 +0000 (20:54 +0100)]
kmsgrab: Remove multiple-plane formats

The planes are unlikely to be contiguous, assuming they are results in
very broken output.  (Tested with NV12/NV16 on Rockchip.)

2 years agokmsgrab: Fix DRM format definitions
Mark Thompson [Fri, 15 Sep 2017 19:48:18 +0000 (20:48 +0100)]
kmsgrab: Fix DRM format definitions

All DRM formats are defined in terms of little-endian words, so RGB formats
like XRGB actually have the elements in the opposite order order in memory
to the order they are in the name.

This does not affect YUYV and similar YUV 4:2:2 formats, which are in the
expected order.

2 years agovaapi: Disable deprecation warnings around use of old struct vaapi_context
Mark Thompson [Thu, 14 Sep 2017 21:11:45 +0000 (22:11 +0100)]
vaapi: Disable deprecation warnings around use of old struct vaapi_context

2 years agovp9: move VP9SharedContext back to the top of VP9Context
Hendrik Leppkes [Tue, 19 Sep 2017 08:45:41 +0000 (10:45 +0200)]
vp9: move VP9SharedContext back to the top of VP9Context

VP9SharedContext needs to be the first member so its properties can be
safely accessed from hardware accelerators, without the need to share
the full VP9Context.

Fixes ticket #6674.

2 years agox86/exrdsp: optimize ff_reorder_pixels_avx2()
Henrik Gramner [Mon, 18 Sep 2017 01:52:13 +0000 (22:52 -0300)]
x86/exrdsp: optimize ff_reorder_pixels_avx2()

Tested with "checkasm --test=exrdsp -bench"

Before:
reorder_pixels_c: 5187.8
reorder_pixels_sse2: 377.0
reorder_pixels_avx2: 331.3

After:
reorder_pixels_c: 5181.5
reorder_pixels_sse2: 377.0
reorder_pixels_avx2: 313.8

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavformat/mxfenc: cosmetic changes
Tobias Rapp [Thu, 14 Sep 2017 14:05:31 +0000 (16:05 +0200)]
avformat/mxfenc: cosmetic changes

Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2 years agofate: add mxf_dv25/dvcpro50 regression tests
Tobias Rapp [Thu, 14 Sep 2017 13:23:04 +0000 (15:23 +0200)]
fate: add mxf_dv25/dvcpro50 regression tests

Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2 years agoavformat/mxfenc: fix aspect ratio when writing 16:9 DV frames
Tobias Rapp [Thu, 14 Sep 2017 12:03:28 +0000 (14:03 +0200)]
avformat/mxfenc: fix aspect ratio when writing 16:9 DV frames

Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2 years agoavfilter/tinterlace: Simplify checks for lowpass filtering flags
James Almer [Mon, 18 Sep 2017 02:41:31 +0000 (23:41 -0300)]
avfilter/tinterlace: Simplify checks for lowpass filtering flags

2 years agofate: add tinterlace lowpass filtering tests
Thomas Mundt [Mon, 18 Sep 2017 02:41:00 +0000 (23:41 -0300)]
fate: add tinterlace lowpass filtering tests

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agolavc/frame_thread_encoder: Do not mix variable declaration and code.
Carl Eugen Hoyos [Mon, 18 Sep 2017 01:24:52 +0000 (03:24 +0200)]
lavc/frame_thread_encoder: Do not mix variable declaration and code.

Fixes a warning:
ISO C90 forbids mixed declarations and code

2 years agocheckasm: add an exrdsp test
James Almer [Sun, 17 Sep 2017 21:48:02 +0000 (18:48 -0300)]
checkasm: add an exrdsp test

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavcodec/exrdsp: improve the ExrDSPContext->reorder_pixels prototype
James Almer [Sun, 17 Sep 2017 21:56:39 +0000 (18:56 -0300)]
avcodec/exrdsp: improve the ExrDSPContext->reorder_pixels prototype

Make dst be the first parameter and src const. It's more in line with the rest of the codebase.

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agolibavcodec/exr : add X86 SIMD for reorder_pixels
Martin Vignali [Sun, 17 Sep 2017 19:59:41 +0000 (21:59 +0200)]
libavcodec/exr : add X86 SIMD for reorder_pixels

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavcodec/vorbisenc: Fix mixed declaration and statements
Michael Niedermayer [Sat, 16 Sep 2017 17:21:35 +0000 (19:21 +0200)]
avcodec/vorbisenc: Fix mixed declaration and statements

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/fits: Fix include type
Michael Niedermayer [Sat, 16 Sep 2017 17:20:28 +0000 (19:20 +0200)]
avcodec/fits: Fix include type

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavutil/imgutils: Fix warning: missing braces around initializer
Michael Niedermayer [Sat, 16 Sep 2017 17:19:54 +0000 (19:19 +0200)]
avutil/imgutils: Fix warning: missing braces around initializer

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/frame_thread_encoder: Fix AV_OPT_TYPE_STRING handling in avctx
Reimar Döffinger [Wed, 13 Sep 2017 16:59:21 +0000 (18:59 +0200)]
avcodec/frame_thread_encoder: Fix AV_OPT_TYPE_STRING handling in avctx

This is the equivalent to what 7d317d4706b49d572a1eb5269438753be18362c7
did for the codec-specific options.
av_opt_copy has specific handling so it's fine that we already copied
the whole context before.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2 years agoavformat/hlsenc: fix segfault when using -hls_segment_type fmp4 with -hls_segment_fil...
Aman Gupta [Sat, 16 Sep 2017 02:32:28 +0000 (10:32 +0800)]
avformat/hlsenc: fix segfault when using -hls_segment_type fmp4 with -hls_segment_filename

previously, specifying -hls_segment_filename meant
s->base_output_dirname was never set, causing a segfault:

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
* frame #0: 0x00007fffbf7d82d0 libsystem_platform.dylib`_platform_strcmp + 80
frame #1: 0x00000001005f4dcf libavformat.57.dylib`io_open_default(s=0x000000010481cc00, pb=0x0000000104806020, url=0x0000000000000000, flags=2, options=0x0000000000000000) at options.c:107
frame #2: 0x0000000100528968 libavformat.57.dylib`hls_mux_init(s=0x000000010481cc00) at hlsenc.c:595
frame #3: 0x00000001005273cb libavformat.57.dylib`hls_write_header(s=0x000000010481cc00) at hlsenc.c:1518
frame #4: 0x00000001005c08d0 libavformat.57.dylib`write_header_internal(s=0x000000010481cc00) at mux.c:486
frame #5: 0x00000001005c0774 libavformat.57.dylib`avformat_write_header(s=0x000000010481cc00, options=0x00000001029026e8) at mux.c:539

2 years agovf_fps: Fix memory leak introduced by eea64ef4
Thierry Foucu [Fri, 15 Sep 2017 15:49:54 +0000 (08:49 -0700)]
vf_fps: Fix memory leak introduced by eea64ef4

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavfilter/interlace: simplify code
Thomas Mundt [Thu, 14 Sep 2017 19:20:24 +0000 (21:20 +0200)]
avfilter/interlace: simplify code

Signed-off-by: Thomas Mundt <tmundt75@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavfilter/interlace: prevent over-sharpening with the complex low-pass filter
Thomas Mundt [Wed, 30 Aug 2017 01:37:18 +0000 (03:37 +0200)]
avfilter/interlace: prevent over-sharpening with the complex low-pass filter

The complex vertical low-pass filter slightly over-sharpens the picture. This becomes visible when several transcodings are cascaded and the error potentises, e.g. some generations of HD->SD SD->HD.
To prevent this behaviour the destination pixel must not exceed the source pixel when the average of the pixels above and below is less than the source pixel. And the other way around.

Tested and approved in a visual transcoding cascade test by video professionals.
SSIM/PSNR test with the first generation of an HD->SD file as a reference against the 6th generation(3 x SD->HD HD->SD):
Results without the patch:
SSIM Y:0.956508 (13.615881) U:0.991601 (20.757750) V:0.993004 (21.551382) All:0.974405 (15.918463)
PSNR y:31.838009 u:48.424280 v:48.962711 average:34.759466 min:31.699297 max:40.857847
Results with the patch:
SSIM Y:0.970051 (15.236232) U:0.991883 (20.905857) V:0.993174 (21.658049) All:0.981290 (17.279202)
PSNR y:34.412108 u:48.504454 v:48.969496 average:37.264644 min:34.310637 max:42.373392

Signed-off-by: Thomas Mundt <tmundt75@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/mips: Improve hevc sao band filter msa functions
Kaustubh Raste [Fri, 15 Sep 2017 11:36:34 +0000 (17:06 +0530)]
avcodec/mips: Improve hevc sao band filter msa functions

Preload data in band filter 0-8 for better pipeline parallelization.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/mips: Improve avc mc copy msa functions
Kaustubh Raste [Fri, 15 Sep 2017 06:13:01 +0000 (11:43 +0530)]
avcodec/mips: Improve avc mc copy msa functions

Remove loops and unroll as block sizes are known.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/mips: Improve avc lpf msa functions
Kaustubh Raste [Fri, 15 Sep 2017 05:58:23 +0000 (11:28 +0530)]
avcodec/mips: Improve avc lpf msa functions

Optimize luma intra case by reducing conditional cases.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agolavf/http: fix compilation without zlib
Clément Bœsch [Fri, 15 Sep 2017 13:09:54 +0000 (15:09 +0200)]
lavf/http: fix compilation without zlib

Regression since e2f8f14052d99d7710cda0a821e236765b315d0b.

2 years agobuild: fix coreimage filters dependency to AppKit framework
Clément Bœsch [Fri, 15 Sep 2017 12:27:36 +0000 (14:27 +0200)]
build: fix coreimage filters dependency to AppKit framework

AppKit is not present on iOS.

2 years agolavc/mediacodec_wrapper: fix jni vaargs types
Matthieu Bouron [Fri, 15 Sep 2017 11:45:47 +0000 (13:45 +0200)]
lavc/mediacodec_wrapper: fix jni vaargs types

Fixes decoding on 32-bit devices with Android NDK >= 15.

2 years agolavf/http: Reset compressed header flag, fix http 302 request
Jacek Jendrzej [Thu, 20 Jul 2017 11:46:46 +0000 (13:46 +0200)]
lavf/http: Reset compressed header flag, fix http 302 request

Fixes ticket #6404.
Fixes ticket #6666.

Signed-off-by: Jacek Jendrzej <satbaby@kawaii.com>
2 years agovf_fps: when reading EOF, using current_pts to duplicate the last frame if needed.
Thierry Foucu [Wed, 13 Sep 2017 01:45:57 +0000 (18:45 -0700)]
vf_fps: when reading EOF, using current_pts to duplicate the last frame if needed.

Fix ticket #2674
Tested with examples from ticket 2674.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/mips: Improve hevc idct msa functions
Kaustubh Raste [Tue, 12 Sep 2017 11:31:58 +0000 (17:01 +0530)]
avcodec/mips: Improve hevc idct msa functions

Align the buffers. Remove reduandant constant array.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/mips: Improve hevc lpf msa functions
Kaustubh Raste [Tue, 12 Sep 2017 11:15:12 +0000 (16:45 +0530)]
avcodec/mips: Improve hevc lpf msa functions

Seperate the filter processing in all strong, all weak and strong + weak cases.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agohwcontext_vaapi: Fix build failure with old libdrm
Jun Zhao [Thu, 14 Sep 2017 00:21:38 +0000 (20:21 -0400)]
hwcontext_vaapi: Fix build failure with old libdrm

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2 years agokmsgrab: Fix build failure with old libdrm
Jun Zhao [Thu, 14 Sep 2017 00:21:38 +0000 (20:21 -0400)]
kmsgrab: Fix build failure with old libdrm

DRM_FORMAT_R8 was added in libdrm 2.4.68.
DRM_FORMAT_R16 was added in libdrm 2.4.82.

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2 years agoavfilter/vf_despill: fix assigment
Paul B Mahol [Thu, 14 Sep 2017 16:05:57 +0000 (18:05 +0200)]
avfilter/vf_despill: fix assigment

Reported-by: Moritz Barsnick
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2 years agolavd/kmsgrab: Fix packet flag setting
Mark Thompson [Thu, 14 Sep 2017 08:14:36 +0000 (09:14 +0100)]
lavd/kmsgrab: Fix packet flag setting

Found-by: James Almer <jamrial@gmail.com>
2 years agoavcodec.h: fix doxygen comment
James Almer [Thu, 14 Sep 2017 04:43:52 +0000 (01:43 -0300)]
avcodec.h: fix doxygen comment

2 years agodoc/indevs: Document kmsgrab input device
Mark Thompson [Mon, 11 Sep 2017 23:19:03 +0000 (00:19 +0100)]
doc/indevs: Document kmsgrab input device

2 years agolavd: Add KMS screen grabber
Mark Thompson [Sat, 2 Sep 2017 17:14:27 +0000 (18:14 +0100)]
lavd: Add KMS screen grabber

2 years agolavc: Add wrapped_avframe decoder
Mark Thompson [Sat, 2 Sep 2017 19:32:27 +0000 (20:32 +0100)]
lavc: Add wrapped_avframe decoder

Intended for use with hardware frames for which rawvideo is not
sufficient.  Requires the trusted packet flag to be set - decoding
fails if not to avoid security issues (the wrapped AVFrame can
contain pointers to arbitrary data).

2 years agolavc: Add flag to mark packets containing trusted input
Mark Thompson [Thu, 7 Sep 2017 21:27:09 +0000 (22:27 +0100)]
lavc: Add flag to mark packets containing trusted input

2 years agohwcontext_vaapi: Add DRM to VAAPI mapping
Mark Thompson [Sat, 2 Sep 2017 17:08:34 +0000 (18:08 +0100)]
hwcontext_vaapi: Add DRM to VAAPI mapping

2 years agolavu: Add DRM hwcontext
Mark Thompson [Sun, 18 Jun 2017 17:16:27 +0000 (18:16 +0100)]
lavu: Add DRM hwcontext