ffmpeg.git
13 months agohwcontext_vaapi: Fix compilation with libva versions < 1.4.0
Mark Thompson [Fri, 27 Apr 2018 12:41:56 +0000 (13:41 +0100)]
hwcontext_vaapi: Fix compilation with libva versions < 1.4.0

The BufferHandle API was added in libva 1.4.0 / VAAPI 0.36.0.

13 months agoavfilter/vf_mix: use correct linesizes
Paul B Mahol [Fri, 27 Apr 2018 17:15:55 +0000 (19:15 +0200)]
avfilter/vf_mix: use correct linesizes

Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 months agoavfilter/vf_shuffleplanes: add support for timeline
Paul B Mahol [Fri, 27 Apr 2018 15:18:22 +0000 (17:18 +0200)]
avfilter/vf_shuffleplanes: add support for timeline

Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 months agoavfilter/vf_premultiply: add slice threading
Paul B Mahol [Fri, 27 Apr 2018 10:25:32 +0000 (12:25 +0200)]
avfilter/vf_premultiply: add slice threading

Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 months agoavfilter/vf_maskedclamp: silence warning
Paul B Mahol [Fri, 27 Apr 2018 09:35:18 +0000 (11:35 +0200)]
avfilter/vf_maskedclamp: silence warning

Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 months agoavfilter/vf_mix: add slice threading
Paul B Mahol [Fri, 27 Apr 2018 09:32:50 +0000 (11:32 +0200)]
avfilter/vf_mix: add slice threading

Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 months agoavformat/mpegts: set AV_DISPOSITION_DESCRIPTIONS for OIPF cases
Łukasz Krzciuk [Fri, 13 Apr 2018 12:57:57 +0000 (14:57 +0200)]
avformat/mpegts: set AV_DISPOSITION_DESCRIPTIONS for OIPF cases

1. an audio component with an ISO_639_language_descriptor in the PMT with the
audio_type field set to 0x03
2. a supplementary_audio_descriptor with the editorial_classification field set
to 0x01
3. an ac-3_descriptor or an enhanced_ac-3_descriptor with a component_type field
with the service_type flags set to Visually Impaired

Tested-by: Łukasz Krzciuk <lkrzciuk@vewd.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/cbs_mpeg2: use existing buffer reference when splitting fragments
James Almer [Wed, 25 Apr 2018 22:35:46 +0000 (19:35 -0300)]
avcodec/cbs_mpeg2: use existing buffer reference when splitting fragments

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
13 months agoavcodec/cbs: create reference counted fragments in ff_cbs_read_extradata()
James Almer [Wed, 25 Apr 2018 22:27:04 +0000 (19:27 -0300)]
avcodec/cbs: create reference counted fragments in ff_cbs_read_extradata()

This way, every CodedBitstreamType->split_fragment() function can
safely assume the fragment passed to them will be reference counted,
potentially simplifying code.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
13 months agoavfilter/vf_maskedclamp: add slice threading
Paul B Mahol [Thu, 26 Apr 2018 21:35:42 +0000 (23:35 +0200)]
avfilter/vf_maskedclamp: add slice threading

Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 months agoavfilter/vf_atadenoise: do not abort if user specified invalid size
Paul B Mahol [Thu, 26 Apr 2018 15:57:20 +0000 (17:57 +0200)]
avfilter/vf_atadenoise: do not abort if user specified invalid size

Update documentation with new size default.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 months agolavf/http: use AV_OPT_FLAG_DEPRECATED for user-agent option
Clément Bœsch [Sun, 22 Apr 2018 14:31:04 +0000 (16:31 +0200)]
lavf/http: use AV_OPT_FLAG_DEPRECATED for user-agent option

13 months agolavu/opt: add AV_OPT_FLAG_DEPRECATED
Clément Bœsch [Sun, 22 Apr 2018 14:30:19 +0000 (16:30 +0200)]
lavu/opt: add AV_OPT_FLAG_DEPRECATED

13 months agolavu/threadmessage: add av_thread_message_queue_nb_elems()
Clément Bœsch [Sat, 21 Apr 2018 19:42:19 +0000 (21:42 +0200)]
lavu/threadmessage: add av_thread_message_queue_nb_elems()

13 months agoavcodec/vc1: fix out of bounds access of overlap filter
Jerome Borsboom [Thu, 26 Apr 2018 14:49:04 +0000 (16:49 +0200)]
avcodec/vc1: fix out of bounds access of overlap filter

