ffmpeg.git
2 months agoavcodec/rscc: Check that the to be uncompressed input is large enough
Michael Niedermayer [Sun, 31 Mar 2019 15:31:17 +0000 (17:31 +0200)]
avcodec/rscc: Check that the to be uncompressed input is large enough

Fixes: Out of array access
Fixes: 13984/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-5734128093233152

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 months agoavformat/movenc: free eac3 private data only when closing the stream
James Almer [Fri, 29 Mar 2019 01:36:25 +0000 (22:36 -0300)]
avformat/movenc: free eac3 private data only when closing the stream

This makes sure the data is available when writing the moov atom during the
second pass triggered by the faststart movflag.

Fixes ticket #7780

Signed-off-by: James Almer <jamrial@gmail.com>
2 months agox86/opusdsp: implement FMA3 accelerated postfilter and deemphasis
Lynne [Fri, 15 Mar 2019 14:43:04 +0000 (14:43 +0000)]
x86/opusdsp: implement FMA3 accelerated postfilter and deemphasis

58893 decicycles in deemphasis_c,  130548 runs,    524 skips
9475 decicycles in deemphasis_fma3,  130686 runs,    386 skips -> 6.21x speedup

24866 decicycles in postfilter_c,   65386 runs,    150 skips
5268 decicycles in postfilter_fma3,   65505 runs,     31 skips -> 4.72x speedup

Total decoder speedup: ~14%

Deemphasis SIMD based on the following unrolling:
const float c1 = CELT_EMPH_COEFF, c2 = c1*c1, c3 = c2*c1, c4 = c3*c1;
float state = coeff;

for (int i = 0; i < len; i += 4) {
    y[0] = x[0] + c1*state;
    y[1] = x[1] + c2*state + c1*x[0];
    y[2] = x[2] + c3*state + c1*x[1] + c2*x[0];
    y[3] = x[3] + c4*state + c1*x[2] + c2*x[1] + c3*x[0];

    state = y[3];
    y += 4;
    x += 4;
}

2 months agoopusdsp: create and move deemphasis and postfiltering from opus_celt
Lynne [Fri, 15 Mar 2019 14:35:03 +0000 (14:35 +0000)]
opusdsp: create and move deemphasis and postfiltering from opus_celt

2 months agocelt_pvq_init: only build when CONFIG_OPUS_ENCODER is enabled
Lynne [Sat, 16 Mar 2019 16:28:52 +0000 (17:28 +0100)]
celt_pvq_init: only build when CONFIG_OPUS_ENCODER is enabled

The entire function was defined away before.

2 months agox86/opus_dsp: rename to celt_pvq
Lynne [Sat, 16 Mar 2019 16:30:16 +0000 (17:30 +0100)]
x86/opus_dsp: rename to celt_pvq

Its only used in the encoder and in CELT's PVQ.

2 months agoavcodec/ivi: Reduce dereferencing structs in inner loop of ivi_process_empty_tile()
Michael Niedermayer [Sun, 24 Mar 2019 22:20:19 +0000 (23:20 +0100)]
avcodec/ivi: Reduce dereferencing structs in inner loop of ivi_process_empty_tile()

This speeds the code up by about 15%
Testcase: 13779/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO4_fuzzer-5699589711069184

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavcodec/ivi: Mark band parameter as const
Michael Niedermayer [Sun, 24 Mar 2019 21:59:01 +0000 (22:59 +0100)]
avcodec/ivi: Mark band parameter as const

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavcodec/ivi: fix indention for previous commit
Michael Niedermayer [Sun, 24 Mar 2019 21:52:19 +0000 (22:52 +0100)]
avcodec/ivi: fix indention for previous commit

2 months agoavcodec/ivi: Factor ref_mb check out
Michael Niedermayer [Sun, 24 Mar 2019 21:49:59 +0000 (22:49 +0100)]
avcodec/ivi: Factor ref_mb check out

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavcodec/proresdec2: decode picture header before frame allocation
Michael Niedermayer [Sun, 24 Mar 2019 19:04:12 +0000 (20:04 +0100)]
avcodec/proresdec2: decode picture header before frame allocation

Fixes: Timeout (21sec -> 0.3sec)
Fixes: 13716/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PRORES_fuzzer-5755593333145600

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavformat/doc, http, icecast, rtsp: Add option to disable send-expect-100
Jun Li [Sun, 31 Mar 2019 04:35:51 +0000 (21:35 -0700)]
avformat/doc, http, icecast, rtsp: Add option to disable send-expect-100

Fix ticket #7297
The current setting for send-expect-100 option is either
enabled if applicable or forced enabled, no option to force
disable the header. This change is to expand the option setting
to provide more flexibility, which is useful for rstp case.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavcodec/tiff: Multi-page support
Nick Renieris [Fri, 22 Mar 2019 15:55:56 +0000 (17:55 +0200)]
avcodec/tiff: Multi-page support

Option "-page N" (page index N starts from 1) can now be used to specify which TIFF page/subfile to decode.

Signed-off-by: Nick Renieris <velocityra@gmail.com>
2 months agolavf/flvdec: Cosmetics: Fix indentation for flv_read_packet
Jun Zhao [Tue, 26 Mar 2019 10:54:47 +0000 (18:54 +0800)]
lavf/flvdec: Cosmetics: Fix indentation for flv_read_packet

