ffmpeg.git
12 months agoavcodec/dump_extradata_bsf: don't allocate a new AVPacket per filtered packet
James Almer [Mon, 23 Jul 2018 22:16:30 +0000 (19:16 -0300)]
avcodec/dump_extradata_bsf: don't allocate a new AVPacket per filtered packet

~4x speedup in dump_extradata()

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavformat/avs: add descriptive name and url
Gyan Doshi [Thu, 2 Aug 2018 05:17:10 +0000 (10:47 +0530)]
avformat/avs: add descriptive name and url

AVS now more commonly refers to the Chinese AVS format. This demuxer
processes video files for Creature Shock game

12 months agox86/pixelutils: don't use the AVX2 functions on CPUs known to be slow with them
James Almer [Wed, 1 Aug 2018 01:14:53 +0000 (22:14 -0300)]
x86/pixelutils: don't use the AVX2 functions on CPUs known to be slow with them

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agox86/pixelutils: add missing preprocessor wrapper to the AVX2 functions
James Almer [Wed, 1 Aug 2018 01:03:22 +0000 (22:03 -0300)]
x86/pixelutils: add missing preprocessor wrapper to the AVX2 functions

Should fix compilation with old yasm/nasm

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agotools/qt-faststart: Allow free atoms after moov atom.
Carl Eugen Hoyos [Wed, 11 Jul 2018 23:24:39 +0000 (01:24 +0200)]
tools/qt-faststart: Allow free atoms after moov atom.

12 months agoavutil/pixelutils: sad_32x32 sse2/avx2 optimizations.
Jun Zhao [Mon, 9 Jul 2018 16:41:00 +0000 (00:41 +0800)]
avutil/pixelutils: sad_32x32 sse2/avx2 optimizations.

add ff_pixelutils_sad_32x32_sse2, ff_pixelutils_sad_{a,u}_32x32_sse2,
ff_pixelutils_sad_32x32_avx22, ff_pixelutils_sad_{a,u}_32x32_avx2

use perf record/report profiling, get instructions:u for avx2 sad_32x32:

  72.05%  pixelutils  pixelutils     [.] block_sad_32x32_c
  18.50%  pixelutils  pixelutils     [.] block_sad_16x16_c
   4.78%  pixelutils  pixelutils     [.] block_sad_8x8_c
   2.69%  pixelutils  pixelutils     [.] block_sad_4x4_c
   0.89%  pixelutils  pixelutils     [.] block_sad_2x2_c
   0.16%  pixelutils  pixelutils     [.] ff_pixelutils_sad_32x32_avx2
   0.16%  pixelutils  pixelutils     [.] ff_pixelutils_sad_u_32x32_avx2
   0.12%  pixelutils  pixelutils     [.] ff_pixelutils_sad_a_32x32_avx2

sse2 sad_32x32 instructions:u like:

  71.86%  pixelutils  pixelutils     [.] block_sad_32x32_c
  18.42%  pixelutils  pixelutils     [.] block_sad_16x16_c
   4.81%  pixelutils  pixelutils     [.] block_sad_8x8_c
   2.68%  pixelutils  pixelutils     [.] block_sad_4x4_c
   0.88%  pixelutils  pixelutils     [.] block_sad_2x2_c
   0.29%  pixelutils  pixelutils     [.] ff_pixelutils_sad_32x32_sse2
   0.26%  pixelutils  pixelutils     [.] ff_pixelutils_sad_u_32x32_sse2
   0.23%  pixelutils  pixelutils     [.] ff_pixelutils_sad_a_32x32_sse2

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
12 months agolavutil/pixelutils: add sad_32x32 in pixelutils API.
Jun Zhao [Mon, 9 Jul 2018 16:34:26 +0000 (00:34 +0800)]
lavutil/pixelutils: add sad_32x32 in pixelutils API.

add sad_32x32 in pixelutils API, and update the fate.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
12 months agoavcodec/h264_mp4toannexb_bsf: use enum constants for the NAL unit type values
James Almer [Sun, 29 Jul 2018 21:22:25 +0000 (18:22 -0300)]
avcodec/h264_mp4toannexb_bsf: use enum constants for the NAL unit type values

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agofate: add tests for audio channel up-/downmixing with pan filter
Tobias Rapp [Thu, 19 Jul 2018 11:59:37 +0000 (13:59 +0200)]
fate: add tests for audio channel up-/downmixing with pan filter

Add tests for upmixing and downmixing with audio channel counts that
have a corresponding default layout and also tests where there is no
default layout.

Update the existing "stereo4" test so it actually outputs stereo like
the other stereo tests. Rename the previous "stereo4" test into
"upmix1".

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
12 months agotests/audiogen: raise channel count limit to 12
Tobias Rapp [Thu, 19 Jul 2018 09:49:33 +0000 (11:49 +0200)]
tests/audiogen: raise channel count limit to 12

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
12 months agolibavformat/dashenc: Fix relative URI of HLS master playlist
Antonio Morell [Thu, 26 Jul 2018 13:22:21 +0000 (14:22 +0100)]
libavformat/dashenc: Fix relative URI of HLS master playlist