Overlap filtering of the first row and first column must be guarded
for out of bounds access of v->over_flags_plane.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agoavfilter/vf_mix: clip output pixel values
Paul B Mahol [Wed, 25 Apr 2018 11:07:34 +0000 (13:07 +0200)]
avfilter/vf_mix: clip output pixel values

Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 months agoavfilter/vf_mix: add scale option
Paul B Mahol [Tue, 24 Apr 2018 12:45:19 +0000 (14:45 +0200)]
avfilter/vf_mix: add scale option

Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 months agoavfilter: add tmix filter
Paul B Mahol [Tue, 24 Apr 2018 11:45:13 +0000 (13:45 +0200)]
avfilter: add tmix filter

Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 months agomov: Properly abide by the track's media duration
Derek Buitenhuis [Mon, 23 Apr 2018 15:46:55 +0000 (16:46 +0100)]
mov: Properly abide by the track's media duration

The track's media duration from the mdhd atom takes precedence
over both the stts and elst atom for calculating and setting
the track's total duraion.

Technically, we shouldn't be using the stts atom at all for
calculating stream durations.

This fixes incorrect stream and final packet durations on files
with edit lists that are longer than the media duration.

The FATE changes are expected, and output is more correct (the
AAC frame is not 1028 samples).

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
13 months agolavf/rtmpcrypt: Add a cast to silence an unavoidable warning.
Carl Eugen Hoyos [Sun, 15 Apr 2018 22:14:24 +0000 (00:14 +0200)]
lavf/rtmpcrypt: Add a cast to silence an unavoidable warning.

The av_rc4_crypt() documentation allows src == dst.

Silences the following warning:
libavformat/rtmpcrypt.c:304:36: warning: passing argument 2 of 'av_rc4_crypt' discards 'const' qualifier from pointer target type

Reported-by: Reino Wijnsma
13 months agoavformat/dashenc: Set mp4 as the default format for VP9
Karthick Jeyapal [Mon, 23 Apr 2018 06:10:33 +0000 (11:40 +0530)]
avformat/dashenc: Set mp4 as the default format for VP9

There is a separate muxer(webmdashenc.c) for supporting VP9+webm output in DASH.
Hence in this muxer we will focus on supporting VP9 in MP4
Have verified playout support of VP9+MP4 in Chrome and Firefox.

13 months agoavformat/dashenc: Set VP9 codec string with profile, level and bitdepth
Karthick Jeyapal [Mon, 23 Apr 2018 06:10:32 +0000 (11:40 +0530)]
avformat/dashenc: Set VP9 codec string with profile, level and bitdepth

Otherwise some versions of chrome browser returns "codec not supported" error

13 months agoavformat/vpcc: Calculate VP9 level from Luma's Sample rate and Picture size
Karthick Jeyapal [Mon, 23 Apr 2018 06:10:31 +0000 (11:40 +0530)]
avformat/vpcc: Calculate VP9 level from Luma's Sample rate and Picture size

13 months agoavformat/dashdec: fix compling warning "filename is deprecated"
Steven Liu [Thu, 26 Apr 2018 08:17:15 +0000 (16:17 +0800)]
avformat/dashdec: fix compling warning "filename is deprecated"

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
13 months agofix memory leak of parsing dash MPD
guikunzhi [Thu, 26 Apr 2018 04:40:52 +0000 (12:40 +0800)]
fix memory leak of parsing dash MPD

Signed-off-by: guikunzhi <guikunzhi@163.com>
13 months agoavcodec/error_resilience: Fix integer overflow in filter181()
Michael Niedermayer [Sun, 22 Apr 2018 19:46:05 +0000 (21:46 +0200)]
avcodec/error_resilience: Fix integer overflow in filter181()

Fixes: runtime error: signed integer overflow: 197710 * 10923 cannot be represented in type 'int'
Fixes: 7010/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5667127596941312

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/h263dec: Check slice_ret in mspeg4 slice loop
Michael Niedermayer [Sun, 22 Apr 2018 19:07:45 +0000 (21:07 +0200)]
avcodec/h263dec: Check slice_ret in mspeg4 slice loop

