ffmpeg.git
2 years agoavcodec/htmlsubtitles: Be a bit more picky on syntax
Michael Niedermayer [Sat, 1 Jul 2017 22:09:42 +0000 (00:09 +0200)]
avcodec/htmlsubtitles: Be a bit more picky on syntax

This reduces the number of strstr() calls per byte
This diasalows empty tags like '< >' as well as '<' in tags like '<ab<cd<<ef>'

Fixes timeout
Fixes: 1817/clusterfuzz-testcase-minimized-5104230530547712

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/aacdec_template (fixed point): Check gain in decode_cce() to avoid undefined...
Michael Niedermayer [Sat, 15 Jul 2017 20:22:52 +0000 (22:22 +0200)]
avcodec/aacdec_template (fixed point): Check gain in decode_cce() to avoid undefined shifts later

Fixes: runtime error: shift exponent 47 is too large for 32-bit type 'int'
Fixes: 2581/clusterfuzz-testcase-minimized-4681474395602944

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 agoopus: simplify coarse energy beta coefficients
Rostislav Pehlivanov [Tue, 18 Jul 2017 19:47:30 +0000 (20:47 +0100)]
opus: simplify coarse energy beta coefficients

Just put the subtraction in the table.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2 years agoavdevice/decklink_dec: add support for receiving op47 teletext
Marton Balint [Sun, 18 Jun 2017 00:34:11 +0000 (02:34 +0200)]
avdevice/decklink_dec: add support for receiving op47 teletext

v2:
- use uint16_t instead of int to store 10-bit ancillary data
- fix ancillary line numbers for 1080p
- some comments and clarifications as requested by Aaron Levinson

Signed-off-by: Marton Balint <cus@passwd.hu>
2 years agoavdevice/decklink_dec: add support for decoding teletext from 10bit ancillary data
Marton Balint [Sat, 24 Jun 2017 14:57:18 +0000 (16:57 +0200)]
avdevice/decklink_dec: add support for decoding teletext from 10bit ancillary data

This also add supports for 4K DeckLink cards because they always output the
ancillary data in 10-bit.

v2:
- only try teletext decoding for 576i PAL mode
- some comments as requested by Aaron Levinson

Signed-off-by: Marton Balint <cus@passwd.hu>
2 years agolavc/jpeg2000dec: Read the sample aspect ratio from the jp2 resolution box.
Carl Eugen Hoyos [Tue, 2 May 2017 14:27:47 +0000 (16:27 +0200)]
lavc/jpeg2000dec: Read the sample aspect ratio from the jp2 resolution box.

2 years agoffprobe: reindent after previous commit
Clément Bœsch [Tue, 18 Jul 2017 08:24:55 +0000 (10:24 +0200)]
ffprobe: reindent after previous commit

2 years agoffprobe: add -(no)find_stream_info expert option
Clément Bœsch [Wed, 12 Jul 2017 09:06:53 +0000 (11:06 +0200)]
ffprobe: add -(no)find_stream_info expert option

2 years agoffplay: reindent after previous commit
Clément Bœsch [Tue, 18 Jul 2017 08:24:48 +0000 (10:24 +0200)]
ffplay: reindent after previous commit

2 years agoffplay: add -(no)find_stream_info expert option
Clément Bœsch [Wed, 12 Jul 2017 09:06:54 +0000 (11:06 +0200)]
ffplay: add -(no)find_stream_info expert option

2 years agoffmpeg: reindent after previous commit
Clément Bœsch [Tue, 18 Jul 2017 08:24:40 +0000 (10:24 +0200)]
ffmpeg: reindent after previous commit

2 years agoffmpeg: add -(no)find_stream_info expert option
Clément Bœsch [Wed, 12 Jul 2017 09:06:52 +0000 (11:06 +0200)]
ffmpeg: add -(no)find_stream_info expert option

2 years agoopusenc: remove unused variable
Rostislav Pehlivanov [Tue, 18 Jul 2017 03:12:59 +0000 (04:12 +0100)]
opusenc: remove unused variable

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2 years agoconfigure: Fix libvmaf name
Matt Oliver [Sun, 16 Jul 2017 14:15:19 +0000 (00:15 +1000)]
configure: Fix libvmaf name

Fixes:
    fatal error: libvmaf.h: No such file or directory.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agowebmdashenc: Fix memory leak