12 months agodoc/formats: Add documentation for skip_estimate_duration_from_pts
Michael Niedermayer [Tue, 24 Jul 2018 22:49:39 +0000 (00:49 +0200)]
doc/formats: Add documentation for skip_estimate_duration_from_pts

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
12 months agoconfigure: add missing aandcttables dependency to asv1 and asv2 encoders
James Almer [Mon, 30 Jul 2018 00:30:00 +0000 (21:30 -0300)]
configure: add missing aandcttables dependency to asv1 and asv2 encoders

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoconfigure: add missing aandcttables dependency to mpegvideoenc
James Almer [Mon, 30 Jul 2018 00:22:28 +0000 (21:22 -0300)]
configure: add missing aandcttables dependency to mpegvideoenc

Also remove the superfluous aandcttables dependency from all the modules
that only need it because of mpegvideoenc

Fixes ticket #7333

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agolavfi/nlmeans: fix aarch64 assembly with clang
Jan Ekström [Thu, 26 Jul 2018 20:45:01 +0000 (23:45 +0300)]
lavfi/nlmeans: fix aarch64 assembly with clang

Clang is more strict about some things.

12 months agocmdutils: print a more descriptive error message in show_help_bsf() when no bsf is...
James Almer [Sat, 28 Jul 2018 03:58:29 +0000 (00:58 -0300)]
cmdutils: print a more descriptive error message in show_help_bsf() when no bsf is specified

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavcodec/bitstream_filters: check the input argument of av_bsf_get_by_name() for NULL
James Almer [Sat, 28 Jul 2018 03:51:57 +0000 (00:51 -0300)]
avcodec/bitstream_filters: check the input argument of av_bsf_get_by_name() for NULL

Fixes crashes like "ffmpeg -h bsf" caused by passing NULL to strcmp()

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavcodec/diracdec: Check bytes count in else branch in decode_lowdelay() too
Michael Niedermayer [Sun, 22 Jul 2018 19:42:16 +0000 (21:42 +0200)]
avcodec/diracdec: Check bytes count in else branch in decode_lowdelay() too

Fixes: signed integer overflow: 8 * 340018243 cannot be represented in type 'int'
Fixes: 9441/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5194665207791616

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 months agoavcodec/diracdec: Check slice numbers for overflows in relation to picture dimensions
Michael Niedermayer [Sun, 22 Jul 2018 19:26:24 +0000 (21:26 +0200)]
avcodec/diracdec: Check slice numbers for overflows in relation to picture dimensions

Fixes: signed integer overflow: 88 * 33685506 cannot be represented in type 'int'
Fixes: 9433/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5725943535501312

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 months agoavcodec/diracdec: Change frame_number to 64bit as its a 32bit from the bitstream...
Michael Niedermayer [Sun, 22 Jul 2018 18:45:39 +0000 (20:45 +0200)]
avcodec/diracdec: Change frame_number to 64bit as its a 32bit from the bitstream and we also have a -1 special case

Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 9291/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-6324345860259840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 months agoavcodec/dirac_dwt_template: Fix several integer overflows in horizontal_compose_daub97i()
Michael Niedermayer [Sun, 22 Jul 2018 17:11:04 +0000 (19:11 +0200)]
avcodec/dirac_dwt_template: Fix several integer overflows in horizontal_compose_daub97i()

Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 8926/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-6047609228623872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 months agoavcodec/diracdec: Prevent integer overflow in intermediate in global_mv()
Michael Niedermayer [Sun, 22 Jul 2018 16:58:34 +0000 (18:58 +0200)]
avcodec/diracdec: Prevent integer overflow in intermediate in global_mv()

Fixes: signed integer overflow: -393471 * 5460 cannot be represented in type 'int'
Fixes: 8890/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-6299775379963904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 months agoavformat/librtmp: fix returning EOF from Read/Write
Timo Rothenpieler [Wed, 25 Jul 2018 22:37:35 +0000 (00:37 +0200)]
avformat/librtmp: fix returning EOF from Read/Write

Ticket #7052

12 months agofate: remove unnecessary reference file for fate-encryption-info
James Almer [Thu, 26 Jul 2018 03:38:01 +0000 (00:38 -0300)]
fate: remove unnecessary reference file for fate-encryption-info

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavcodec: add missing files missed in previous commits
James Almer [Fri, 27 Jul 2018 13:59:38 +0000 (10:59 -0300)]
avcodec: add missing files missed in previous commits

Fixes compilation.

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agolavc, doc, configure: add avs2 video decoder wrapper
hwren [Fri, 27 Jul 2018 03:50:19 +0000 (11:50 +0800)]
lavc, doc, configure: add avs2 video decoder wrapper

Tested-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: hwren <hwrenx@126.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
12 months agolavf: add avs2 fourcc
hwren [Fri, 27 Jul 2018 03:48:50 +0000 (11:48 +0800)]
lavf: add avs2 fourcc