Fixes infinite loop
Fixes: 6858/clusterfuzz-testcase-ffmpeg_AV_CODEC_ID_MSMPEG4V3_fuzzer-4681563766784000
Fixes: 6890/clusterfuzz-testcase-ffmpeg_AV_CODEC_ID_WMV1_fuzzer-4756103142309888

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/h2645_parse: Replace RNXYA by RNXY in ff_h2645_extract_rbsp()
Michael Niedermayer [Sat, 10 Mar 2018 20:32:51 +0000 (21:32 +0100)]
avcodec/h2645_parse: Replace RNXYA by RNXY in ff_h2645_extract_rbsp()

Fixes misaligned accesses
Found-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/elsdec: Fix memleaks
Michael Niedermayer [Tue, 24 Apr 2018 23:54:17 +0000 (01:54 +0200)]
avcodec/elsdec: Fix memleaks

Fixes: 6798/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G2M_fuzzer-5135899701542912

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/vc1: more corrections for AC inverse quantization scaling
Jerome Borsboom [Wed, 25 Apr 2018 18:07:53 +0000 (20:07 +0200)]
avcodec/vc1: more corrections for AC inverse quantization scaling

HALFQP should only be added to the inverse quantizer when the block is
coded with PQUANT. When PQUANT is equal to ALTPQUANT, the original test
for the addition of HALFQP fails. A negative value for mquant indicates
that the value was derived from VOPDQUANT.

Fixes #4372

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agoavcodec/vc1: correct forgotten v->blocks_off
Jerome Borsboom [Mon, 23 Apr 2018 19:00:33 +0000 (21:00 +0200)]
avcodec/vc1: correct forgotten v->blocks_off

correct forgotten v->blocks_off

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agoavcodec/vc1: correct AC inverse quantization scaling
Jerome Borsboom [Mon, 23 Apr 2018 19:00:15 +0000 (21:00 +0200)]
avcodec/vc1: correct AC inverse quantization scaling

HALFQP should only be added to the inverse quantizer when the block is
coded with PQUANT. See 8.1.3.8 in VC-1 spec.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agoavcodec/vc1: correct mspel for field-interlace B frames
Jerome Borsboom [Mon, 23 Apr 2018 19:00:08 +0000 (21:00 +0200)]
avcodec/vc1: correct mspel for field-interlace B frames

mspel indicates the use of bicubic interpolation. The check wrongly included
MVMODE MV_PMODE_1MV_HPEL as using bilinear interpolation.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agoavcodec/vc1: remove unused overlap smooting and loop filter
Jerome Borsboom [Mon, 23 Apr 2018 19:00:02 +0000 (21:00 +0200)]
avcodec/vc1: remove unused overlap smooting and loop filter

remove unused overlap smooting and loop filter

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agoavcodec/vc1: add overlap smooting and loop filter for frame/field-interlace
Jerome Borsboom [Mon, 23 Apr 2018 18:59:55 +0000 (20:59 +0200)]
avcodec/vc1: add overlap smooting and loop filter for frame/field-interlace

Add previously omitted overlap smooting and loop filtering for
frame/field-interlace pictures. For progressive pictures switch to the
re-implemented versions of overlap smooting and loop filtering.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agoavcodec/vc1: re-implement vc1_put_signed_blocks_clamped
Jerome Borsboom [Mon, 23 Apr 2018 18:59:49 +0000 (20:59 +0200)]
avcodec/vc1: re-implement vc1_put_signed_blocks_clamped

The existing implementation only used vc1_put_signed_blocks_clamped for I and
BI frames. This rewritten version is also applicable to P frame both
progressive and frame/field-interlace.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agoavcodec/vc1: implement interlaced out-of-bounds reference pixel replication
Jerome Borsboom [Mon, 23 Apr 2018 18:59:41 +0000 (20:59 +0200)]
avcodec/vc1: implement interlaced out-of-bounds reference pixel replication

The existing implementation did out-of-bounds reference pixel replication for
progressive reference frames. In interlaced reference frames both the even and
odd line on the horizontal edges need to be replicated.

Fixes #3262.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agoavcodec/vc1: correct ff_vc1_dqscale
Jerome Borsboom [Mon, 23 Apr 2018 18:59:28 +0000 (20:59 +0200)]
avcodec/vc1: correct ff_vc1_dqscale

According to VC-1 spec table 74, the last value in ff_vc1_dqscale should be
0x1041 instead of 0x1000.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agoavcodec/vc1: correct ff_vc1_mbmode_intfrp
Jerome Borsboom [Mon, 23 Apr 2018 18:59:20 +0000 (20:59 +0200)]
avcodec/vc1: correct ff_vc1_mbmode_intfrp