Derek Buitenhuis [Fri, 14 Jul 2017 14:32:42 +0000 (15:32 +0100)]
webmdashenc: Fix memory leak

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agoavcodec/apedec: Fix integer overflow
Michael Niedermayer [Sun, 16 Jul 2017 12:57:20 +0000 (14:57 +0200)]
avcodec/apedec: Fix integer overflow

Fixes: out of array access
Fixes: PoC.ape and others

Found-by: Bingchang, Liu@VARAS of IIE
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavfilter: add LIBVMAF filter
Ashish Singh [Sat, 15 Jul 2017 16:42:33 +0000 (22:12 +0530)]
avfilter: add LIBVMAF filter

This one changes the previous vmaf patch to libvmaf to keep it separate from the
native implementation of vmaf inside ffmpeg later.

Signed-off-by: Ashish Singh <ashk43712@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2 years agoavcodec/ffv1dec_template: Fix signed integer overflow
Michael Niedermayer [Sun, 16 Jul 2017 00:08:50 +0000 (02:08 +0200)]
avcodec/ffv1dec_template: Fix signed integer overflow

Fixes: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 2634/clusterfuzz-testcase-minimized-4540890636877824

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/aacdec_template: Fix undefined integer overflow in apply_tns()
Michael Niedermayer [Thu, 13 Jul 2017 22:45:29 +0000 (00:45 +0200)]
avcodec/aacdec_template: Fix undefined integer overflow in apply_tns()

Fixes: runtime error: signed integer overflow: -2147483648 - 1202286525 cannot be represented in type 'int'
Fixes: 2071/clusterfuzz-testcase-minimized-6036414271586304

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 agofate: add sub-srt-badsyntax test
Michael Niedermayer [Tue, 11 Jul 2017 21:16:43 +0000 (23:16 +0200)]
fate: add sub-srt-badsyntax test

Based-on: srt sample by ubitux

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agohdsenc: Remove dead store
Derek Buitenhuis [Thu, 6 Jul 2017 17:41:44 +0000 (13:41 -0400)]
hdsenc: Remove dead store

This is apparently not supposed to error out anyway.

Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agoopusenc: use float_dsp for non-transient windowing
Rostislav Pehlivanov [Fri, 14 Jul 2017 03:50:07 +0000 (04:50 +0100)]
opusenc: use float_dsp for non-transient windowing

Also fixes transient windowing

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2 years agoavutil/threadmessage: fix error return in case of av_fifo_alloc failure
Aleksandr Slobodeniuk [Wed, 12 Jul 2017 18:41:56 +0000 (21:41 +0300)]
avutil/threadmessage: fix error return in case of av_fifo_alloc failure

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec: Add prefetch for mips
Kaustubh Raste [Wed, 12 Jul 2017 12:02:32 +0000 (17:32 +0530)]
avcodec: Add prefetch for mips

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 agox86/vf_limiter: make limiter functions work on x86_32
James Almer [Sat, 8 Jul 2017 14:33:54 +0000 (11:33 -0300)]
x86/vf_limiter: make limiter functions work on x86_32

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agocheckasm: add hybrid_analysis_ileave and hybrid_synthesis_deint tests to aacpsdsp
James Almer [Thu, 6 Jul 2017 23:47:14 +0000 (20:47 -0300)]
checkasm: add hybrid_analysis_ileave and hybrid_synthesis_deint tests to aacpsdsp

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agocheckasm: add a g722dsp test
James Almer [Wed, 5 Jul 2017 19:34:00 +0000 (16:34 -0300)]
checkasm: add a g722dsp test

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoopusenc: use float_dsp for transient mdcts
Rostislav Pehlivanov [Wed, 12 Jul 2017 03:49:21 +0000 (04:49 +0100)]
opusenc: use float_dsp for transient mdcts

vector_fmul_reverse requires padding the window at the front

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2 years agomovenc: Add 'keywords' metadata
Kieran O'Leary [Mon, 10 Jul 2017 21:54:56 +0000 (22:54 +0100)]
movenc: Add 'keywords' metadata

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agoconfigure: use pkg-config for libgme, if available
Ricardo Constantino [Fri, 23 Jun 2017 00:53:37 +0000 (01:53 +0100)]
configure: use pkg-config for libgme, if available

The pkg-config file is relatively new (2013), so some distros might
not have it yet. And the -lstdc++ being required for the static lib
is only present since the last release in December 2016.