Signed-off-by: hwren <hwrenx@126.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
12 months agolavc: add AVS2/IEEE 1857.4 parser
hwren [Fri, 27 Jul 2018 03:44:59 +0000 (11:44 +0800)]
lavc: add AVS2/IEEE 1857.4 parser

Tested-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: hwren <hwrenx@126.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
12 months agodoc/protocols: documents tcp_mss
Jun Zhao [Sun, 6 May 2018 15:02:42 +0000 (23:02 +0800)]
doc/protocols: documents tcp_mss

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
12 months agolavf/tcp: add option to setting Maximum Segment Size
Jun Zhao [Sun, 6 May 2018 14:56:01 +0000 (22:56 +0800)]
lavf/tcp: add option to setting Maximum Segment Size

This can change the the MSS value announced to the other end in
the initial TCP packet, it's can be used when failed Path MTU
discovery.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
12 months agoswresample/swresample: Fix input channel count in resample_first computation
Michael Niedermayer [Tue, 24 Jul 2018 20:44:12 +0000 (22:44 +0200)]
swresample/swresample: Fix input channel count in resample_first computation

Found-by: Marcin Gorzel <gorzel@google.com>
Reviewed-by: Marcin Gorzel <gorzel@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 months agoavformat/mov: Check default_encrypted_sample before use in mov_read_sample_encryption...
Michael Niedermayer [Sat, 21 Jul 2018 15:20:44 +0000 (17:20 +0200)]
avformat/mov: Check default_encrypted_sample before use in mov_read_sample_encryption_info()

Fixes: 2018-0721-sample
Fixes: null pointer dereference

Found-by: Nikita Knyzhov (knnikita@yandex.ru)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 months agoswresample: Use channel count in rematrix initialization
Marcin Gorzel [Tue, 24 Jul 2018 13:55:47 +0000 (14:55 +0100)]
swresample: Use channel count in rematrix initialization

Rematrixing supports up to 64 channels. However, there is only a limited number of channel layouts defined. Since the in/out channel count is currently obtained from the channel layout, for undefined layouts (e.g. for 9, 10, 11 channels etc.) the rematrixing fails.

This patch changes rematrix init methods to use in (used) and out channel count directly instead of computing it from channel layout.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 months agoconfigure: Force pie for Android.
Carl Eugen Hoyos [Wed, 25 Jul 2018 18:43:02 +0000 (20:43 +0200)]
configure: Force pie for Android.

Position-independent executables are required since Lollipop.

Reported-by: Mohammed Bey Ahmed Khernache
12 months agoavutil/hwcontext_d3d11va: fix type arguments passed to IDXGIAdapter2_GetDesc()
James Almer [Mon, 23 Jul 2018 23:42:08 +0000 (20:42 -0300)]
avutil/hwcontext_d3d11va: fix type arguments passed to IDXGIAdapter2_GetDesc()

libavutil/hwcontext_d3d11va.c: In function 'd3d11va_device_create':
libavutil/hwcontext_d3d11va.c:554:46: warning: passing argument 2 of 'pAdapter->lpVtbl->GetDesc' from incompatible pointer type [-Wincompatible-pointer-types]
         hr = IDXGIAdapter2_GetDesc(pAdapter, &desc);
                                              ^
libavutil/hwcontext_d3d11va.c:554:46: note: expected 'DXGI_ADAPTER_DESC * {aka struct DXGI_ADAPTER_DESC *}' but argument is of type 'DXGI_ADAPTER_DESC2 * {aka struct DXGI_ADAPTER_DESC2 *}'

Reviewed-by: Jean-Baptiste Kempf <jb@videolan.org>
Signed-off-by: James Almer <jamrial@gmail.com>
12 months agolavf/isom: Make auxiliary_offsets consistently uint64_t.
Carl Eugen Hoyos [Tue, 24 Jul 2018 20:32:59 +0000 (22:32 +0200)]
lavf/isom: Make auxiliary_offsets consistently uint64_t.

Fixes a compilation warning if size_t != uint64_t:
libavformat/mov.c: In function ‘mov_read_saio’:
libavformat/mov.c:6207:45: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
         encryption_index->auxiliary_offsets = auxiliary_offsets;
                                             ^

12 months agolavf/flvdec: Remove an outdated comment.
Carl Eugen Hoyos [Wed, 25 Jul 2018 13:08:43 +0000 (15:08 +0200)]
lavf/flvdec: Remove an outdated comment.

The buffer size was increased in b2fecce3 to prepare for 790a3cdf.

12 months agodoc/mailing-list-faq: user lists are subscribe only
Lou Logan [Tue, 24 Jul 2018 21:33:31 +0000 (13:33 -0800)]
doc/mailing-list-faq: user lists are subscribe only

Includes a few other minor changes and updates.