Commit e34ba5ec53b missed the indent

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2 months agolavf/flvdec: add AMF date type support
Jun Zhao [Tue, 26 Mar 2019 08:54:33 +0000 (16:54 +0800)]
lavf/flvdec: add AMF date type support

Support AMF date type when parse the FLV metadata.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2 months agoswscale/ppc: VSX-optimize yuv2422_X
Lauri Kasanen [Sun, 24 Mar 2019 12:55:45 +0000 (14:55 +0200)]
swscale/ppc: VSX-optimize yuv2422_X

./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 \
          -s 1200x720 -f null -vframes 100 -pix_fmt $i -nostats \
          -cpuflags 0 -v error -

7.2x speedup:

yuyv422
 126354 UNITS in yuv2packedX,   16384 runs,      0 skips
  16383 UNITS in yuv2packedX,   16382 runs,      2 skips
yvyu422
 117669 UNITS in yuv2packedX,   16384 runs,      0 skips
  16271 UNITS in yuv2packedX,   16379 runs,      5 skips
uyvy422
 117310 UNITS in yuv2packedX,   16384 runs,      0 skips
  16226 UNITS in yuv2packedX,   16382 runs,      2 skips

2 months agoswscale/ppc: VSX-optimize yuv2422_2
Lauri Kasanen [Sun, 24 Mar 2019 12:23:46 +0000 (14:23 +0200)]
swscale/ppc: VSX-optimize yuv2422_2

./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 -sws_flags area \
                -s 1200x720 -f null -vframes 100 -pix_fmt $i -nostats \
                -cpuflags 0 -v error -

5.1x speedup:

yuyv422
  19339 UNITS in yuv2packed2,   16384 runs,      0 skips
   3718 UNITS in yuv2packed2,   16383 runs,      1 skips
yvyu422
  19438 UNITS in yuv2packed2,   16384 runs,      0 skips
   3800 UNITS in yuv2packed2,   16380 runs,      4 skips
uyvy422
  19128 UNITS in yuv2packed2,   16384 runs,      0 skips
   3721 UNITS in yuv2packed2,   16380 runs,      4 skips

2 months agoswscale/ppc: VSX-optimize yuv2422_1
Lauri Kasanen [Sun, 24 Mar 2019 11:45:55 +0000 (13:45 +0200)]
swscale/ppc: VSX-optimize yuv2422_1

./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 \
            -s 1200x1440 -f null -vframes 100 -pix_fmt $i -nostats \
            -cpuflags 0 -v error -

15.3x speedup:

yuyv422
  14513 UNITS in yuv2packed1,   32768 runs,      0 skips
    949 UNITS in yuv2packed1,   32767 runs,      1 skips
yvyu422
  14516 UNITS in yuv2packed1,   32767 runs,      1 skips
    943 UNITS in yuv2packed1,   32767 runs,      1 skips
uyvy422
  14530 UNITS in yuv2packed1,   32767 runs,      1 skips
    941 UNITS in yuv2packed1,   32766 runs,      2 skips

2 months agoavcodec: add Amuse Graphics decoder
Paul B Mahol [Wed, 10 Oct 2018 10:43:55 +0000 (12:43 +0200)]
avcodec: add Amuse Graphics decoder

This work is sponsored by VideoLAN.

2 months agoavutil/hcontext_cuda: Remove unnecessary stream synchronisation
Philip Langdale [Sat, 30 Mar 2019 17:56:49 +0000 (10:56 -0700)]
avutil/hcontext_cuda: Remove unnecessary stream synchronisation

Similarly to the previous changes, we don't need to synchronise
after a memcpy to device memory. On the other hand, we need to
keep synchronising after a copy to host memory, otherwise there's
no guarantee that subsequent host reads will return valid data.

2 months agoavcodec/cuviddec: Remove unnecessary stream synchronisation
Philip Langdale [Sat, 30 Mar 2019 17:51:07 +0000 (10:51 -0700)]
avcodec/cuviddec: Remove unnecessary stream synchronisation

We're also doing a sync here after copying the frame to be passed
on down the pipleine. And it is also unnecessary.

I was able to demonstrate a 33% speedup removing the sync from
an example transcode pipeline.

2 months agoavfilter/vf_yadif_cuda: Remove unnecessary stream synchronisation
Philip Langdale [Sat, 30 Mar 2019 15:50:44 +0000 (08:50 -0700)]
avfilter/vf_yadif_cuda: Remove unnecessary stream synchronisation

I put this call in by habit, rather than because there was any
actual need. The filter is simply processing frames one after
the other and has no need to synchronise.

malakudi on the devtalk forums noticed a slowdown when using nvenc
with temporal/spatial aq and that the slowdown went away if the
sync call was removed. I also verified that in the basic encoding
case there's an observable speedup.

I also verified that we aren't doing unnecessary sync calls in any
other filter.

2 months agodoc/filters: mention input requirements for ebur128
Gyan Doshi [Sat, 30 Mar 2019 06:37:24 +0000 (12:07 +0530)]
doc/filters: mention input requirements for ebur128