2 years agoavcodec/ivi: Use av_image_check_size2()
Michael Niedermayer [Wed, 12 Jul 2017 18:31:24 +0000 (20:31 +0200)]
avcodec/ivi: Use av_image_check_size2()

Fixes OOM
Fixes: 1514/clusterfuzz-testcase-minimized-6437666243477504

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/magicyuv: Check that vlc len is not too large
Michael Niedermayer [Wed, 12 Jul 2017 15:25:16 +0000 (17:25 +0200)]
avcodec/magicyuv: Check that vlc len is not too large

Fixes: runtime error: shift exponent -95 is negative
Fixes: 2568/clusterfuzz-testcase-minimized-4926115716005888

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/mjpegdec: Clip DC also on the negative side.
Michael Niedermayer [Wed, 12 Jul 2017 14:24:18 +0000 (16:24 +0200)]
avcodec/mjpegdec: Clip DC also on the negative side.

Fixes: runtime error: signed integer overflow: -16711425 + -2130772346 cannot be represented in type 'int'
Fixes: 2533/clusterfuzz-testcase-minimized-5372857678823424

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/aacps (fixed point): Fix multiple signed integer overflows
Michael Niedermayer [Sun, 9 Jul 2017 13:19:18 +0000 (15:19 +0200)]
avcodec/aacps (fixed point): Fix multiple signed integer overflows

Fixes: runtime error: signed integer overflow: 1421978265 - -1810326882 cannot be represented in type 'int'
Fixes: 2527/clusterfuzz-testcase-minimized-5260915396050944

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 agopthread_frame: save the FF_DEBUG_THREADS option in PerThreadContext.
Wan-Teh Chang [Mon, 10 Jul 2017 17:24:59 +0000 (10:24 -0700)]
pthread_frame: save the FF_DEBUG_THREADS option in PerThreadContext.

Add the debug_threads boolean field to PerThreadContext. For
PerThreadContext *p, p->debug_threads records whether the
FF_DEBUG_THREADS bit is set in p->avctx->debug, and p->debug_threads and
p->avctx->debug are kept in sync. The debug_threads field is defined as
an atomic_int to allow atomic read by another thread in
ff_thread_await_progress().

This fixes the tsan warning that
2e664b9c1e73c80aab91070c1eb7676f04bdd12d attempted to fix:

WARNING: ThreadSanitizer: data race (pid=452658)
  Write of size 4 at 0x7b640003f4fc by main thread (mutexes: write M248499):
    #0 update_context_from_user [..]/libavcodec/pthread_frame.c:335:19 (5ab42bb1a6f4b068d7863dabe9b2bacc+0xe73859)
[..]
  Previous read of size 4 at 0x7b640003f4fc by thread T130 (mutexes: write M248502, write M248500):
    #0 ff_thread_await_progress [..]/libavcodec/pthread_frame.c:591:26 (5ab42bb1a6f4b068d7863dabe9b2bacc+0xe749a1)

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2 years agoaacdec_template: fix non-power-of-two MDCT scale sign
Rostislav Pehlivanov [Wed, 12 Jul 2017 01:15:19 +0000 (02:15 +0100)]
aacdec_template: fix non-power-of-two MDCT scale sign

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2 years agoopus_celt: normalize using mdct scale
Rostislav Pehlivanov [Tue, 11 Jul 2017 20:30:41 +0000 (21:30 +0100)]
opus_celt: normalize using mdct scale

Removes a per-sample divide in the IIR filter deemphasis filter.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2 years agomdct15: remove redundant scale argument to imdct_half
Rostislav Pehlivanov [Tue, 11 Jul 2017 20:29:22 +0000 (21:29 +0100)]
mdct15: remove redundant scale argument to imdct_half

The only use of that argument was for Opus downmixing which is very rare
and better done after the mdcts.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2 years agovideotoolbox: fix crash when decoding interlaced video with new API
wm4 [Tue, 11 Jul 2017 16:24:31 +0000 (18:24 +0200)]
videotoolbox: fix crash when decoding interlaced video with new API

2 years agoavcodec/rdft: remove sintable
Muhammad Faiz [Fri, 7 Jul 2017 07:43:39 +0000 (14:43 +0700)]
avcodec/rdft: remove sintable