Signed-off-by: Lou Logan <lou@lrcd.com>
12 months agoavformat/mxfdec: drop invalid index table segments when sorting them
Marton Balint [Wed, 4 Jul 2018 21:42:56 +0000 (23:42 +0200)]
avformat/mxfdec: drop invalid index table segments when sorting them

This way if an index table segment is present multiple times, we can always use
the proper one instead of the invalid one.

Fixes seeking in the sample of ticket #5671.

Signed-off-by: Marton Balint <cus@passwd.hu>
12 months agoavfilter: Add colorconstancy filter
Mina [Mon, 16 Jul 2018 08:20:02 +0000 (10:20 +0200)]
avfilter: Add colorconstancy filter

Signed-off-by: Mina <minasamy_@hotmail.com>
12 months agoavcodec/cdgraphics: Clear first frame only once
Michael Niedermayer [Sun, 15 Jul 2018 12:12:56 +0000 (14:12 +0200)]
avcodec/cdgraphics: Clear first frame only once

frame_number will not increase if nothing is output

Fixes: Timeout
Fixes: 9057/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CDGRAPHICS_fuzzer-4844661498707968

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 months agoavcodec/tscc: Do not duplicate images
Michael Niedermayer [Sun, 15 Jul 2018 12:04:05 +0000 (14:04 +0200)]
avcodec/tscc: Do not duplicate images

This improves speed

Fixes: Timeout
Fixes: 9010/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TSCC_fuzzer-6042614817095680

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 months agoavcodec/tscc: Move reading the side data palette before other checks
Michael Niedermayer [Sun, 15 Jul 2018 12:01:40 +0000 (14:01 +0200)]
avcodec/tscc: Move reading the side data palette before other checks

We do not want to loose the side data in case of errors

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 months agoavcodec/bink: set color range
Paul B Mahol [Sun, 22 Jul 2018 08:19:03 +0000 (10:19 +0200)]
avcodec/bink: set color range

12 months agoavcodec/bink: add 'k' version support
Paul B Mahol [Wed, 18 Jul 2018 19:17:29 +0000 (21:17 +0200)]
avcodec/bink: add 'k' version support

12 months agoavformat/bink: move code for skipping unknown fields to correct place
Paul B Mahol [Mon, 16 Jul 2018 10:54:47 +0000 (12:54 +0200)]
avformat/bink: move code for skipping unknown fields to correct place

12 months agoavcodec/parser: move parsers list and related API to its own file
James Almer [Sat, 21 Jul 2018 17:21:16 +0000 (14:21 -0300)]
avcodec/parser: move parsers list and related API to its own file

And add it to the CONFIGURABLE_COMPONENTS list in Makefile. This way, changes
to the new file will be tracked and the usual warning to suggest re-running
configure will be shown.

Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
12 months agodoc/filters: use radius instead of kernel in avgblur
Danil Iashchenko [Fri, 20 Jul 2018 16:31:19 +0000 (19:31 +0300)]
doc/filters: use radius instead of kernel in avgblur

12 months agolavc/fft_template: Do not define unneded functions with --enable-small.
Carl Eugen Hoyos [Sat, 21 Jul 2018 12:05:41 +0000 (14:05 +0200)]
lavc/fft_template: Do not define unneded functions with --enable-small.

Fixes the following warnings:
In file included from libavcodec/fft_fixed.c:21:0:
libavcodec/fft_template.c:528:6: warning: ‘pass_big’ defined but not used [-Wunused-function]
 PASS(pass_big)
      ^
libavcodec/fft_template.c:505:13: note: in definition of macro ‘PASS’
 static void name(FFTComplex *z, const FFTSample *wre, unsigned int n)\
             ^~~~
CC      libavcodec/ffv1.o
In file included from libavcodec/fft_float.c:21:0:
libavcodec/fft_template.c:528:6: warning: ‘pass_big’ defined but not used [-Wunused-function]
 PASS(pass_big)
      ^
libavcodec/fft_template.c:505:13: note: in definition of macro ‘PASS’
 static void name(FFTComplex *z, const FFTSample *wre, unsigned int n)\
             ^~~~

12 months agolibavcodec/ppc: Fix HEVC AltiVec routines with --enable-small
A. Wilcox [Sat, 21 Jul 2018 05:42:00 +0000 (00:42 -0500)]
libavcodec/ppc: Fix HEVC AltiVec routines with --enable-small

GCC requires the argument to vec_splat_u32 to be a literal.  The easiest
way to accomplish this is to change 'shift' to be const in scale (as it
is in the transform routine above), and convert both routines to be
inline.  This way, GCC can coerce the values to literals.

Tested on a 970 (Apple G5) and POWER9 (Talos II); passed fate and played
a clip of Big Buck Bunny correctly.

Fixes ticket #7048

Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
12 months agoavcodec/extract_extradata_bsf: make sure a Sequence Header was found for av1
James Almer [Fri, 20 Jul 2018 23:43:40 +0000 (20:43 -0300)]
avcodec/extract_extradata_bsf: make sure a Sequence Header was found for av1