According to VC-1 spec 10.7.3.4, FIELDTX shall be set to the same type as the
motion vector for zero-coded blocks.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agoavcodec/vc1: store color-difference reference field type
Jerome Borsboom [Mon, 23 Apr 2018 18:59:13 +0000 (20:59 +0200)]
avcodec/vc1: store color-difference reference field type

The loop filter for P interlace field pictures needs the reference field type.
For luma, the reference field type was already available. Store the reference
field type for color-difference as well.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agoavcodec/vc1: store additional bitstream elements during MB decoding
Jerome Borsboom [Mon, 23 Apr 2018 18:58:59 +0000 (20:58 +0200)]
avcodec/vc1: store additional bitstream elements during MB decoding

The new loop filter needs additional MB properties to make its filtering
decisions.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agoavcodec/vc1: re-implement and expand VC-1 loop filtering
Jerome Borsboom [Mon, 23 Apr 2018 18:58:52 +0000 (20:58 +0200)]
avcodec/vc1: re-implement and expand VC-1 loop filtering

The existing implementation did loop filtering for progressive
frames only. This rewritten version implements loop filtering for
all applicable frame types for both progessive and
frame/field-interlace.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agoavcodec/vc1: change to using v->block instead of s->block for P frames
Jerome Borsboom [Mon, 23 Apr 2018 18:58:41 +0000 (20:58 +0200)]
avcodec/vc1: change to using v->block instead of s->block for P frames

The new overlap smooting filter smoothes image pixels stored in v->block.
Switch to v->block instead of s->block for storing decoded image pixels for P
frames. Additionally, we must take incrementing *_blk_idx out of the
vc1_put_signed_blocks_clamped function.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agoavcodec/vc1: re-implement and expand VC-1 overlap smoothing
Jerome Borsboom [Mon, 23 Apr 2018 18:58:31 +0000 (20:58 +0200)]
avcodec/vc1: re-implement and expand VC-1 overlap smoothing

The existing implementation did overlap smoothing for progressive
frames only. This rewritten version implements overlap smoothing
for all applicable frame types for both progessive and
frame/field-interlace.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agoavcodec/cbs_mpeg2: use memcpy when assembling fragments
James Almer [Tue, 24 Apr 2018 02:39:54 +0000 (23:39 -0300)]
avcodec/cbs_mpeg2: use memcpy when assembling fragments

before:
419022 decicycles in assemble_fragment,    2047 runs,      1 skips

after:
104621 decicycles in assemble_fragment,    2045 runs,      3 skips

Benched with a 2 minutes long 720x480 DVD mpeg2 sample.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
13 months agoavcodec/mpeg4_unpack_bframes: cache input packets directly
James Almer [Wed, 21 Mar 2018 00:59:10 +0000 (21:59 -0300)]
avcodec/mpeg4_unpack_bframes: cache input packets directly

Avoids unnecessary allocs+copies and makes the code slightly simpler.

Signed-off-by: James Almer <jamrial@gmail.com>
13 months agoavcodec/mediacodecdec: refactor pts handling
Aman Gupta [Tue, 24 Apr 2018 20:51:15 +0000 (13:51 -0700)]
avcodec/mediacodecdec: refactor pts handling

Also fixes a bug where EOS buffer was sent with incorrect
pts when not using surface generation.

Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Aman Gupta <aman@tmm1.net>
13 months agoavcodec/mediacodecdec: use AV_TIME_BASE_Q
Aman Gupta [Tue, 24 Apr 2018 20:45:30 +0000 (13:45 -0700)]
avcodec/mediacodecdec: use AV_TIME_BASE_Q

Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Aman Gupta <aman@tmm1.net>
13 months agoavcodec/mediacodecdec: clarify delay_flush specific code
Aman Gupta [Tue, 24 Apr 2018 02:21:19 +0000 (19:21 -0700)]
avcodec/mediacodecdec: clarify delay_flush specific code