The filter requires input stream to have sample rate 48000 Hz and dbl fmt.

Fixes #7812

2 months agoavcodec/libaomenc: fix default value for row-mt option
James Almer [Fri, 29 Mar 2019 17:55:00 +0000 (14:55 -0300)]
avcodec/libaomenc: fix default value for row-mt option

Signed-off-by: James Almer <jamrial@gmail.com>
2 months agoavcodec/libaomenc: Added more commandline options
Sam John via ffmpeg-devel [Fri, 29 Mar 2019 16:58:38 +0000 (09:58 -0700)]
avcodec/libaomenc: Added more commandline options

The following are the newly added options:
arnr_max_frames, arnr_strength, aq_mode, denoise_noise_level, denoise_block_size,
rc_undershoot_pct, rc_overshoot_pct, minsection_pct, maxsection_pct, frame_parallel,
enable_cdef, enable_global_motion, and intrabc.

Also added macros for compiling for aom 1.0.0 and fixed the default values.

Signed-off-by: James Almer <jamrial@gmail.com>
2 months agolavc/qsvenc: fix hevc vps extradata issues
Zhong Li [Mon, 25 Mar 2019 22:10:21 +0000 (06:10 +0800)]
lavc/qsvenc: fix hevc vps extradata issues

cbs trace qsv vps header failed due to some reasons:
1. vps_temporal_id_nesting_flag is not set but spec required it must to
   be 1 when vps_max_sub_layers_minus1 is equal to 0.
2. vps_num_hrd_parameters is not set and written.
3. other issues in ff_hevc_encode_nal_vps() (fixed in pervious commit_id: 520226b683).

Reproduce: ffmpeg -hwaccel qsv -v verbose -c:v h264_qsv -i bbb_sunflower_1080p_30fps_normal.mp4 -vframes 1
-c:v hevc_qsv  -bsf:v trace_headers -f null -

Signed-off-by: Zhong Li <zhong.li@intel.com>
2 months agolavc/hevc_ps_enc: fix vps nal issues
Zhong Li [Mon, 25 Mar 2019 22:08:37 +0000 (06:08 +0800)]
lavc/hevc_ps_enc: fix vps nal issues

1. write vps_num_hrd_parameters element
2. flush left bits

Signed-off-by: Zhong Li <zhong.li@intel.com>
2 months agoswscale/swscale_unscaled: Fix chroma slice height
Michael Niedermayer [Thu, 28 Mar 2019 21:30:59 +0000 (22:30 +0100)]
swscale/swscale_unscaled: Fix chroma slice height

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavcodec/dxv: Check remaining space in CHECKPOINT()
Michael Niedermayer [Wed, 20 Mar 2019 21:29:21 +0000 (22:29 +0100)]
avcodec/dxv: Check remaining space in CHECKPOINT()

Fixes: Timeout (77sec -> 1sec)
Fixes: 13407/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-5093143018471424

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agofftools/ffmpeg: Check if we do have also a filter_complex filter.
Thierry Foucu [Wed, 27 Mar 2019 21:11:59 +0000 (14:11 -0700)]
fftools/ffmpeg: Check if we do have also a filter_complex filter.

Right now, the code check for no filter description, but if we use a
filter_complex, the code will use the AVFrame.duration which could be
wrong in case of using fps filter.

How to reproduce the problem:
ffmpeg -f lavfi -i testsrc=duration=1 -vf fps=fps=50 -vsync 1 -f null -
output 50 frames

ffmpeg -f lavfi -i testsrc=duration=1 -filter_complex fps=fps=50 -vsync 1 -f null -
output 51 frames

With this commit, the same command will always output 50 frames.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoswscale/swscale_unscaled: fixed the issue that when width/height is not 2-multiple...
Dong, Jerry [Thu, 28 Mar 2019 11:40:53 +0000 (19:40 +0800)]
swscale/swscale_unscaled: fixed the issue that when width/height is not 2-multiple, transition of nv12 to u/v planes is not completed.

Signed-off-by: Dong, Jerry <jerry.dong@intel.com>
Signed-off-by: Decai Lin <decai.lin@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agolavc/qsvenc_h264: remove the privite option trellis
Zhong Li [Wed, 27 Mar 2019 11:39:41 +0000 (19:39 +0800)]
lavc/qsvenc_h264: remove the privite option trellis

There are many problems of current qsv trellis option:
1. Duplicated with AVCodecContext definition
2. MFX_TRELLIS_XXX is introduced by MSDK API 1.17
   Currently Without MSDK API checking thus may cause compilation issue.
3. user is inclined to enable trellis when set "-trellis 1", but
   actually it is to disable since MFX_TRELLIS_OFF is equal to 1.
4. It is too complex for user to enable trellis for every frame(I/P/B).