A packet may have Metadata OBUs but no Sequence Header OBU, which is
useless as extradata.

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavcodec: bump micro version after previous changes
James Almer [Fri, 20 Jul 2018 18:49:13 +0000 (15:49 -0300)]
avcodec: bump micro version after previous changes

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavformat/movenc: add support for AV1 streams
James Almer [Sat, 7 Jul 2018 19:35:32 +0000 (16:35 -0300)]
avformat/movenc: add support for AV1 streams

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavformat/mov: add support for AV1 streams
James Almer [Sat, 7 Jul 2018 19:33:41 +0000 (16:33 -0300)]
avformat/mov: add support for AV1 streams

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavcodec/libaomenc: export Sequence Header and Metadata OBUs as extradata
James Almer [Sat, 7 Jul 2018 19:33:16 +0000 (16:33 -0300)]
avcodec/libaomenc: export Sequence Header and Metadata OBUs as extradata

aom_codec_get_global_headers() is not implemented as of libaom 1.0.0 for AV1, so
we're forced to extract the relevant header OBUs from the first packet and propagate
them as packet side data.

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavcodec/extract_extradata: add support for AV1
James Almer [Sat, 7 Jul 2018 19:32:52 +0000 (16:32 -0300)]
avcodec/extract_extradata: add support for AV1

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavcodec: add AV1 packet split API
James Almer [Sat, 14 Apr 2018 20:29:31 +0000 (17:29 -0300)]
avcodec: add AV1 packet split API

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavutil/pixfmt: Document chroma plane size for odd resolutions
Michael Niedermayer [Wed, 18 Jul 2018 20:22:35 +0000 (22:22 +0200)]
avutil/pixfmt: Document chroma plane size for odd resolutions

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 months agolavfi/af_afir,af_aiir: Remove a variable that is always -1.
Carl Eugen Hoyos [Thu, 19 Jul 2018 00:28:25 +0000 (02:28 +0200)]
lavfi/af_afir,af_aiir: Remove a variable that is always -1.

Fixes two warnings:
libavfilter/af_afir.c:194:45: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow]
     int dx = FFABS(x1-x0), sx = x0 < x1 ? 1 : -1;
                                 ~~~~~~~~~~~~^~~~
libavfilter/af_aiir.c:689:45: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow]
     int dx = FFABS(x1-x0), sx = x0 < x1 ? 1 : -1;
                                 ~~~~~~~~~~~~^~~~

12 months agolavu/x86/cpu: Fix aesni detection
alexander schmid [Mon, 16 Jul 2018 08:43:11 +0000 (10:43 +0200)]
lavu/x86/cpu: Fix aesni detection

12 months agoavcodec/videotoolboxenc: fix undefined behavior with rc_max_rate=0
Thomas Guillem [Wed, 4 Jul 2018 07:05:22 +0000 (09:05 +0200)]
avcodec/videotoolboxenc: fix undefined behavior with rc_max_rate=0

On macOS, a zero rc_max_rate cause an error from
VTSessionSetProperty(kVTCompressionPropertyKey_DataRateLimits).

on iOS (depending on device/version), a zero rc_max_rate cause invalid
arguments from the vtenc_output_callback after few frames and then a crash
within the VideoToolbox library.

Signed-off-by: Aman Gupta <aman@tmm1.net>
12 months agoavcodec: parse options from AVCodec.bsfs
Aman Gupta [Wed, 18 Jul 2018 18:52:33 +0000 (11:52 -0700)]
avcodec: parse options from AVCodec.bsfs

Fixes a bug that would prevent using multiple comma-separated filters,
and allows options to be passed to each filter.

Based on similar loop in ffmpeg_opt.c's new_output_stream().

Signed-off-by: Aman Gupta <aman@tmm1.net>
12 months agoavformat/mxfdec: only call mxf_free_metadataset when ctx_size is != 0, otherwise...
Baptiste Coudurier [Fri, 6 Jul 2018 19:06:26 +0000 (12:06 -0700)]
avformat/mxfdec: only call mxf_free_metadataset when ctx_size is != 0, otherwise ctx == mxf

13 months agoavcodec/dvbsub_parser: Do not discard data
Michael Niedermayer [Fri, 6 Jul 2018 11:02:19 +0000 (13:02 +0200)]
avcodec/dvbsub_parser: Do not discard data

May fix: oss fuzz issue 9220

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/cfhd: Use bytestream2 for peaks
Michael Niedermayer [Fri, 13 Jul 2018 22:26:08 +0000 (00:26 +0200)]
avcodec/cfhd: Use bytestream2 for peaks

This fixes out of array accesses
No testcase known

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/tscc: Move reget buffer to after decoding
Michael Niedermayer [Sun, 15 Jul 2018 11:52:50 +0000 (13:52 +0200)]
avcodec/tscc: Move reget buffer to after decoding

reget buffer can be time consuming, theres no need to do it if failures
occur