It is redundant with costable. The first half of sintable is
identical with the second half of costable. The second half
of sintable is negative value of the first half of sintable.

The computation is changed to handle sign of sin values, in
C code and ARM assembly code.

Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2 years agoopus_rc: fix encoder desyncs on very low bitrates
Rostislav Pehlivanov [Mon, 10 Jul 2017 22:40:35 +0000 (23:40 +0100)]
opus_rc: fix encoder desyncs on very low bitrates

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2 years agoopusenc: don't set avctx->cutoff
Rostislav Pehlivanov [Mon, 10 Jul 2017 22:43:53 +0000 (23:43 +0100)]
opusenc: don't set avctx->cutoff

Its only use is to adjust the aac psychoacoustic/filter system which
isn't used here.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2 years agoopustab: comment ff_celt_tf_select
Rostislav Pehlivanov [Mon, 10 Jul 2017 22:39:56 +0000 (23:39 +0100)]
opustab: comment ff_celt_tf_select

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2 years agoopus_celt: move postfilter taps table to the shared opustab.c file
Rostislav Pehlivanov [Mon, 10 Jul 2017 22:31:24 +0000 (23:31 +0100)]
opus_celt: move postfilter taps table to the shared opustab.c file

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2 years agortspdec: Fix return error
Derek Buitenhuis [Thu, 6 Jul 2017 18:03:58 +0000 (14:03 -0400)]
rtspdec: Fix return error

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agodxva: DXVA2_ModeHEVC_VLD_Main10 does not support Main
wm4 [Mon, 10 Jul 2017 13:59:38 +0000 (15:59 +0200)]
dxva: DXVA2_ModeHEVC_VLD_Main10 does not support Main

This mode apparently does not support decoding of HEVC Main (8 bit).
With D3D11 and Intel drivers on Windows 10 I get green corruption, while
using DXVA2_ModeHEVC_VLD_Main works.

2 years agoavcodec/magicyuv: add 12 bit formats
Paul B Mahol [Sun, 9 Jul 2017 16:40:13 +0000 (18:40 +0200)]
avcodec/magicyuv: add 12 bit formats

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2 years agoavcodec/magicyuv: make RLE table reading match reference
Paul B Mahol [Mon, 10 Jul 2017 09:47:42 +0000 (11:47 +0200)]
avcodec/magicyuv: make RLE table reading match reference

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2 years agoavformat/avio: Remove no-op code in url_find_protocol().
Wan-Teh Chang [Fri, 7 Jul 2017 02:18:50 +0000 (19:18 -0700)]
avformat/avio: Remove no-op code in url_find_protocol().

In url_find_protocol(), proto_str is either "file" or a string
consisting of only the characters in URL_SCHEME_CHARS, which does not
include ','. Therefore the strchr(proto_str, ',') call always returns
NULL.

Note: The code was added in commit
6161c41817f6e53abb3021d67ca0f19def682718.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2 years agoavcodec/noise_bsf: add support for dropping packets
Marton Balint [Sat, 8 Jul 2017 10:37:59 +0000 (12:37 +0200)]
avcodec/noise_bsf: add support for dropping packets

Signed-off-by: Marton Balint <cus@passwd.hu>
2 years agoavcodec/ylc: Fix vlc of 31 bits
Michael Niedermayer [Sat, 8 Jul 2017 20:51:57 +0000 (22:51 +0200)]
avcodec/ylc: Fix vlc of 31 bits

Fixes: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
Fixes: 2515/clusterfuzz-testcase-minimized-6197200012967936

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/sbrdsp_fixed: Fix integer overflow in sbr_hf_apply_noise()
Michael Niedermayer [Sun, 2 Jul 2017 01:30:54 +0000 (03:30 +0200)]
avcodec/sbrdsp_fixed: Fix integer overflow in sbr_hf_apply_noise()

Fixes: runtime error: signed integer overflow: -2049425300 + -117591631 cannot be represented in type 'int'
Fixes: part of 2096/clusterfuzz-testcase-minimized-4901566068817920

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 agolibswresample: check input to swr_convert_frame for NULL
hexpointer [Fri, 7 Jul 2017 09:54:47 +0000 (10:54 +0100)]
libswresample: check input to swr_convert_frame for NULL