Just simply remove the private option, and switch to the AVCodecContext
definition. Compatibility should not a big problem (except can't exact map)
since the option name is same as AVCodecContext.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Reviewed-by: Moritz Barsnick <barsnick@gmx.net>
2 months agolavc/qsvenc: use the common option "trellis" of AVCodecContext
Zhong Li [Wed, 27 Mar 2019 11:33:37 +0000 (19:33 +0800)]
lavc/qsvenc: use the common option "trellis" of AVCodecContext

Signed-off-by: Zhong Li <zhong.li@intel.com>
2 months agoqsv: fix the dangerous macro definitions
Zhong Li [Wed, 27 Mar 2019 10:18:15 +0000 (18:18 +0800)]
qsv: fix the dangerous macro definitions

Signed-off-by: Zhong Li <zhong.li@intel.com>
Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
2 months agolavc/qsvenc: make the queried libmfx version easily reused
Zhong Li [Mon, 25 Mar 2019 23:40:54 +0000 (07:40 +0800)]
lavc/qsvenc: make the queried libmfx version easily reused

Signed-off-by: Zhong Li <zhong.li@intel.com>
2 months agoconfigure: include pkgconfig path as vaapi header search
Zhong Li [Wed, 20 Mar 2019 06:51:12 +0000 (14:51 +0800)]
configure: include pkgconfig path as vaapi header search

Currectly just standard header path can be found,
check_type/struct will fail if vaapi is installed somewhere else.

Move them followed "check_pkg_config"

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Zhong Li <zhong.li@intel.com>
2 months agolavc/vaapi_h264: Do not set FMO fields.
Carl Eugen Hoyos [Wed, 27 Mar 2019 13:58:51 +0000 (14:58 +0100)]
lavc/vaapi_h264: Do not set FMO fields.

The fields are deprecated in current vaapi,
setting them to 0 in old versions is fine
as FMO is not implemented.

Fixes the following warnings:
libavcodec/vaapi_h264.c:259:10: warning: 'num_slice_groups_minus1' is deprecated [-Wdeprecated-declarations]
        .num_slice_groups_minus1                    = pps->slice_group_count - 1,
         ^
libavcodec/vaapi_h264.c:260:10: warning: 'slice_group_map_type' is deprecated [-Wdeprecated-declarations]
        .slice_group_map_type                       = pps->mb_slice_group_map_type,
         ^
libavcodec/vaapi_h264.c:261:10: warning: 'slice_group_change_rate_minus1' is deprecated [-Wdeprecated-declarations]
        .slice_group_change_rate_minus1             = 0, /* FMO is not implemented */
         ^

Reviewed-by: Mark Thompson
2 months agolavc/vaapi_hevc: Do not initialize fields twice.
Carl Eugen Hoyos [Wed, 27 Mar 2019 13:52:35 +0000 (14:52 +0100)]
lavc/vaapi_hevc: Do not initialize fields twice.

Fixes the following compilation warnings:
libavcodec/vaapi_hevc.c:155:21: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
        .pic_fields.bits = {
                   ~^~~~
libavcodec/vaapi_hevc.c:125:57: note: previous initialization is here
        .pic_fields.value                             = 0,
                                                        ^
libavcodec/vaapi_hevc.c:175:31: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
        .slice_parsing_fields.bits = {
                             ~^~~~
libavcodec/vaapi_hevc.c:126:57: note: previous initialization is here
        .slice_parsing_fields.value                   = 0,

Reviewed-by: Mark Thompson
2 months agoconfigure: Do not enable both OpenCL-VAAPI interop modes simultaneously
Mark Thompson [Tue, 26 Mar 2019 23:39:19 +0000 (23:39 +0000)]
configure: Do not enable both OpenCL-VAAPI interop modes simultaneously

Beignet offers a far more flexiable and complete interface, so choose it
by default if available.

2 months agolavf/latmenc: Return the correct error for wrong codec.
Carl Eugen Hoyos [Wed, 27 Mar 2019 13:54:05 +0000 (14:54 +0100)]
lavf/latmenc: Return the correct error for wrong codec.

Requested-by: Nicolas George
2 months agoavcodec/hevcdec: Avoid only partly skiping duplicate first slices
Michael Niedermayer [Sat, 23 Mar 2019 19:55:08 +0000 (20:55 +0100)]
avcodec/hevcdec: Avoid only partly skiping duplicate first slices

Fixes: NULL pointer dereference and out of array access
Fixes: 13871/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5746167087890432
Fixes: 13845/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5650370728034304

This also fixes the return code for explode mode

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoswscale/ppc: VSX-optimize yuv2rgb_full
Lauri Kasanen [Wed, 20 Mar 2019 11:17:43 +0000 (13:17 +0200)]
swscale/ppc: VSX-optimize yuv2rgb_full

./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 \
        -s 1200x1440 -f null -vframes 100 -pix_fmt $i -nostats \
        -cpuflags 0 -v error -

This uses 32-bit mul, so POWER8 only.

The following output formats get about 4.5x speedup:

rgb24
  39980 UNITS in yuv2packed1,   32768 runs,      0 skips
   8774 UNITS in yuv2packed1,   32768 runs,      0 skips
bgr24
  40069 UNITS in yuv2packed1,   32768 runs,      0 skips
   8772 UNITS in yuv2packed1,   32766 runs,      2 skips
rgba
  39759 UNITS in yuv2packed1,   32768 runs,      0 skips
   8681 UNITS in yuv2packed1,   32767 runs,      1 skips
bgra
  39729 UNITS in yuv2packed1,   32768 runs,      0 skips
   8696 UNITS in yuv2packed1,   32766 runs,      2 skips
argb
  39766 UNITS in yuv2packed1,   32768 runs,      0 skips
   8672 UNITS in yuv2packed1,   32766 runs,      2 skips
bgra
  39784 UNITS in yuv2packed1,   32768 runs,      0 skips
   8659 UNITS in yuv2packed1,   32767 runs,      1 skips

2 months agoswscale: Remove duplicated code
Lauri Kasanen [Sun, 24 Mar 2019 11:00:39 +0000 (13:00 +0200)]
swscale: Remove duplicated code

In this function, the exact same clamping happens both in the if and unconditionally.

2 months agolavc/h264_levels: add MaxMBPS checking and update fate test.
Decai Lin [Wed, 20 Mar 2019 09:14:47 +0000 (17:14 +0800)]
lavc/h264_levels: add MaxMBPS checking and update fate test.

1. add MaxMBPS checking for level idc setting to align with AVC spec
   AnnexA table A-1/A-6 level limits.
2. update h264 level fate test.

Signed-off-by: Decai Lin <decai.lin@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2 months agolavc/bmp: Avoid a heap buffer overwrite for 1bpp input.
Carl Eugen Hoyos [Tue, 26 Mar 2019 12:32:11 +0000 (13:32 +0100)]
lavc/bmp: Avoid a heap buffer overwrite for 1bpp input.

Found by Mingi Cho, Seoyoung Kim, and Taekyoung Kwon
of the Information Security Lab, Yonsei University.

2 months agoavformat/avformat.h: Update the comment for AVInputFormat.flags
Jun Zhao [Mon, 25 Mar 2019 08:28:41 +0000 (16:28 +0800)]
avformat/avformat.h: Update the comment for AVInputFormat.flags

AVFMT_NOTIMESTAMPS may be using in AVInputFormat.flags for demuxing

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2 months agoavfilter/vf_lensfun: add scale parameter
Daniel Playfair Cal [Mon, 25 Mar 2019 02:07:28 +0000 (13:07 +1100)]
avfilter/vf_lensfun: add scale parameter

The lensfun filter wraps the lensfun library which performs
transformations on videos to correct for lens distortion. Often this
results in areas in the input being mapped to areas that fall outside
the boundaries of the output. The library has a parameter called scale
which is a scale factor applied to the output video. By decreasing it it
is possible to regain the areas of the video which would otherwise have
been lost. There is a special value of 0 which indicates that the
library should automatically determine a scale factor that results in
the output frame being filled (i.e. little or no black/unmapped areas).

This patch adds a corresponding scale option to the lensfun filter which
is passed through to the library. The existing behaviour of using the
automatic value of 0 is retained as the default behaviour, while other
values will be passed through to the library.

Signed-off-by: Daniel Playfair Cal <daniel.playfair.cal@gmail.com>
2 months agodoc/filters: indicate range for zoom in lavfi/zoompan
Gyan Doshi [Mon, 25 Mar 2019 16:33:47 +0000 (22:03 +0530)]
doc/filters: indicate range for zoom in lavfi/zoompan

2 months agoavcodec/cbs_av1: fix range of values for Mastering Display Color Volume Metadata...
James Almer [Thu, 21 Mar 2019 18:37:26 +0000 (15:37 -0300)]
avcodec/cbs_av1: fix range of values for Mastering Display Color Volume Metadata OBUs

Signed-off-by: James Almer <jamrial@gmail.com>
2 months agoavcodec/jpeg2000dec: Skip de-quantization of empty areas
Michael Niedermayer [Tue, 19 Mar 2019 16:10:42 +0000 (17:10 +0100)]
avcodec/jpeg2000dec: Skip de-quantization of empty areas

Fixes: Timeout (26sec -> 18sec)
Fixes: 13448/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-576903098243481

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavcodec/prosumer: Check decoded size
Michael Niedermayer [Tue, 19 Mar 2019 22:51:10 +0000 (23:51 +0100)]
avcodec/prosumer: Check decoded size

Fixes: Timeout (longer than i had patience for -> 2sec)
Fixes: 13205/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PROSUMER_fuzzer-5105644481282048

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavcodec/mpegpicture: Check size of edge_emu_buffer
Michael Niedermayer [Sun, 17 Mar 2019 14:18:20 +0000 (15:18 +0100)]
avcodec/mpegpicture: Check size of edge_emu_buffer

Fixes: OOM
Fixes: 13710/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5633152942342144

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavcodec/indeo2: Check input size against resolution in ir2_decode_plane()
Michael Niedermayer [Sun, 17 Mar 2019 20:39:57 +0000 (21:39 +0100)]
avcodec/indeo2: Check input size against resolution in ir2_decode_plane()

Fixes: Timeout (56 sec -> 14 sec)
Fixes: 13708/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO2_fuzzer-5656342004498432

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavformat/mov: Fix potential integer overflow in entry check in mov_read_trun()
Michael Niedermayer [Sun, 17 Mar 2019 10:14:26 +0000 (11:14 +0100)]
avformat/mov: Fix potential integer overflow in entry check in mov_read_trun()

No testcase

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavcodec/dxtory: Check slice sizes before allocating image
Michael Niedermayer [Sat, 16 Mar 2019 10:02:48 +0000 (11:02 +0100)]
avcodec/dxtory: Check slice sizes before allocating image

Fixes: Timeout (26sec -> 2sec)
Fixes: 13612/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXTORY_fuzzer-5676845977042944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavcodec/truemotion2: Fix integer overflow in tm2_null_res_block()
Michael Niedermayer [Sat, 16 Mar 2019 01:30:57 +0000 (02:30 +0100)]
avcodec/truemotion2: Fix integer overflow in tm2_null_res_block()

Fixes: signed integer overflow: 1111638592 - -2122219136 cannot be represented in type 'int'
Fixes: 13441/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5732769815068672

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavformat/rtsp: Add https tunneling support
Jun Li [Thu, 21 Mar 2019 23:58:41 +0000 (16:58 -0700)]
avformat/rtsp: Add https tunneling support

Add https based tunneling for RTSP/RTP. Tested on Axis and Bosch cameras.
Https is widely used for security consideration.

2 months agoavcodec/av1_parser: don't abort parsing the first frame if extradata parsing fails
James Almer [Sun, 24 Mar 2019 21:22:32 +0000 (18:22 -0300)]
avcodec/av1_parser: don't abort parsing the first frame if extradata parsing fails

The first frame contains the sequence header, which is needed to parse every
following frame.

This fixes parsing streams with broken extradata but correct packet data.

Signed-off-by: James Almer <jamrial@gmail.com>
2 months agoavcodec/tiff: do not allow bpp 40 with undefined pixel formats
Michael Niedermayer [Sat, 23 Mar 2019 17:28:10 +0000 (18:28 +0100)]
avcodec/tiff: do not allow bpp 40 with undefined pixel formats

Fixes: Out of array access, assertion failure
Fixes: 13851/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5754570929602560
Fixes: 13869/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5695998313103360
Fixes: 13873/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5077273645940736
Fixes: 13874/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5756396757319680
Fixes: 13877/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5741026750234624
Fixes: 13880/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5649148809838592

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agolavd/v4l2: Fix the type of the probe function.
Carl Eugen Hoyos [Sat, 23 Mar 2019 22:42:09 +0000 (23:42 +0100)]
lavd/v4l2: Fix the type of the probe function.

2 months agolavc/libdavs2: fix frame dumping error description
hwrenx [Sat, 23 Mar 2019 06:08:00 +0000 (14:08 +0800)]
lavc/libdavs2: fix frame dumping error description

Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: hwrenx <hwrenx@126.com>
2 months agolavc/libdavs2: add davs2_flush
hwrenx [Sat, 23 Mar 2019 06:07:16 +0000 (14:07 +0800)]
lavc/libdavs2: add davs2_flush

Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: hwrenx <hwrenx@126.com>
2 months agoavformat/avformat.h: update the comment from deprecated to new API
Steven Liu [Sat, 23 Mar 2019 06:04:39 +0000 (14:04 +0800)]
avformat/avformat.h: update the comment from deprecated to new API

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2 months agolavf/flvdec: fix typo in log message
Jun Zhao [Sat, 23 Mar 2019 03:28:15 +0000 (11:28 +0800)]
lavf/flvdec: fix typo in log message

fix typo in log message, it's come from cd141e71bd3

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2 months agolavfi/sidedata: add missed frame side data type
Jun Zhao [Sat, 9 Mar 2019 03:56:39 +0000 (11:56 +0800)]
lavfi/sidedata: add missed frame side data type

add missed frame side data type

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2 months agoMerge commit '0676de935b1e81bc5b5698fef3e7d48ff2ea77ff'
James Almer [Fri, 22 Mar 2019 19:04:42 +0000 (16:04 -0300)]
Merge commit '0676de935b1e81bc5b5698fef3e7d48ff2ea77ff'

* commit '0676de935b1e81bc5b5698fef3e7d48ff2ea77ff':
  arm: Implement a NEON version of 422 h264_h_loop_filter_chroma

Merged-by: James Almer <jamrial@gmail.com>
2 months agolavd/v4l2-common: Add an entry for Z16.
Carl Eugen Hoyos [Thu, 21 Mar 2019 00:24:42 +0000 (01:24 +0100)]
lavd/v4l2-common: Add an entry for Z16.

2 months agolavfi/colorspace_common: add ifdef check to be more compatible.
Ruiling Song [Mon, 21 Jan 2019 07:44:04 +0000 (15:44 +0800)]
lavfi/colorspace_common: add ifdef check to be more compatible.

Some filters may not need to do linearize/delinearize, thus
will even not define them. Add ifdef check, so they could easily
re-use the .cl file.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
2 months agolavfi/tonemap_opencl: reuse color matrix calculation from colorspace.c
Ruiling Song [Tue, 22 Jan 2019 07:01:56 +0000 (15:01 +0800)]
lavfi/tonemap_opencl: reuse color matrix calculation from colorspace.c

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
2 months agolavfi/opencl: add ff_opencl_print_const_matrix_3x3()
Ruiling Song [Tue, 22 Jan 2019 06:47:54 +0000 (14:47 +0800)]
lavfi/opencl: add ff_opencl_print_const_matrix_3x3()

This is used to print a 3x3 matrix into a part of OpenCL
source code.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
2 months agolavfi/colorspace: move some functions to common file
Ruiling Song [Tue, 22 Jan 2019 06:27:01 +0000 (14:27 +0800)]
lavfi/colorspace: move some functions to common file

These functions can be reused by other colorspace filters,
so move them to common file. No functional changes.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
2 months agolavu/opencl: replace va_ext.h with standard name
Ruiling Song [Fri, 23 Nov 2018 05:39:12 +0000 (13:39 +0800)]
lavu/opencl: replace va_ext.h with standard name

Khronos OpenCL header (https://github.com/KhronosGroup/OpenCL-Headers)
uses cl_va_api_media_sharing_intel.h. And Intel's official OpenCL driver
for Intel GPU (https://github.com/intel/compute-runtime) was compiled
against Khronos OpenCL header. So it's better to align with Khronos.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
2 months agoarm: Implement a NEON version of 422 h264_h_loop_filter_chroma
Martin Storsjö [Tue, 12 Mar 2019 09:49:18 +0000 (11:49 +0200)]
arm: Implement a NEON version of 422 h264_h_loop_filter_chroma

Previously, the 420 version was used even for 422.

This fixes occasional checkasm failures.

Signed-off-by: Martin Storsjö <martin@martin.st>
2 months agoMAINTAINERS: remove myself as mailing list maintainer
Lou Logan [Thu, 21 Mar 2019 19:34:13 +0000 (11:34 -0800)]
MAINTAINERS: remove myself as mailing list maintainer

Refer to Michael, compn, or Baptiste.

Signed-off-by: Lou Logan <lou@lrcd.com>
2 months agodoc/mailing-list-faq: ffmpeg-devel is now subscription only
Lou Logan [Thu, 21 Mar 2019 19:26:11 +0000 (11:26 -0800)]
doc/mailing-list-faq: ffmpeg-devel is now subscription only

Nobody is going to check the queue anymore, so users must now subscribe to
send messages to ffmpeg-devel. This will prevent orphaned/ignored messages
from rotting in the abandoned queue. This matches the behavior of ffmpeg-user
and libav-user.

Also, this addresses some other nits.

Signed-off-by: Lou Logan <lou@lrcd.com>
2 months agolavf: Constify the probe function argument.
Carl Eugen Hoyos [Thu, 21 Mar 2019 00:18:37 +0000 (01:18 +0100)]
lavf: Constify the probe function argument.

Reviewed-by: Lauri Kasanen
Reviewed-by: Tomas Härdin
2 months agoMaintainers : remove myself
Martin Vignali [Thu, 21 Mar 2019 00:36:48 +0000 (01:36 +0100)]
Maintainers : remove myself

Too much hostility in this project
Not enough respect for users and contributors

I'm not interested to contribute anymore

2 months agoavfilter/af_astats: add support for optimized min/max/peak calculation
Marton Balint [Fri, 1 Mar 2019 23:10:21 +0000 (00:10 +0100)]
avfilter/af_astats: add support for optimized min/max/peak calculation

Signed-off-by: Marton Balint <cus@passwd.hu>
2 months agoavfilter/af_astats: rework sample loops
Marton Balint [Fri, 1 Mar 2019 22:48:04 +0000 (23:48 +0100)]
avfilter/af_astats: rework sample loops

The channel loop is now the outer loop for both planar and interleaved. This is
needed by the next patch, and the speed difference is negligable if any.

Signed-off-by: Marton Balint <cus@passwd.hu>
2 months agoavfilter/af_astats: factorize sample loops
Marton Balint [Fri, 1 Mar 2019 22:09:54 +0000 (23:09 +0100)]
avfilter/af_astats: factorize sample loops

Signed-off-by: Marton Balint <cus@passwd.hu>
2 months agoavfilter/af_astats: fix identation
Marton Balint [Fri, 1 Mar 2019 20:51:34 +0000 (21:51 +0100)]
avfilter/af_astats: fix identation

Signed-off-by: Marton Balint <cus@passwd.hu>
2 months agoavfilter/af_astats: add support for selecting measured statistics
Marton Balint [Fri, 1 Mar 2019 00:32:00 +0000 (01:32 +0100)]
avfilter/af_astats: add support for selecting measured statistics

set_metadata with many entries is not very efficient, and with small audio
frames the performance loss is noticable. Also with this very simple
calculations (like peak) can be even further optimized.

Unfoturnately there are some small differences in metadata and av_log info
output, so factorizing calculations and output might not worth the hassle.

Signed-off-by: Marton Balint <cus@passwd.hu>
2 months agolavf/latmenc: Error out for unsupported codecs.
Carl Eugen Hoyos [Wed, 1 Nov 2017 01:15:10 +0000 (02:15 +0100)]
lavf/latmenc: Error out for unsupported codecs.

2 months agoavcodec/hevcdec: decode at most one slice reporting being the first in the picture
James Almer [Mon, 18 Mar 2019 20:25:58 +0000 (17:25 -0300)]
avcodec/hevcdec: decode at most one slice reporting being the first in the picture

Fixes deadlocks when decoding packets containing more than one of the aforementioned
slices when using frame threads.

Tested-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2 months agolavf/allformats: Remove an accidentally committed line.
Carl Eugen Hoyos [Wed, 20 Mar 2019 22:36:45 +0000 (23:36 +0100)]
lavf/allformats: Remove an accidentally committed line.

Regression since 3aa6208d.
Reported-by: Lou Logan
2 months agodoc/ffmpeg: muxdelay and muxpreload are output options
Aman Gupta [Wed, 20 Mar 2019 21:54:13 +0000 (14:54 -0700)]
doc/ffmpeg: muxdelay and muxpreload are output options

Signed-off-by: Aman Gupta <aman@tmm1.net>
2 months agoavcodec/arbc: Check nb_segments before allocating and copying frame
Michael Niedermayer [Wed, 13 Mar 2019 20:48:25 +0000 (21:48 +0100)]
avcodec/arbc: Check nb_segments before allocating and copying frame

Fixes: Timeout (30sec -> 2sec)
Fixes: 13578/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARBC_fuzzer-5685625527730176

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agoavcodec/scpr: Perform frame copy later
Michael Niedermayer [Thu, 14 Mar 2019 20:23:03 +0000 (21:23 +0100)]
avcodec/scpr: Perform frame copy later

Optimization found while looking at 13442/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCPR_fuzzer-5758293933293568

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agotools/target_dec_fate.list: add issues 4000 to 6000
Michael Niedermayer [Fri, 15 Mar 2019 00:30:13 +0000 (01:30 +0100)]
tools/target_dec_fate.list: add issues 4000 to 6000

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 months agolavf: Constify AVProbeData* in av_probe_input_format().
Carl Eugen Hoyos [Wed, 20 Mar 2019 18:04:49 +0000 (19:04 +0100)]
lavf: Constify AVProbeData* in av_probe_input_format().

2 months agolavf/avformat: Add a warning that ff_const59 is not part of the public api.
Carl Eugen Hoyos [Wed, 20 Mar 2019 17:56:47 +0000 (18:56 +0100)]
lavf/avformat: Add a warning that ff_const59 is not part of the public api.

2 months agolavf: Constify AVInputFormat pointer.
Carl Eugen Hoyos [Wed, 20 Mar 2019 17:52:38 +0000 (18:52 +0100)]
lavf: Constify AVInputFormat pointer.

2 months agolavf: Constify AVOutputFormat pointer.
Carl Eugen Hoyos [Wed, 20 Mar 2019 17:38:48 +0000 (18:38 +0100)]
lavf: Constify AVOutputFormat pointer.

2 months agolavc/arbc: Use AV_WB24() where applicable.
Carl Eugen Hoyos [Sun, 27 Jan 2019 14:10:04 +0000 (15:10 +0100)]
lavc/arbc: Use AV_WB24() where applicable.

2 months agolavc/tiff: Allow decoding of cmyka (five components).
Carl Eugen Hoyos [Wed, 20 Mar 2019 16:50:25 +0000 (17:50 +0100)]
lavc/tiff: Allow decoding of cmyka (five components).

Fixes ticket #7675.

2 months agolavf/http: Print metadata updates with -loglevel verbose.
Carl Eugen Hoyos [Sat, 9 Feb 2019 23:59:30 +0000 (00:59 +0100)]
lavf/http: Print metadata updates with -loglevel verbose.

Simplifies metadata debugging.

2 months agolavf/spdifenc: Do not overwrite buffer when muxing TrueHD.
Carl Eugen Hoyos [Thu, 14 Feb 2019 19:16:18 +0000 (20:16 +0100)]
lavf/spdifenc: Do not overwrite buffer when muxing TrueHD.

Fixes ticket #7733.

Tested-by: Moritz Barsnick
2 months agolavc/truehd_core: Initialize the last bytes of the output buffer.
Carl Eugen Hoyos [Thu, 14 Feb 2019 21:43:10 +0000 (22:43 +0100)]
lavc/truehd_core: Initialize the last bytes of the output buffer.

Avoids undeterministic output.

2 months agolavf/sdp: Change pointer to configuration from char* to uint8_t*.
Carl Eugen Hoyos [Thu, 14 Mar 2019 23:52:50 +0000 (00:52 +0100)]
lavf/sdp: Change pointer to configuration from char* to uint8_t*.

This is also what av_base64_encode() expects.
Fixes the following warnings with clang:
libavformat/sdp.c:394:40: warning: implicit conversion from 'int' to 'char' changes value from 254 to -2
libavformat/sdp.c:395:40: warning: implicit conversion from 'int' to 'char' changes value from 205 to -51
libavformat/sdp.c:396:40: warning: implicit conversion from 'int' to 'char' changes value from 186 to -70

2 months agolavc/qtrle: Avoid an unaligned 64-bit write.
Carl Eugen Hoyos [Fri, 15 Mar 2019 00:14:58 +0000 (01:14 +0100)]
lavc/qtrle: Avoid an unaligned 64-bit write.

pixel_ptr can be increased by 4.
Fixes a crash on sparc64.