Testcase: 9010/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TSCC_fuzzer-6042614817095680

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/lagarith: Remove redundant varianble init
Michael Niedermayer [Sun, 15 Jul 2018 11:32:09 +0000 (13:32 +0200)]
avcodec/lagarith: Remove redundant varianble init

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agofate: add more vc2 encoder tests
James Darnley [Mon, 29 Jan 2018 16:40:00 +0000 (17:40 +0100)]
fate: add more vc2 encoder tests

13 months agoavformat/mov: only set handler_name from mdia->hdlr
Gyan Doshi [Sat, 14 Jul 2018 08:29:51 +0000 (13:59 +0530)]
avformat/mov: only set handler_name from mdia->hdlr

6 FATE references updated.

Fixes #7104

13 months agodoc/filters: add missing details to aphasemeter
Gyan Doshi [Mon, 16 Jul 2018 05:50:22 +0000 (11:20 +0530)]
doc/filters: add missing details to aphasemeter

First output is audio and is rematrixed to stereo

13 months agoavcodec/dvdsub_parser: Allocate input padding
Michael Niedermayer [Fri, 13 Jul 2018 16:56:10 +0000 (18:56 +0200)]
avcodec/dvdsub_parser: Allocate input padding

Fixes: out of array read
Fixes: 9350/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DVDSUB_fuzzer-5746777750765568

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/vp8_parser: Remove redundant output initialization
Michael Niedermayer [Fri, 13 Jul 2018 16:53:38 +0000 (18:53 +0200)]
avcodec/vp8_parser: Remove redundant output initialization

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/dvdsub_parser: Init output buf/size
Michael Niedermayer [Fri, 13 Jul 2018 16:54:48 +0000 (18:54 +0200)]
avcodec/dvdsub_parser: Init output buf/size

No testcase

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/lagarith: Check that the range coded data stream is consistent when the proba...
Michael Niedermayer [Thu, 14 Jun 2018 20:16:52 +0000 (22:16 +0200)]
avcodec/lagarith: Check that the range coded data stream is consistent when the probabilities indicate no data could have been coded.

Fixes: Timeout
Fixes: 8638/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LAGARITH_fuzzer-5132046098759680
Fixes: 8943/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LAGARITH_fuzzer-4883030219948032

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 agolibavcodec/cfhd: Fix signed overflow in shift
Michael Niedermayer [Fri, 13 Jul 2018 22:24:47 +0000 (00:24 +0200)]
libavcodec/cfhd: Fix signed overflow in shift

Fixes: 8695/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-4906172426485760

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 agoUpdate Changelog for lensfun addition and bump minor
Paul B Mahol [Sun, 15 Jul 2018 08:23:20 +0000 (10:23 +0200)]
Update Changelog for lensfun addition and bump minor

13 months agoAdd lensfun filter
Stephen Seo [Fri, 13 Jul 2018 10:33:12 +0000 (19:33 +0900)]
Add lensfun filter

Lensfun is a library that applies lens correction to an image using a
database of cameras/lenses (you provide the camera and lens models, and
it uses the corresponding database entry's parameters to apply lens
correction). It is licensed under LGPL3.

The lensfun filter utilizes the lensfun library to apply lens
correction to videos as well as images.

This filter was created out of necessity since I wanted to apply lens
correction to a video and the lenscorrection filter did not work for me.

While this filter requires little info from the user to apply lens
correction, the flaw is that lensfun is intended to be used on indvidual
images. When used on a video, the parameters such as focal length is
constant, so lens correction may fail on videos where the camera's focal
length changes (zooming in or out via zoom lens). To use this filter
correctly on videos where such parameters change, timeline editing may
be used since this filter supports it.

Note that valgrind shows a small memory leak which is not from this
filter but from the lensfun library (memory is allocated when loading
the lensfun database but it somehow isn't deallocated even during
cleanup; it is briefly created in the init function of the filter, and
destroyed before the init function returns). This may have been fixed by
the latest commit in the lensfun repository; the current latest release
of lensfun is almost 3 years ago.

Bi-Linear interpolation is used by default as lanczos interpolation
shows more artifacts in the corrected image in my tests.

The lanczos interpolation is derived from lenstool's implementation of
lanczos interpolation. Lenstool is an app within the lensfun repository
which is licensed under GPL3.

v2 of this patch fixes license notice in libavfilter/vf_lensfun.c

v3 of this patch fixes code style and dependency to gplv3 (thanks to
Paul B Mahol for pointing out the mentioned issues).

v4 of this patch fixes more code style issues that were missed in
v3.

v5 of this patch adds line breaks to some of the documentation in
doc/filters.texi (thanks to Gyan Doshi for pointing out the issue).

v6 of this patch fixes more problems (thanks to Moritz Barsnick for
pointing them out).

v7 of this patch fixes use of sqrt() (changed to sqrtf(); thanks to
Moritz Barsnick for pointing this out). Also should be rebased off of
latest master branch commits at this point.