When 'out' is an AVFrame that does not have buffers preallocated,
swr_convert_frame tries to allocate buffers of the right size. However
in calculating this size it failed to check for whether 'in' is NULL
(requesting that swr's internal buffers are to be flushed).

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavfilter: add limiter filter
Paul B Mahol [Mon, 3 Jul 2017 15:42:03 +0000 (17:42 +0200)]
avfilter: add limiter filter

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2 years agobitstream_filter: Add missing error check
Derek Buitenhuis [Thu, 6 Jul 2017 18:11:28 +0000 (14:11 -0400)]
bitstream_filter: Add missing error check

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agoaf_amix: Add missing error check
Derek Buitenhuis [Thu, 6 Jul 2017 18:08:40 +0000 (14:08 -0400)]
af_amix: Add missing error check

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agortmpproto: Fix error return
Derek Buitenhuis [Thu, 6 Jul 2017 17:59:40 +0000 (13:59 -0400)]
rtmpproto: Fix error return

Mistake was added in 5840473890440dbe0bd2cce530ebb3d93e187ae6.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agocngenc: Remove dead store
Derek Buitenhuis [Thu, 6 Jul 2017 17:54:43 +0000 (13:54 -0400)]
cngenc: Remove dead store

ff_lpc_calc_ref_coeffs returns the order it is given and cannot return
in error.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agoffmpeg_opt: Make get_timecode actually return errors
Derek Buitenhuis [Thu, 6 Jul 2017 17:52:42 +0000 (13:52 -0400)]
ffmpeg_opt: Make get_timecode actually return errors

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agoopusdec: Remove dead code
Derek Buitenhuis [Thu, 6 Jul 2017 17:51:18 +0000 (13:51 -0400)]
opusdec: Remove dead code

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agoscpr: Added missing error check
Derek Buitenhuis [Thu, 6 Jul 2017 17:47:42 +0000 (13:47 -0400)]
scpr: Added missing error check

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agoaf_tempo: Add missing error check
Derek Buitenhuis [Thu, 6 Jul 2017 17:45:13 +0000 (13:45 -0400)]
af_tempo: Add missing error check

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agobitpacked: Remove dead store
Derek Buitenhuis [Thu, 6 Jul 2017 17:39:57 +0000 (13:39 -0400)]
bitpacked: Remove dead store

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agoavformat: remove obsolete commented-out DEBUG define
Tobias Rapp [Fri, 7 Jul 2017 07:43:22 +0000 (09:43 +0200)]
avformat: remove obsolete commented-out DEBUG define

Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agolibavcodec/htmlsubtitles.c: make tags case-insensitive
DongHoon Kang [Fri, 16 Jun 2017 11:26:37 +0000 (20:26 +0900)]
libavcodec/htmlsubtitles.c: make tags case-insensitive

Signed-off-by: DongHoon Kang <nanuda.kang@gmail.com>
Signed-off-by: Clément Bœsch <u@pkh.me>
2 years agoavcodec/fft_template: use ff_thread_once on costable initialization
Muhammad Faiz [Wed, 5 Jul 2017 05:33:22 +0000 (12:33 +0700)]
avcodec/fft_template: use ff_thread_once on costable initialization

Make it thread-safe and avoid redundant initialization.

Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2 years agoavformat/hlsenc: Add missing error check
Derek Buitenhuis [Fri, 7 Jul 2017 02:08:18 +0000 (10:08 +0800)]
avformat/hlsenc: Add missing error check

Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agoavformat/hlsenc: add warn message when use both fmp4 and single_file
Steven Liu [Fri, 7 Jul 2017 02:05:54 +0000 (10:05 +0800)]
avformat/hlsenc: add warn message when use both fmp4 and single_file

have not implementation the fmp4 single file yet before this commit.

Suggested-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Steven Liu <lq@onvideo.cn>
2 years agoffmpeg: Fix typos in the comment for decode() ("." vs. "->")
Wan-Teh Chang [Thu, 6 Jul 2017 16:42:24 +0000 (09:42 -0700)]
ffmpeg: Fix typos in the comment for decode() ("." vs. "->")

pkt is a pointer, so it should be dereferenced with the -> operator.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoh264dec: remove unneeded prototype
Rafaël Carré [Thu, 6 Jul 2017 11:04:03 +0000 (13:04 +0200)]
h264dec: remove unneeded prototype

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agompegtsenc: Don't pass NULL to memcpy
Derek Buitenhuis [Thu, 6 Jul 2017 17:23:06 +0000 (13:23 -0400)]
mpegtsenc: Don't pass NULL to memcpy

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agoconfigure: require pkg-config for libvorbis
Ricardo Constantino [Tue, 4 Jul 2017 18:01:22 +0000 (19:01 +0100)]
configure: require pkg-config for libvorbis

libvorbis comes with pkg-config files since at least v1.0.1, way back in 2003.

We need the two checks for vorbis and vorbisenc because we use functions from
both and Xiph considers them separate libraries.

The check is inverted (vorbis first then vorbisenc) because add_extralibs()
prepends to EXTRALIBS instead of appending. For both shared and static linking
the order didn't seem to matter anyway, testing with MinGW.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agoconcatdec: Do not pass NULL to memcmp
Derek Buitenhuis [Thu, 6 Jul 2017 17:15:00 +0000 (13:15 -0400)]
concatdec: Do not pass NULL to memcmp

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agohtmlsubtitles: support <br> tag
wm4 [Mon, 3 Jul 2017 11:42:44 +0000 (13:42 +0200)]
htmlsubtitles: support <br> tag

Some .srt files use this tag.

(An alternative implementation would be correctly ignoring unknown tags,
and treating them as whitespace. libass can do automatic line wrapping.)

2 years agoavcodec/interplayvideo: Clean up frames on parameter change
Michael Niedermayer [Thu, 6 Jul 2017 01:46:44 +0000 (03:46 +0200)]
avcodec/interplayvideo: Clean up frames on parameter change

Fixes: out of array access
Fixes: 2467/clusterfuzz-testcase-minimized-4755798049685504

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 agolibavformat/gdv: Fix parsing for soundless video
Azamat H. Hackimov [Sun, 2 Jul 2017 20:10:55 +0000 (01:10 +0500)]
libavformat/gdv: Fix parsing for soundless video

Added 2 byte skipping if there no sound present, that fixes playback
files without sound stream.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agomovenc: allow alternative hvc1 h.265 codec tag
John Stebbins [Thu, 15 Jun 2017 18:47:16 +0000 (11:47 -0700)]
movenc: allow alternative hvc1 h.265 codec tag

If AVCodecParameters.codec_tag is 'hvc1' use it instead of 'hev1' for
h.265 streams. QuickTime (and other Apple software) requires 'hvc1'.

(cherry picked from commit 84ab1cc437fa47a00532f305b9fe15b5b66c8c5e)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agomovenc: write correct format hvcc when tag is hvc1
John Stebbins [Thu, 15 Jun 2017 18:41:15 +0000 (11:41 -0700)]
movenc: write correct format hvcc when tag is hvc1

(cherry picked from commit 1ea9b7fdf99b60c0db95a2ce97b2108469bbb245)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agomovenc: move tags definitions to where they are used
John Stebbins [Mon, 19 Jun 2017 14:53:45 +0000 (07:53 -0700)]
movenc: move tags definitions to where they are used

(cherry picked from commit 1c64bae648eeb39c8d8a8d81ee142b9eec9fae7b)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agomovenc: simplify codec_tag lookup
John Stebbins [Mon, 19 Jun 2017 14:46:48 +0000 (07:46 -0700)]
movenc: simplify codec_tag lookup

mux.c init_muxer() already sets codec_tag correctly in the cases
simplified here.

This also adds the capability to support alternative tags for the
same codec_id.

(cherry picked from commit f6f86f432fe51526a7aad2bdb025d6a45d239883)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agofate: add fate-checkasm-sbrdsp target
James Almer [Wed, 5 Jul 2017 19:54:10 +0000 (16:54 -0300)]
fate: add fate-checkasm-sbrdsp target

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoRevert "x86/sbrdsp: remove unnecessary sign extend instruction in apply_noise_main"
James Almer [Wed, 5 Jul 2017 13:28:03 +0000 (10:28 -0300)]
Revert "x86/sbrdsp: remove unnecessary sign extend instruction in apply_noise_main"

This reverts commit 24bb7db4037876c5722b0eecf7412502e7225634.

noise has to after all be sign extended, not zero extended, on tests
other than checkasm.
Fixes most aac tests broken by the now reverted commit.

2 years agoavformat/hlsenc: copy codec_tag when stream copy
Steven Liu [Wed, 5 Jul 2017 03:20:21 +0000 (11:20 +0800)]
avformat/hlsenc: copy codec_tag when stream copy

when use fmp4 segment type in hls and use codec copy,
there have an error message.
error message:
   [mp4 @ 0x25df020] Tag avc1 incompatible with output codec id '28' ([33][0][0][0])
   [hls @ 0x2615c80] Some of the provided format options in '(null)' are not recognized
   Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
this patch can fix it.

Signed-off-by: Liu Qi <w_liuqi@kingsoft.com>
Signed-off-by: Steven Liu <lq@onvideo.cn>
2 years agoavformat/hlsenc: optimize help message default value.
Steven Liu [Wed, 5 Jul 2017 03:15:20 +0000 (11:15 +0800)]
avformat/hlsenc: optimize help message default value.

show the hls_segment_type default always 0, show the flag name better

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2 years agoavcodec/hevcdec: do not let updated extradata corrupt state
Michael Niedermayer [Tue, 4 Jul 2017 20:33:52 +0000 (22:33 +0200)]
avcodec/hevcdec: do not let updated extradata corrupt state

Fixes: out of array access
Fixes: 2451/clusterfuzz-testcase-minimized-4781613957251072

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agox86/sbrdsp: remove unnecessary sign extend instruction in apply_noise_main
James Almer [Wed, 5 Jul 2017 02:35:29 +0000 (23:35 -0300)]
x86/sbrdsp: remove unnecessary sign extend instruction in apply_noise_main

noise needs to be zero extended and it can be done implicitly as a side effect
in a subsequent instruction.

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agocheckasm: use declare_func_float() in sbrdsp sum_square test
James Almer [Wed, 5 Jul 2017 02:02:48 +0000 (23:02 -0300)]
checkasm: use declare_func_float() in sbrdsp sum_square test

The function returns a float.

This fixes the test in x86_32 targets.

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agox86/sbrdsp: zero extend m_max in apply_noise_main
James Almer [Tue, 4 Jul 2017 18:05:47 +0000 (15:05 -0300)]
x86/sbrdsp: zero extend m_max in apply_noise_main

Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2 years agox86/utvideodsp: make restore_rgb_planes functions work on x86_32
James Almer [Fri, 30 Jun 2017 03:40:16 +0000 (00:40 -0300)]
x86/utvideodsp: make restore_rgb_planes functions work on x86_32

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavcodec/wavpack: Fix invalid shift
Michael Niedermayer [Tue, 27 Jun 2017 11:47:32 +0000 (13:47 +0200)]
avcodec/wavpack: Fix invalid shift

Fixes: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
Fixes: 2377/clusterfuzz-testcase-minimized-6108505935183872

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/h264_slice: Fix signed integer overflow
Michael Niedermayer [Tue, 4 Jul 2017 22:05:11 +0000 (00:05 +0200)]
avcodec/h264_slice: Fix signed integer overflow

Fixes: runtime error: signed integer overflow: 26 + 2147483644 cannot be represented in type 'int'
Fixes: 2456/clusterfuzz-testcase-minimized-4822695051001856

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 agomovenc: use correct tag list for AVOutputFormat.codec_tag
John Stebbins [Thu, 15 Jun 2017 18:20:48 +0000 (11:20 -0700)]
movenc: use correct tag list for AVOutputFormat.codec_tag

ff_mp4_obj_type contains the wrong type of tags for
AVOutputFormat.codec_tag. AVOutputFormat.codec_tag is used to
validate AVCodecParameters.codec_tag so needs to be the same
type of tag.

Creates new tag lists for mp4 and ismv.  New tag lists support
same list of codecs found in ff_mp4_obj_type. psp uses the same
tag list as mp4 since these both use mp4_get_codec_tag to look up tags.

(cherry picked from commit 713efb2c0d013a42be4051adb7cd90a7c2cbbb4f)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agolavf: Remove codec_tag from dashenc and smoothstreamingenc
Martin Storsjö [Fri, 30 Jun 2017 09:49:49 +0000 (12:49 +0300)]
lavf: Remove codec_tag from dashenc and smoothstreamingenc

Skip the codec_tag altogether here, to let the user (try to) set
whichever codec/tag is preferred; the individual chained muxer will
reject invalid codecs anyway.

(cherry picked from commit 61f589e31e84ae02d7ac6837f30f19c437b1fc2e)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 years agolibavfilter/scale2ref: Maintain main input's DAR
Kevin Mark [Mon, 5 Jun 2017 10:55:21 +0000 (06:55 -0400)]
libavfilter/scale2ref: Maintain main input's DAR

The scale2ref filter will now maintain the DAR of the main input and
not the DAR of the reference input. This previous behavior was deemed
counterintuitive for most (all?) use-cases.

Before:
scale2ref=iw/4:ow/mdar
in  w:320 h:240 fmt:rgb24 sar:1/1
ref w:640 h:360 fmt:rgb24 sar:1/1
out w:160 h:120 fmt:rgb24 sar:4/3 flags:0x2
SAR: ((120 * 640) / (160 * 360)) * (1 / 1) = 4 / 3
DAR: (160 / 120) * (4 / 3) = 16 / 9
(main out now same DAR as ref)

Now:
scale2ref=iw/4:ow/mdar
in  w:320 h:240 fmt:rgb24 sar:1/1
ref w:640 h:360 fmt:rgb24 sar:1/1
out w:160 h:120 fmt:rgb24 sar:1/1 flags:0x2
SAR: ((120 * 320) / (160 * 240)) * (1 / 1) = 1 / 1
DAR: (160 / 120) * (1 / 1) = 4 / 3
(main out same DAR as main in)

The scale2ref FATE test has also been updated.

Signed-off-by: Kevin Mark <kmark937@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavfilter/vf_ssim: use unsigned so result can be properly stored
Paul B Mahol [Tue, 4 Jul 2017 08:21:14 +0000 (10:21 +0200)]
avfilter/vf_ssim: use unsigned so result can be properly stored

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2 years agoavcodec/alsdec: fix some undefined shifts
Paul B Mahol [Mon, 3 Jul 2017 09:48:13 +0000 (11:48 +0200)]
avcodec/alsdec: fix some undefined shifts

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2 years agoavcodec/alsdec: remove unused header
Paul B Mahol [Sat, 1 Jul 2017 19:53:03 +0000 (21:53 +0200)]
avcodec/alsdec: remove unused header

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2 years agolavc/mediacodec: rescale pts before decoding for both hw and sw buffers
Aman Gupta [Mon, 3 Jul 2017 16:21:50 +0000 (09:21 -0700)]
lavc/mediacodec: rescale pts before decoding for both hw and sw buffers

Replicates the logic used in the wrap_hw_buffer path to wrap_sw_buffer
as well.

Fixes decoding issues observed on AMLogic devices with
OMX.amlogic.mpeg2.decoder.awesome, where the decoder would spit out a
constant stream of "mPtsRecoveryCount" errors and decoded frames were
returned in the incorrect order.

Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2 years agolavc/mediacodec: add missing newline on warning
Aman Gupta [Mon, 3 Jul 2017 18:07:36 +0000 (11:07 -0700)]
lavc/mediacodec: add missing newline on warning

Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2 years agolavc/aarch64: add sbrdsp neon implementation
Matthieu Bouron [Tue, 23 May 2017 14:29:35 +0000 (14:29 +0000)]
lavc/aarch64: add sbrdsp neon implementation

autocorrelate_c: 644.0
autocorrelate_neon: 420.0
hf_apply_noise_0_c: 1688.5
hf_apply_noise_0_neon: 1498.6
hf_apply_noise_1_c: 1691.2
hf_apply_noise_1_neon: 1500.6
hf_apply_noise_2_c: 1688.1
hf_apply_noise_2_neon: 1500.3
hf_apply_noise_3_c: 1696.6
hf_apply_noise_3_neon: 1502.2
hf_g_filt_c: 2117.8
hf_g_filt_neon: 1218.7
hf_gen_c: 4573.4
hf_gen_neon: 2461.0
neg_odd_64_c: 72.0
neg_odd_64_neon: 64.7
qmf_deint_bfly_c: 1107.6
qmf_deint_bfly_neon: 291.6
qmf_deint_neg_c: 210.4
qmf_deint_neg_neon: 107.4
qmf_post_shuffle_c: 163.0
qmf_post_shuffle_neon: 107.7
qmf_pre_shuffle_c: 120.5
qmf_pre_shuffle_neon: 110.7
sum64x5_c: 1361.6
sum64x5_neon: 435.4
sum_square_c: 1686.4
sum_square_neon: 787.2