As of 2a0eb8685, ff_mediacodec_dec_is_flushing() only returns
true in delay_flush mode. Make this more obvious by adding
delay_flush to the if statement.

Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Aman Gupta <aman@tmm1.net>
13 months agoavformat/yuv4mpegdec: fix seeking backwards
Paul B Mahol [Wed, 25 Apr 2018 16:30:46 +0000 (18:30 +0200)]
avformat/yuv4mpegdec: fix seeking backwards

Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 months agoavfiler/vf_mix: fix crash with >8 bit depth
Paul B Mahol [Wed, 25 Apr 2018 12:08:21 +0000 (14:08 +0200)]
avfiler/vf_mix: fix crash with >8 bit depth

Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 months agomake swresample optional for ffmpeg
Paul B Mahol [Thu, 12 Apr 2018 20:15:05 +0000 (22:15 +0200)]
make swresample optional for ffmpeg

Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 months agoavcodec/vc1_block: simplify ac_val computation
Michael Niedermayer [Mon, 23 Apr 2018 00:08:10 +0000 (02:08 +0200)]
avcodec/vc1_block: simplify ac_val computation

also fixes: runtime error: index 1456 out of bounds for type 'int16_t [16]'

Found-by: durandal_1707
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/clearvideo: display warning if decoder overreads input
Paul B Mahol [Tue, 24 Apr 2018 15:20:26 +0000 (17:20 +0200)]
avcodec/clearvideo: display warning if decoder overreads input

Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 months agoavcodec/clearvideo: do not try to return frame when it is same as previous one
Paul B Mahol [Tue, 24 Apr 2018 15:10:26 +0000 (17:10 +0200)]
avcodec/clearvideo: do not try to return frame when it is same as previous one

Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 months agoavcodec/ffv1enc: Check that the crc + version combination is supported
Michael Niedermayer [Sat, 21 Apr 2018 20:19:31 +0000 (22:19 +0200)]
avcodec/ffv1enc: Check that the crc + version combination is supported

The crc flag is only stored since version 3 thus before this crcs do not
work. We increase the version as needed same as we do with pix_fmts

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/vaapi: do not parse MVMODE for VC-1 interlaced frame pictures
Jerome Borsboom [Thu, 29 Mar 2018 11:43:34 +0000 (13:43 +0200)]
avcodec/vaapi: do not parse MVMODE for VC-1 interlaced frame pictures

Interlaced frame pictures do not contain the MVMODE or MVMODE2 bitstream
element. Trying to parse this element and passing a nonzero value to the
hardware decoder results in small inaccuracies in the decoded picture.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agoavcodec/vc1: check return value of bitplane_decoding()
Paul B Mahol [Sun, 22 Apr 2018 22:05:20 +0000 (00:05 +0200)]
avcodec/vc1: check return value of bitplane_decoding()

Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 months agoavfilter/vf_interlace: remove duplicate code with same funcionality
Vasile Toncu [Tue, 17 Apr 2018 10:48:28 +0000 (13:48 +0300)]
avfilter/vf_interlace: remove duplicate code with same funcionality

13 months agoRevert "libavformat: add mbedTLS based TLS"
Rostislav Pehlivanov [Mon, 23 Apr 2018 19:28:50 +0000 (20:28 +0100)]
Revert "libavformat: add mbedTLS based TLS"

This reverts commit 62f5c9d68bf6e0f2c1a47cf002629a70a82274fc,
which was pushed a bit prematurely.

13 months agolibavformat: add mbedTLS based TLS
Thomas Volkert [Sat, 21 Apr 2018 13:53:31 +0000 (15:53 +0200)]
libavformat: add mbedTLS based TLS

13 months agolavf/os_support: Only compile inet_aton() if getaddrinfo() is needed.
Carl Eugen Hoyos [Sun, 15 Apr 2018 23:28:47 +0000 (01:28 +0200)]
lavf/os_support: Only compile inet_aton() if getaddrinfo() is needed.

Silences a warning:
libavformat/os_support.c:49:12: warning: 'inet_aton' defined but not used

Reported-by: Reino Wijnsma
13 months agoavformat/vpcc: add ff_isom_get_vpcc_features()
James Almer [Sat, 13 Jan 2018 19:04:55 +0000 (16:04 -0300)]
avformat/vpcc: add ff_isom_get_vpcc_features()

Should be useful for muxers that require values as defined in the
vpcc atom but don't need to write the atom itself.

Signed-off-by: James Almer <jamrial@gmail.com>
13 months agoswscale/swscale_unscaled : add X86_64 (SSE2 and AVX) for uyvyto422
Martin Vignali [Sun, 22 Apr 2018 17:14:23 +0000 (19:14 +0200)]
swscale/swscale_unscaled : add X86_64 (SSE2 and AVX) for uyvyto422

and checkasm test