Signed-off-by: Stephen Seo <seo.disparate@gmail.com>
13 months agoaadec: improve seeking in mp3 content
Karsten Otto [Sat, 14 Jul 2018 09:20:46 +0000 (11:20 +0200)]
aadec: improve seeking in mp3 content

MP3 frames may not be aligned to aa chunk boundaries. When seeking,
calculate the expected frame offset in the target chunk. Adjust the
timestamp and truncate the next packet accordingly.

This solution works for the majority of tested audio material. For
some rare encodings with mp3 padding or embedded id3 tags, it will
mispredict the correct offset, and at worst skip an extra frame.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/dirac_dwt_template: Fix signedness regression in interleave()
Michael Niedermayer [Fri, 13 Jul 2018 16:33:08 +0000 (18:33 +0200)]
avcodec/dirac_dwt_template: Fix signedness regression in interleave()

Found-by: <jdarnley>
Tested-by: James Darnley <james.darnley@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/mips: fix conflicting types error of ff_vc1_h_s_overlap_mmi.
Shiyou Yin [Thu, 12 Jul 2018 07:16:14 +0000 (15:16 +0800)]
avcodec/mips: fix conflicting types error of ff_vc1_h_s_overlap_mmi.

In commit 975a1a8,function ff_vc1_h_s_overlap_mmi was refactored,
but the declaration in libavcodec/mips/vc1dsp_mips.h was unchanged.

Change-Id: I90beae683511622a0cc1130ab1660ac8669ec3ef
Signed-off-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Reviewed-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavformat/movenc: add reason for minf->hdlr in MOV only
Gyan Doshi [Sat, 14 Jul 2018 06:31:58 +0000 (12:01 +0530)]
avformat/movenc: add reason for minf->hdlr in MOV only

13 months agoavformat/mxfdec: only return stream indexes which have a corresponding track
Marton Balint [Tue, 3 Jul 2018 23:23:45 +0000 (01:23 +0200)]
avformat/mxfdec: only return stream indexes which have a corresponding track

Without this check some crafted files might crash because a packet might be
demuxed which have no corresponding mxf track.

Signed-off-by: Marton Balint <cus@passwd.hu>
13 months agoavcodec/internal: increase FF_SANE_NB_CHANNELS to 256
Marton Balint [Tue, 3 Jul 2018 10:10:54 +0000 (12:10 +0200)]
avcodec/internal: increase FF_SANE_NB_CHANNELS to 256

This was reduced from 128 in libav commit
192f1984b1a93aa08af053b8f9ab4950f307bd5d, but since we support unknown channel
layouts, we can increase this limit.

Fixes ticket #6332.

Signed-off-by: Marton Balint <cus@passwd.hu>
13 months agoavcodec/utils: report insane channel count errors
Marton Balint [Tue, 3 Jul 2018 10:09:13 +0000 (12:09 +0200)]
avcodec/utils: report insane channel count errors

More than 64 is not *that* insane, so let's report the error at least.

Signed-off-by: Marton Balint <cus@passwd.hu>
13 months agoffplay: add support for various YUV conversion modes
Marton Balint [Mon, 2 Jul 2018 17:16:31 +0000 (19:16 +0200)]
ffplay: add support for various YUV conversion modes

SDL from version 2.0.8 has support for full range YUV and specifying
BT601/BT709 color space for YUV->RGB conversion.

Signed-off-by: Marton Balint <cus@passwd.hu>
13 months agolavc/aarch64/h264dsp_init_aarch64: Fix weight function prototypes.
Carl Eugen Hoyos [Sat, 20 Jan 2018 23:17:19 +0000 (00:17 +0100)]
lavc/aarch64/h264dsp_init_aarch64: Fix weight function prototypes.

Fixes the following warnings:
libavcodec/aarch64/h264dsp_init_aarch64.c: In function ‘ff_h264dsp_init_aarch64’:
libavcodec/aarch64/h264dsp_init_aarch64.c:84:38: warning: assignment from incompatible pointer type [enabled by default]
         c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16_neon;
                                      ^
libavcodec/aarch64/h264dsp_init_aarch64.c:85:38: warning: assignment from incompatible pointer type [enabled by default]
         c->weight_h264_pixels_tab[1] = ff_weight_h264_pixels_8_neon;
                                      ^
libavcodec/aarch64/h264dsp_init_aarch64.c:86:38: warning: assignment from incompatible pointer type [enabled by default]
         c->weight_h264_pixels_tab[2] = ff_weight_h264_pixels_4_neon;
                                      ^
libavcodec/aarch64/h264dsp_init_aarch64.c:88:40: warning: assignment from incompatible pointer type [enabled by default]
         c->biweight_h264_pixels_tab[0] = ff_biweight_h264_pixels_16_neon;
                                        ^
libavcodec/aarch64/h264dsp_init_aarch64.c:89:40: warning: assignment from incompatible pointer type [enabled by default]
         c->biweight_h264_pixels_tab[1] = ff_biweight_h264_pixels_8_neon;
                                        ^
libavcodec/aarch64/h264dsp_init_aarch64.c:90:40: warning: assignment from incompatible pointer type [enabled by default]
         c->biweight_h264_pixels_tab[2] = ff_biweight_h264_pixels_4_neon;
                                        ^

13 months agolavc/hevc_ps: use skip_bits instead of get_bits when skip bits.
Jun Zhao [Sat, 7 Jul 2018 05:40:47 +0000 (13:40 +0800)]
lavc/hevc_ps: use skip_bits instead of get_bits when skip bits.

use skip_bits when want to skip some bits.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
13 months agolavc/hevc_ps: Refine sps_range_extension parse.
Jun Zhao [Sat, 7 Jul 2018 04:54:15 +0000 (12:54 +0800)]
lavc/hevc_ps: Refine sps_range_extension parse.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
13 months agodoc/filters: correct description of variables in blend filter
Gyan Doshi [Fri, 13 Jul 2018 05:21:49 +0000 (10:51 +0530)]
doc/filters: correct description of variables in blend filter

Invert description of SW / SH variables.

13 months agoavfilter/drawtext: fix box sizing
Gyan Doshi [Tue, 10 Jul 2018 09:44:06 +0000 (15:14 +0530)]
avfilter/drawtext: fix box sizing

At present, box size is clipped to frame size before being drawn,
which can lead to the box not fully covering animated text which is
longer than one or both frame dimensions.

Since ff_blend_rectangle correctly takes care of clipping, it is skipped
here which results in correct box sizing

13 months agoavformat/mov: Simplify last element computation in mov_estimate_video_delay()
Michael Niedermayer [Wed, 11 Jul 2018 00:17:57 +0000 (02:17 +0200)]
avformat/mov: Simplify last element computation in mov_estimate_video_delay()

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Reviewed-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agolibavcodec/mpegaudiodecheader.h: fix version check pattern
Karsten Otto [Thu, 12 Jul 2018 07:30:25 +0000 (09:30 +0200)]
libavcodec/mpegaudiodecheader.h: fix version check pattern

This fixes the check for the reserved MPEG audio version ID,
used to detect an invalid frame header.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavformat/mov: Break out of inner loop early in mov_estimate_video_delay()
Michael Niedermayer [Wed, 11 Jul 2018 00:17:58 +0000 (02:17 +0200)]
avformat/mov: Break out of inner loop early in mov_estimate_video_delay()

0.266 <- 0.299 sec (this is time ffmpeg so containing alot other things)

Sample for benchmark was: ffmpeg -f rawvideo -pix_fmt yuv420p -s 32x32 -i /dev/zero -t 24:00:00.00 out.mp4

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Reviewed-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agolavc/h263dec: Remove a variable declaration that can lead to a warning.
Carl Eugen Hoyos [Wed, 11 Jul 2018 22:07:55 +0000 (00:07 +0200)]
lavc/h263dec: Remove a variable declaration that can lead to a warning.

13 months agolavfi/convolution_opencl: use CL_FAIL_ON_ERROR for error handling
Danil Iashchenko [Thu, 12 Jul 2018 22:20:18 +0000 (01:20 +0300)]
lavfi/convolution_opencl: use CL_FAIL_ON_ERROR for error handling

Switch to use CL_FAIL_ON_ERROR for error handling

13 months agolavc/qsv: handle MFX_FRAMETYPE_UNKNOWN case
Zhong Li [Tue, 3 Jul 2018 08:01:30 +0000 (16:01 +0800)]
lavc/qsv: handle MFX_FRAMETYPE_UNKNOWN case

Signed-off-by: Zhong Li <zhong.li@intel.com>
13 months agoavformat/mov: Eliminate variable buf_size from mov_estimate_video_delay()
Michael Niedermayer [Wed, 11 Jul 2018 00:17:56 +0000 (02:17 +0200)]
avformat/mov: Eliminate variable buf_size from mov_estimate_video_delay()

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Reviewed-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavformat/mov: remove modulo operations from mov_estimate_video_delay()
Michael Niedermayer [Wed, 11 Jul 2018 00:17:55 +0000 (02:17 +0200)]
avformat/mov: remove modulo operations from mov_estimate_video_delay()

0.324 <-0.491 sec

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Reviewed-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agolavfi/avgblur_opencl: fix using uninitialized value
Danil Iashchenko [Mon, 9 Jul 2018 12:41:48 +0000 (15:41 +0300)]
lavfi/avgblur_opencl: fix using uninitialized value

Fixed using uninitialized value "global_work[0]" when calling "av_log".

Fixes CID #1437471.

13 months agolavfi/vf_avgblur_opencl: remove useless clFinish().
Ruiling Song [Tue, 3 Jul 2018 18:16:25 +0000 (02:16 +0800)]
lavfi/vf_avgblur_opencl: remove useless clFinish().

The very last clFinish() should be ok.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Reviewed-by: Danil Iashchenko <danyaschenko@gmail.com>