13 months agoavcodec/prores_ks : use official quant_matrix (for proxy and xq codec luma and chroma...
Martin Vignali [Fri, 13 Apr 2018 18:50:18 +0000 (20:50 +0200)]
avcodec/prores_ks : use official quant_matrix (for proxy and xq codec luma and chroma quant matrix is not the same)

disable the use of the official luma xq matrix for now (output
appear to be desaturate)

13 months agoavformat/dsfdec: fix calculation of size of data chunk
Paul B Mahol [Sun, 22 Apr 2018 11:14:26 +0000 (13:14 +0200)]
avformat/dsfdec: fix calculation of size of data chunk

Ignore extra 12 bytes that belong to tag and size.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 months agoavformat/dsfdec: properly handle padded last packet
Paul B Mahol [Sun, 22 Apr 2018 09:52:32 +0000 (11:52 +0200)]
avformat/dsfdec: properly handle padded last packet

Fixes #5489.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 months agodoc/examples/filtering_audio: Remove setting deprecated refcounted_frames
Jun Zhao [Sat, 21 Apr 2018 07:36:59 +0000 (15:36 +0800)]
doc/examples/filtering_audio: Remove setting deprecated refcounted_frames

When use new decode APIs(avcodec_send_packet/avcodec_receive_frame),
don't need to setting the deprecated field refcounted_frames.

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
13 months agodoc/examples/filtering_video: Remove setting deprecated refcounted_frames
Jun Zhao [Sat, 21 Apr 2018 07:34:23 +0000 (15:34 +0800)]
doc/examples/filtering_video: Remove setting deprecated refcounted_frames

When use new decode APIs(avcodec_send_packet/avcodec_receive_frame),
don't need to setting the deprecated field refcounted_frames.

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
13 months agodoc/examples/hw_decode: Remove setting deprecated refcounted_frames
Jun Zhao [Sat, 21 Apr 2018 07:28:27 +0000 (15:28 +0800)]
doc/examples/hw_decode: Remove setting deprecated refcounted_frames

When use new decode APIs(avcodec_send_packet/avcodec_receive_frame),
don't need to setting the deprecated field refcounted_frames.

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
13 months agoavformat/segafilm - revert keyframe detection
Gyan Doshi [Sat, 21 Apr 2018 07:14:12 +0000 (12:44 +0530)]
avformat/segafilm - revert keyframe detection

Keyframe detection was inverted in cfe1a9d311 in order to fix keyframe
flags set for the sample attached to trac #7091. However, that sample is
errantly muxed.

As noted at
https://web.archive.org/web/20020803104640/http://www.pcisys.net:80/~melanson/codecs/film-format.txt,
the original keyframe detection logic is correct, and this patch
restores it.

Signed-off-by: James Almer <jamrial@gmail.com>
13 months agoavcodec/vc1_pred: set ref_field_type earlier
Jerome Borsboom [Sat, 21 Apr 2018 19:05:28 +0000 (21:05 +0200)]
avcodec/vc1_pred: set ref_field_type earlier

scaleforsame_y references ref_field_type. Therefore, it needs to be set
before scaleforsame is called.

Fixes #2557.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agolavf/dashdec: Do not use memcpy() to copy a struct.
Carl Eugen Hoyos [Wed, 18 Apr 2018 17:42:57 +0000 (19:42 +0200)]
lavf/dashdec: Do not use memcpy() to copy a struct.

Fixes a warning:
libavformat/dashdec.c:1900:65: warning: argument to 'sizeof' in 'memcpy' call is the same pointer type 'struct fragment *' as the destination; expected 'struct fragment' or an explicit length

13 months agolavf/qsv: clone the frame which may be managed by framework
Ruiling Song [Tue, 3 Apr 2018 01:50:20 +0000 (09:50 +0800)]
lavf/qsv: clone the frame which may be managed by framework

For filters based on framesync, the input frame was managed
by framesync, so we should not directly keep and destroy it,
instead we make a clone of it here, or else double-free will occur.
But for other filters not based on framesync, we still need to
free the input frame inside filter_frame.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
13 months agolavf: make overlay_qsv work based on framesync
Ruiling Song [Tue, 3 Apr 2018 01:50:19 +0000 (09:50 +0800)]
lavf: make overlay_qsv work based on framesync

The existing version which was cherry-picked from Libav does not work
with FFmpeg framework, because ff_request_frame() was totally
different between Libav (recursive) and FFmpeg (non-recursive).
The existing overlay_qsv implementation depends on the recursive version
of ff_request_frame to trigger immediate call to request_frame() on input pad.
But this has been removed in FFmpeg since "lavfi: make request_frame() non-recursive."
Now that we have handy framesync support in FFmpeg, so I make it work
based on framesync. Some other fixing which is also needed to make
overlay_qsv work are put in a separate patch.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
13 months agoavfilter: add deblock filter
Paul B Mahol [Tue, 17 Apr 2018 15:33:00 +0000 (17:33 +0200)]
avfilter: add deblock filter

Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 months agoavformat/mov: Fix parsing of saio/siaz atoms in encrypted content.
Jacob Trimble [Thu, 7 Dec 2017 00:17:54 +0000 (16:17 -0800)]
avformat/mov: Fix parsing of saio/siaz atoms in encrypted content.

This doesn't support saio atoms with more than one offset.

Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavformat/utils: refactor upstream_stream_timings
Aman Gupta [Thu, 19 Apr 2018 23:50:43 +0000 (16:50 -0700)]
avformat/utils: refactor upstream_stream_timings

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavformat/utils: ignore outlier durations on subtitle/data streams as well
Aman Gupta [Thu, 19 Apr 2018 20:29:24 +0000 (13:29 -0700)]
avformat/utils: ignore outlier durations on subtitle/data streams as well

Similar to 4c9c4fe8b21, but for durations. This fixes #7151, where
the report duration and bitrate on a mpegts stream is wildly off
due to the dvb_teletext stream's timings.

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavformat/http: flushing tcp receive buffer when it is write only mode
Vishwanath Dixit [Wed, 4 Apr 2018 11:08:18 +0000 (16:38 +0530)]
avformat/http: flushing tcp receive buffer when it is write only mode

In write only mode, the TCP receive buffer's data keeps growing with
http response messages and the buffer eventually becomes full.
This results in zero tcp window size, which in turn causes unwanted
issues, like, terminated tcp connection. The issue is apparent when
http persistent connection is enabled in hls/dash live streaming use
cases. To overcome this issue, the logic here reads the buffer data
when a file transfer is completed, so that any accumulated data in
the recieve buffer gets flushed out.

13 months agoavformat/dashenc: change the hls version from 6 to 7
Steven Liu [Fri, 20 Apr 2018 03:29:35 +0000 (11:29 +0800)]
avformat/dashenc: change the hls version from 6 to 7

reference hls support fmp4 file from  draft-pantos-http-live-streaming-20
the spec describes version 7 of hls protocol

Suggested-by: Ronak <ronak2121@yahoo.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
13 months agolavf/http.c: Free allocated client URLContext in case of error.
Stephan Holljes [Fri, 12 Jan 2018 18:16:29 +0000 (19:16 +0100)]
lavf/http.c: Free allocated client URLContext in case of error.

Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavdevice/android_camera: Fix AVClass.version
Michael Niedermayer [Thu, 19 Apr 2018 21:44:33 +0000 (23:44 +0200)]
avdevice/android_camera: Fix AVClass.version

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec: Fix AVClass .version
Michael Niedermayer [Thu, 19 Apr 2018 21:44:13 +0000 (23:44 +0200)]
avcodec: Fix AVClass .version

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/sheervideodata: Fix libavutil include
Michael Niedermayer [Thu, 19 Apr 2018 21:34:11 +0000 (23:34 +0200)]
avcodec/sheervideodata: Fix libavutil include

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/sbc: Fix non static function prefix
Michael Niedermayer [Thu, 19 Apr 2018 21:32:07 +0000 (23:32 +0200)]
avcodec/sbc: Fix non static function prefix

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/opusenc_psy: Fix warning: ISO C90 forbids mixed declarations and code
Michael Niedermayer [Thu, 19 Apr 2018 21:28:26 +0000 (23:28 +0200)]
avcodec/opusenc_psy: Fix warning: ISO C90 forbids mixed declarations and code

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/dsicinvideo: Fail if there is only a small fraction of the data available...
Michael Niedermayer [Mon, 16 Apr 2018 20:29:09 +0000 (22:29 +0200)]
avcodec/dsicinvideo: Fail if there is only a small fraction of the data available that comprises a full frame

Fixes: Timeout
Fixes: 6306/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DSICINVIDEO_fuzzer-5079253549842432

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/dsicinvideo: Propagate errors from cin_decode_rle()
Michael Niedermayer [Mon, 16 Apr 2018 20:28:23 +0000 (22:28 +0200)]
avcodec/dsicinvideo: Propagate errors from cin_decode_rle()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/dfa: Check dimension against maximum
Michael Niedermayer [Mon, 16 Apr 2018 20:04:53 +0000 (22:04 +0200)]
avcodec/dfa: Check dimension against maximum

The headers from where the dimensions are read in actual files
are limited to 16bit per component.

Fixes: Timeout
Fixes: 6305/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DFA_fuzzer-4824270749302784

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/cinepak: Skip empty frames
Michael Niedermayer [Tue, 17 Apr 2018 00:13:43 +0000 (02:13 +0200)]
avcodec/cinepak: Skip empty frames

Speeds up decoding from 3 to 0.1 seconds for 6302/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CINEPAK_fuzzer-5626371985375232
Fixes: Timeout

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/cinepak: move some checks prior to frame allocation
Michael Niedermayer [Tue, 17 Apr 2018 00:13:42 +0000 (02:13 +0200)]
avcodec/cinepak: move some checks prior to frame allocation

Speeds up decoding from 8 to 3 seconds for 6302/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CINEPAK_fuzzer-5626371985375232
Fixes: Timeout

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agolibavformat/http: Refactor and fix additional leaks in get_cookies.
Richard Shaffer [Thu, 19 Apr 2018 19:55:00 +0000 (12:55 -0700)]
libavformat/http: Refactor and fix additional leaks in get_cookies.

This refactors get_cookies to simplify some code paths, specifically for
skipping logic in the while loop or exiting it. It also simplifies the logic
for appending additional values to *cookies by replacing strlen/malloc/snprintf
with one call av_asnprintf.

This refactor fixes a bug where the cookie_params AVDictionary would get leaked
if we failed to allocate a new buffer for writing to *cookies.

13 months agoswresample/arm: remove unintentional relocation.
Rahul Chaudhry [Wed, 18 Apr 2018 23:29:39 +0000 (16:29 -0700)]
swresample/arm: remove unintentional relocation.

Branch to global symbol results in reference to PLT, and when compiling
for THUMB-2 - in a R_ARM_THM_JUMP19 relocation. Some linkers don't
support this relocation (ld.gold), while others can end up truncating
the relocation to fit (ld.bfd).

Convert this branch through PLT into a direct branch that the assembler
can resolve locally.

See https://github.com/android-ndk/ndk/issues/337 for background.

The current workaround is to disable neon during gstreamer build,
which is not optimal and can be reverted after this patch:
https://github.com/freedesktop/gstreamer-cerbero/commit/41556c415739fbc3a72c7eaee7e70a565b719b2f

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavformat/mov: Remove old encryption info methods.
Jacob Trimble [Tue, 30 Jan 2018 19:14:35 +0000 (11:14 -0800)]
avformat/mov: Remove old encryption info methods.

Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavformat/mov: Fix memory leak in encryption info.
Jacob Trimble [Thu, 19 Apr 2018 16:35:22 +0000 (09:35 -0700)]
avformat/mov: Fix memory leak in encryption info.

Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoaac: Rework extradata parsing code
Vittorio Giovara [Thu, 12 Apr 2018 21:39:50 +0000 (17:39 -0400)]
aac: Rework extradata parsing code

- enable the parsing code
- use the new buffer instead of replacing the context one
- do not push/pop configuration, just discard the exiting one
- propagate errors correctly

13 months agodoc/muxers: tee muxer - rearrange, add notes and general tidy-up
Gyan Doshi [Thu, 19 Apr 2018 12:07:20 +0000 (17:37 +0530)]
doc/muxers: tee muxer - rearrange, add notes and general tidy-up

13 months agoavcodec/mediacodecdec_common: make stride and slice-height non-mandatory fields
Matthieu Bouron [Wed, 11 Apr 2018 08:28:56 +0000 (10:28 +0200)]
avcodec/mediacodecdec_common: make stride and slice-height non-mandatory fields

Fixes decoding on the Samsung Chromebook Pro which do not set the codec
output format stride and slice-height fields.

13 months agoavformat/tls_schannel: fix handling of EOF after avio changes
Hendrik Leppkes [Wed, 18 Apr 2018 12:09:19 +0000 (14:09 +0200)]
avformat/tls_schannel: fix handling of EOF after avio changes