]> git.sesse.net Git - ffmpeg/log
ffmpeg
5 years agoavformat/hls: avformat_find_stream_info when the audio list in the variant
Steven Liu [Tue, 4 Jun 2019 07:27:11 +0000 (15:27 +0800)]
avformat/hls: avformat_find_stream_info when the audio list in the variant

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
5 years agoavformat/dashdec: add http_proxy, referer and rw_timeout http method support for...
Steven Liu [Mon, 3 Jun 2019 09:03:41 +0000 (17:03 +0800)]
avformat/dashdec: add http_proxy, referer and rw_timeout http method support for segments

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
5 years agoavformat/hlsenc: add EXT-X-I-FRAMES-ONLY tag support
Steven Liu [Sun, 2 Jun 2019 14:03:17 +0000 (22:03 +0800)]
avformat/hlsenc: add EXT-X-I-FRAMES-ONLY tag support

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
5 years agolavf/qsv_vpp: add frame format option
Zhong Li [Fri, 31 May 2019 00:44:47 +0000 (08:44 +0800)]
lavf/qsv_vpp: add frame format option

1. Currently output format is hard-coded as NV12, thus means
   CSC is always done for not NV12 input such as P010.
   Follow original input format as default output.
2. Add an option to specify output format.

Signed-off-by: Zhong Li <zhong.li@intel.com>
5 years agoavformat/id3v2enc: fix bug, CTOC flags take only one byte
Paul B Mahol [Thu, 13 Jun 2019 21:11:10 +0000 (23:11 +0200)]
avformat/id3v2enc: fix bug, CTOC flags take only one byte

5 years agoavcodec/mediacodecdec: re-indent after previous commit
Matthieu Bouron [Wed, 24 Apr 2019 07:59:30 +0000 (09:59 +0200)]
avcodec/mediacodecdec: re-indent after previous commit

5 years agoavcodec/mediacodecdec: remove unneeded else block in ff_mediacodec_dec_send()
Matthieu Bouron [Wed, 24 Apr 2019 07:59:29 +0000 (09:59 +0200)]
avcodec/mediacodecdec: remove unneeded else block in ff_mediacodec_dec_send()

5 years agoavcodec/mediacodecdec: try to receive a frame after signaling EOF to the codec
Matthieu Bouron [Wed, 24 Apr 2019 07:59:28 +0000 (09:59 +0200)]
avcodec/mediacodecdec: try to receive a frame after signaling EOF to the codec

Avoids returning EAGAIN after signaling EOF to the codec in
ff_mediacodec_dec_send() so we can try to receive a frame before
returning in mediacodec_receive_frame().

This helps avoiding an extra round-trip between avcodec_send_frame() and
avcodec_receive_frame() while draining the remaining frames.

5 years agoavcodec/omx: Correct av_log() log message
Alejandro Solozabal [Wed, 12 Jun 2019 12:16:25 +0000 (12:16 +0000)]
avcodec/omx: Correct av_log() log message

Print the right library name, which is trying to open, on the log message.

Signed-off-by: Alejandro Solozabal <a.solozabal@hotmail.com>
5 years agovaapi_encode_mjpeg: fix bad component id bug
U. Artie Eoff [Fri, 7 Jun 2019 21:45:33 +0000 (14:45 -0700)]
vaapi_encode_mjpeg: fix bad component id bug

The compound literals assigned to "components"
only exist within the scope of the if/else
block (thanks Mark Thompson for the better
explanation).

Thus, after this if/else block, "components"
ends up pointing to an arbitrary/undefined
array.  With some compilers and depending on
optimization settings, these arbitrary values
may end up being the same value (i.e. 0 with
GNU GCC 9.x).  Unfortunately, the GNU GCC
compiler, at least, never prints any warnings
about this.

This patch fixes this issue by assigning the
constant arrays to local variables at function
scope and then pointing "components" to those
as necessary.

Fixes #7915

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
5 years agoavfilter/vf_gblur: add missing preprocessor check
James Almer [Wed, 12 Jun 2019 13:54:59 +0000 (10:54 -0300)]
avfilter/vf_gblur: add missing preprocessor check

Fixes compilation on x86_32

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoconfigure: add missing dnn dependency to derain filter
James Almer [Wed, 12 Jun 2019 13:27:35 +0000 (10:27 -0300)]
configure: add missing dnn dependency to derain filter

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agofate: add VP4 test
Peter Ross [Tue, 14 May 2019 13:25:50 +0000 (23:25 +1000)]
fate: add VP4 test

5 years agoavformat/riff: add VP4 fourcc
Peter Ross [Fri, 11 Jan 2019 23:30:02 +0000 (10:30 +1100)]
avformat/riff: add VP4 fourcc

5 years agoVP4 video decoder
Peter Ross [Sun, 6 Jan 2019 06:45:04 +0000 (17:45 +1100)]
VP4 video decoder

5 years agoavcodec/vp3: spin off get_eob_run and get_coeff coeff functions
Peter Ross [Sat, 8 Jun 2019 00:55:51 +0000 (10:55 +1000)]
avcodec/vp3: spin off get_eob_run and get_coeff coeff functions

these reoutines are shared by vp3 and vp4.

5 years agoavcodec/mjpegdec: Check for non ls PAL8
Michael Niedermayer [Sat, 1 Jun 2019 17:06:07 +0000 (19:06 +0200)]
avcodec/mjpegdec: Check for non ls PAL8

Fixes: Null-dereference READ in av_malloc
Fixes: 15002/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THP_fuzzer-5643474625363968
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/v4l2_m2m_dec: Fix memleak on ff_v4l2_m2m_codec_init() failure
Michael Niedermayer [Sat, 1 Jun 2019 14:44:46 +0000 (16:44 +0200)]
avcodec/v4l2_m2m_dec: Fix memleak on ff_v4l2_m2m_codec_init() failure

Fixes: 13579/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG1_V4L2M2M_fuzzer-5753560726241280
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agotests/ref/fate/nuv-rtjpeg: Preserve the original timestamps
Michael Niedermayer [Thu, 30 May 2019 13:02:07 +0000 (15:02 +0200)]
tests/ref/fate/nuv-rtjpeg: Preserve the original timestamps

The tests previously rounded the timestamps. Its better in a fate test to preserve
the data from the demuxer and decoder.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/interplayvideo: check decoding_map_size with video_data_size
Michael Niedermayer [Sun, 26 May 2019 21:18:34 +0000 (23:18 +0200)]
avcodec/interplayvideo: check decoding_map_size with video_data_size

Fixes: Timeout (90543 ms -> 59 ms)
Fixes: 14721/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INTERPLAY_VIDEO_fuzzer-5697492148027392
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/h264_parse: Use 64bit for expectedpoc and expected_delta_per_poc_cycle
Michael Niedermayer [Thu, 23 May 2019 21:17:35 +0000 (23:17 +0200)]
avcodec/h264_parse: Use 64bit for expectedpoc and expected_delta_per_poc_cycle

Fixes: signed integer overflow: -2142516591 + -267814575 cannot be represented in type 'int'
Fixes: 14450/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5716105319940096
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>
5 years agocheckasm/vf_gblur: add test for horiz_slice simd
Ruiling Song [Tue, 4 Jun 2019 08:34:08 +0000 (16:34 +0800)]
checkasm/vf_gblur: add test for horiz_slice simd

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
5 years agoavfilter/vf_gblur: add x86 SIMD optimizations
Ruiling Song [Wed, 15 May 2019 09:54:10 +0000 (17:54 +0800)]
avfilter/vf_gblur: add x86 SIMD optimizations

The horizontal pass get ~2x performance with the patch
under single thread.

Tested overall performance using the command(avx2 enabled):
./ffmpeg -i 1080p.mp4 -vf gblur -f null /dev/null
./ffmpeg -i 1080p.mp4 -vf gblur=threads=1 -f null /dev/null
For single thread, the fps improves from 43 to 60, about 40%.
For multi-thread, the fps improves from 110 to 130, about 20%.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
5 years agolibavfilter/vf_cover_rect.c: free the allocated frame
Limin Wang [Tue, 11 Jun 2019 01:45:58 +0000 (09:45 +0800)]
libavfilter/vf_cover_rect.c: free the allocated frame

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavfilter/vf_normalize: fix filtering of RGB0 formats
Paul B Mahol [Mon, 10 Jun 2019 20:58:45 +0000 (22:58 +0200)]
avfilter/vf_normalize: fix filtering of RGB0 formats

5 years agoavformat/nut: add cpia codec
Stephan Hilb [Thu, 6 Jun 2019 20:31:44 +0000 (22:31 +0200)]
avformat/nut: add cpia codec

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agolavf/qsvvpp: add P010 output format support
Zhong Li [Fri, 31 May 2019 00:44:48 +0000 (08:44 +0800)]
lavf/qsvvpp: add P010 output format support

Signed-off-by: Zhong Li <zhong.li@intel.com>
5 years agolavf/qsvvpp: add extra_hw_frames support
Zhong Li [Wed, 5 Jun 2019 08:56:27 +0000 (16:56 +0800)]
lavf/qsvvpp: add extra_hw_frames support

extra_hw_frames is needed for some cases.
(eg: qsv decoding + qsv vpp + qsv look_ahead encoding, transcoding
 failed if no extra_hw_frames supported:
 ffmpeg -hwaccel qsv -c:v h264_qsv -i bbb_sunflower_1080p_30fps_normal_2000frames.mp4 \
-vf vpp_qsv=w=1280:h=720:extra_hw_frames=100 -v verbose  -c:v h264_qsv \
-look_ahead 1 -look_ahead_depth 100 out1.mp4
)

Signed-off-by: Zhong Li <zhong.li@intel.com>
5 years agofate: add dst decoder test
Peter Ross [Mon, 24 Dec 2018 09:09:46 +0000 (20:09 +1100)]
fate: add dst decoder test

5 years agoavfilter/vf_lut2: add slice threading
Paul B Mahol [Sun, 9 Jun 2019 12:07:00 +0000 (14:07 +0200)]
avfilter/vf_lut2: add slice threading

5 years agoavcodec/vp3data: combine eob_run_base and eob_run_get_bits tables
Peter Ross [Fri, 24 May 2019 10:10:32 +0000 (20:10 +1000)]
avcodec/vp3data: combine eob_run_base and eob_run_get_bits tables

5 years agocbs_av1, cbs_jpeg, cbs_mpeg2, cbs_vp9: Fix undef
Andreas Rheinhardt [Fri, 7 Jun 2019 00:27:11 +0000 (02:27 +0200)]
cbs_av1, cbs_jpeg, cbs_mpeg2, cbs_vp9: Fix undef

READ has already been undefined at this point; it is obviously intended
to undef WRITE.
Furthermore, leb128 (in cbs_av1) was undefined too often and
inconsistently.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
5 years agolavfi/vaapi: Fix build with libva 2.1 and 2.2
Mark Thompson [Fri, 7 Jun 2019 20:15:29 +0000 (21:15 +0100)]
lavfi/vaapi: Fix build with libva 2.1 and 2.2

While the VAProcColorProperties structure was added in libva 2.1, the
colour primaries/transfer/space fields were not added until libva 2.3.

5 years agoavformat/matroskadec: Compactify structure
Andreas Rheinhardt [Thu, 16 May 2019 22:29:47 +0000 (00:29 +0200)]
avformat/matroskadec: Compactify structure

Matroska EBML IDs can be only four bytes long maximally, so it is
natural to use uint32_t for them. By doing this and rearranging the
elements of the MatroskaLevel1Element structure, one can reduce the size
of said structure.

Notice that this field is not read via the generic reading process for
EBML_UINT, so one is not forced to use an uint64_t for it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/matroskadec: Correct outdated error message
Andreas Rheinhardt [Thu, 16 May 2019 22:29:46 +0000 (00:29 +0200)]
avformat/matroskadec: Correct outdated error message

This error message is outdated since d31fb1a9.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/matroskadec: Remove unused variables
Andreas Rheinhardt [Thu, 16 May 2019 22:29:45 +0000 (00:29 +0200)]
avformat/matroskadec: Remove unused variables

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/id3v2enc: write CTOC too
Paul B Mahol [Tue, 4 Jun 2019 14:44:19 +0000 (16:44 +0200)]
avformat/id3v2enc: write CTOC too

5 years agolavf/hls: Update av_log() log message
Jun Zhao [Sat, 1 Jun 2019 10:45:35 +0000 (18:45 +0800)]
lavf/hls: Update av_log() log message

Pass correct pointer to av_log() and update some error/warning message,
it's will help the debugging

Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
5 years agolibavfilter: Add derain filter
Xuewei Meng [Thu, 30 May 2019 12:35:17 +0000 (20:35 +0800)]
libavfilter: Add derain filter

Remove the rain in the input image/video by applying the derain
methods based on convolutional neural networks. Training scripts
as well as scripts for model generation are provided in the
repository at https://github.com/XueweiMeng/derain_filter.git.

Signed-off-by: Xuewei Meng <xwmeng96@gmail.com>
5 years agoavfilter/framesync: fix shortest with eof_action=pass
Gyan Doshi [Wed, 5 Jun 2019 14:22:04 +0000 (19:52 +0530)]
avfilter/framesync: fix shortest with eof_action=pass

Shifted check of shortest to after repeatlast,
to ensure shortest=1 is always honoured.

5 years agoavcodec/mss4: Check input size against skip bits
Michael Niedermayer [Tue, 14 May 2019 12:29:43 +0000 (14:29 +0200)]
avcodec/mss4: Check input size against skip bits

Fixes: Timeout (17sec -> 20ms)
Fixes: 14615/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MTS2_fuzzer-5093007763701760
Fixes: 14797/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MTS2_fuzzer-5651696119709696
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/dxv: Check op_offset in dxv_decompress_cocg()
Michael Niedermayer [Mon, 20 May 2019 23:33:03 +0000 (01:33 +0200)]
avcodec/dxv: Check op_offset in dxv_decompress_cocg()

Fixes: signed integer overflow: -2147483648 - 12 cannot be represented in type 'int'
Fixes: 14732/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-5735273129836544
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/diracdec: Fix integer overflow in global_mv()
Michael Niedermayer [Wed, 22 May 2019 00:01:33 +0000 (02:01 +0200)]
avcodec/diracdec: Fix integer overflow in global_mv()

Fixes: signed integer overflow: 16384 * 196607 cannot be represented in type 'int'
Fixes: 14810/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5091232683917312
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agotools/target_dec_fuzzer: Limit error concealment on pixels instead of just frames
Michael Niedermayer [Thu, 16 May 2019 22:23:54 +0000 (00:23 +0200)]
tools/target_dec_fuzzer: Limit error concealment on pixels instead of just frames

This should reduce the amount of timeout issues overall

Fixes: Timeout (34->10sec)
Fixes: 14682/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV2_fuzzer-5728608414334976
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agobitstream_filters: Correct dump_extradata description
Andreas Rheinhardt [Tue, 4 Jun 2019 13:41:05 +0000 (15:41 +0200)]
bitstream_filters: Correct dump_extradata description

The default is to dump extradata to keyframes, not all frames.
Also improve the description of the relevant AVOption.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
5 years agoavcodec/vmnc: Check available space against chunks before reget_buffer()
Michael Niedermayer [Fri, 17 May 2019 21:28:49 +0000 (23:28 +0200)]
avcodec/vmnc: Check available space against chunks before reget_buffer()

Fixes: Timeout (16sec -> 60ms)
Fixes: 14673/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMNC_fuzzer-5640217517621248
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/pafvideo: Clear frame buffer later
Michael Niedermayer [Fri, 17 May 2019 20:27:38 +0000 (22:27 +0200)]
avcodec/pafvideo: Clear frame buffer later

This way the clearing can be skipped in case of some errors.

Fixes: Timeout (11sec -> 344ms)
Fixes: 14670/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PAF_VIDEO_fuzzer-5769534503387136
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/aacdec_template: skip apply_tns() if max_sfb is 0 (from previous header decod...
Michael Niedermayer [Sat, 18 May 2019 08:37:26 +0000 (10:37 +0200)]
avcodec/aacdec_template: skip apply_tns() if max_sfb is 0 (from previous header decode failure)

Fixes: NULL pointer dereference
Fixes: 14723/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5654612436058112
Fixes: 14724/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5712607111020544
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/arbc: Skip tiles in fill_tileX() which are completely outside
Michael Niedermayer [Thu, 9 May 2019 21:49:41 +0000 (23:49 +0200)]
avcodec/arbc: Skip tiles in fill_tileX() which are completely outside

Fixes: signed integer overflow: 2052526848 + 147237888 cannot be represented in type 'int'
Fixes: 14441/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARBC_fuzzer-5717632944177152
Fixes: 14453/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARBC_fuzzer-5739679254577152
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/aacdec_fixed: Handle more extreem cases in noise_scale()
Michael Niedermayer [Thu, 16 May 2019 10:00:18 +0000 (12:00 +0200)]
avcodec/aacdec_fixed: Handle more extreem cases in noise_scale()

Its unclear if these cases have any relevance in real files

Fixes: shift exponent -2 is negative
Fixes: 14489/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5681941631729664
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/aacdec_template: Merge 3 #ifs related to noise handling
Michael Niedermayer [Thu, 16 May 2019 09:55:43 +0000 (11:55 +0200)]
avcodec/aacdec_template: Merge 3 #ifs related to noise handling

Fewer #if and fewer lines

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/aacdec_fixed: ssign seems always -1 in noise_scale(), simplify
Michael Niedermayer [Thu, 16 May 2019 09:03:59 +0000 (11:03 +0200)]
avcodec/aacdec_fixed: ssign seems always -1 in noise_scale(), simplify

5 years agoavilter/avf_showwaves: switch to activate in showwaves filter
Paul B Mahol [Thu, 30 May 2019 18:31:03 +0000 (20:31 +0200)]
avilter/avf_showwaves: switch to activate in showwaves filter

5 years agoavcodec/cbs_h264: add support for Alternative Transfer Characteristics SEI message
James Almer [Sun, 26 May 2019 18:40:35 +0000 (15:40 -0300)]
avcodec/cbs_h264: add support for Alternative Transfer Characteristics SEI message

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
5 years agovaapi_encode: Refactor encode misc parameter buffer creation
Mark Thompson [Mon, 6 May 2019 15:21:29 +0000 (16:21 +0100)]
vaapi_encode: Refactor encode misc parameter buffer creation

This removes the use of the nonstandard combined structures, which
generated some warnings with clang and will cause alignment problems
with some parameter buffer types.

5 years agovaapi_encode: Remove unused function
Mark Thompson [Mon, 3 Jun 2019 18:29:56 +0000 (19:29 +0100)]
vaapi_encode: Remove unused function

5 years agoavfilter/af_anlmdn: add support for commands
Paul B Mahol [Mon, 3 Jun 2019 12:14:37 +0000 (14:14 +0200)]
avfilter/af_anlmdn: add support for commands

5 years agolavf/sr: Refine the coding style for init
Jun Zhao [Sat, 1 Jun 2019 03:28:56 +0000 (11:28 +0800)]
lavf/sr: Refine the coding style for init

We perfer the coding style like:

/* some stuff */
if (error) {
    /* error handling */
    return -(errorcode);
}
/* normal actions */
do_something()

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
5 years agolavf/sr: Don't need to check NULL before sws_freeContext
Jun Zhao [Sat, 1 Jun 2019 03:25:46 +0000 (11:25 +0800)]
lavf/sr: Don't need to check NULL before sws_freeContext

sws_freeContext have check the NULL pointer, so don't need to check
NULL before sws_freeContext.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
5 years agolavf/sr: Dump input pixel format in error message
Jun Zhao [Sat, 1 Jun 2019 03:20:33 +0000 (11:20 +0800)]
lavf/sr: Dump input pixel format in error message

Dump input pixel format in error message, it's will help to debugging

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
5 years agolavf/qsv: use av_cold for init/uninit
Zhong Li [Fri, 31 May 2019 00:44:49 +0000 (08:44 +0800)]
lavf/qsv: use av_cold for init/uninit

Signed-off-by: Zhong Li <zhong.li@intel.com>
5 years agoavfilter/vf_unsharp: enable slice threading
Ruiling Song [Tue, 7 May 2019 01:46:33 +0000 (09:46 +0800)]
avfilter/vf_unsharp: enable slice threading

benchmarking with a simple command:
ffmpeg -i 1080p.mp4 -vf unsharp=la=3:ca=3 -an -f null /dev/null
with the patch, the fps increase from 50 to 120 on my local machine (i7-6770HQ).

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
5 years agolavfi/lut: Add slice threading support
Jun Zhao [Tue, 21 May 2019 15:39:09 +0000 (23:39 +0800)]
lavfi/lut: Add slice threading support

Used the command for 1080p h264 clip as follow:

a). ffmpeg -i input -vf lutyuv="u=128:v=128" -f null /dev/null
b). ffmpeg -i input -vf lutrgb="g=0:b=0" -f null /dev/null

after enabled the slice threading, the fps change from:

a). 144fps to 258fps (lutyuv)
b). 94fps  to 153fps (lutrgb)

in Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
5 years agolavfi/colorlevels: Add slice threading support
Jun Zhao [Tue, 21 May 2019 01:08:21 +0000 (09:08 +0800)]
lavfi/colorlevels: Add slice threading support

Add slice threading support, use the command like:

./ffmpeg -i input -vf colorlevels -f null /dev/null

with 1080p h264 clip, the fps from 39 fps to 79 fps
in the local(Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz)

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
5 years agohwcontext_qsv: Try to select a matching VAAPI device by default
Mark Thompson [Mon, 6 May 2019 14:45:44 +0000 (15:45 +0100)]
hwcontext_qsv: Try to select a matching VAAPI device by default

Tries to find a device backed by the i915 kernel driver and loads the iHD
VAAPI driver to use with it.  This reduces confusion on machines with
multiple DRM devices and removes the surprising requirement to set the
LIBVA_DRIVER_NAME environment variable to use libmfx at all.

5 years agohwcontext_vaapi: Try to create devices via DRM before X11
Mark Thompson [Mon, 6 May 2019 14:41:09 +0000 (15:41 +0100)]
hwcontext_vaapi: Try to create devices via DRM before X11

Opening the device via X11 (DRI2/DRI3) rather than opening a DRM render
node directly is only useful if you intend to use the legacy X11 interop
functions.  That's never true for the ffmpeg utility, and a library user
who does want this will likely provide their own display instance rather
than making a new one here.

5 years agohwcontext_vaapi: Add option to set driver name
Mark Thompson [Wed, 14 Nov 2018 21:25:00 +0000 (21:25 +0000)]
hwcontext_vaapi: Add option to set driver name

For example: -init_hw_device vaapi:/dev/dri/renderD128,driver=foo

This may be more convenient that using the environment variable, and allows
loading different drivers for different devices in the same process.

5 years agohwcontext_vaapi: Make default DRM device selection more helpful
Mark Thompson [Mon, 6 May 2019 14:43:04 +0000 (15:43 +0100)]
hwcontext_vaapi: Make default DRM device selection more helpful

Iterate over available render devices and pick the first one which looks
usable.  Adds an option to specify the name of the kernel driver associated
with the desired device, so that it is possible to select a specific type
of device in a multiple-device system without knowing the card numbering.

For example: -init_hw_device vaapi:,kernel_driver=amdgpu will select only
devices using the "amdgpu" driver (as used with recent AMD graphics cards).

Kernel driver selection requires libdrm to work.

5 years agohwcontext_vaapi: Add option to specify connection type
Mark Thompson [Mon, 6 May 2019 14:31:18 +0000 (15:31 +0100)]
hwcontext_vaapi: Add option to specify connection type

Can be set to "drm" or "x11" to force a specific connection type.

5 years agoffmpeg_hw: Treat empty device string as no device setting
Mark Thompson [Mon, 6 May 2019 14:30:24 +0000 (15:30 +0100)]
ffmpeg_hw: Treat empty device string as no device setting

The implementation will use some default in this case.  The empty string
is not a meaningful device for any existing hardware type, and indeed
OpenCL treats it identically to no device already to work around the lack
of this setting on the command line.

5 years agoffmpeg_hw: Mark some strings as const
Mark Thompson [Mon, 6 May 2019 14:29:01 +0000 (15:29 +0100)]
ffmpeg_hw: Mark some strings as const

5 years agovaapi_encode: Warn if input has cropping information
Mark Thompson [Sun, 31 Mar 2019 14:39:44 +0000 (15:39 +0100)]
vaapi_encode: Warn if input has cropping information

Cropping is not supported by VAAPI encode.

5 years agovf_scale_vaapi: Add options to configure output colour properties
Mark Thompson [Thu, 28 Feb 2019 00:38:09 +0000 (00:38 +0000)]
vf_scale_vaapi: Add options to configure output colour properties

The "out_color_matrix" and "out_range" properties match the same options
in vf_scale; the others attempt to follow the same pattern.

5 years agolavfi/vaapi: Improve support for colour properties
Mark Thompson [Thu, 28 Feb 2019 00:38:08 +0000 (00:38 +0000)]
lavfi/vaapi: Improve support for colour properties

Attempts to pick the set of supported colour properties best matching the
input.  Output is then set with the same values, except for the colour
matrix which may change when converting between RGB and YUV.

5 years agovf_misc_vaapi: Add missing return value checks
Mark Thompson [Sun, 31 Mar 2019 14:39:40 +0000 (15:39 +0100)]
vf_misc_vaapi: Add missing return value checks

Parameter buffer creation can fail.

5 years agolavfi/vaapi: Factorise out common code for parameter buffer setup
Mark Thompson [Sun, 31 Mar 2019 14:39:35 +0000 (15:39 +0100)]
lavfi/vaapi: Factorise out common code for parameter buffer setup

Also enables cropping on all VAAPI filters, inherited from the existing
support in scale_vaapi.

5 years agodoc/indevs: Add example using cropping to capture part of a plane
Mark Thompson [Sat, 23 Mar 2019 16:18:49 +0000 (16:18 +0000)]
doc/indevs: Add example using cropping to capture part of a plane

5 years agovf_crop: Add support for cropping hardware frames
Mark Thompson [Sat, 23 Mar 2019 16:18:48 +0000 (16:18 +0000)]
vf_crop: Add support for cropping hardware frames

Set the cropping fields in the AVFrame.

5 years agodoc/muxers: fix typo of the hls var_stream_map example
Steven Liu [Sun, 2 Jun 2019 13:53:11 +0000 (21:53 +0800)]
doc/muxers: fix typo of the hls var_stream_map example

And fix typo of the 1833 of hlsenc.c

Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro>
Signed-off-by: Steven Liu <lq@onvideo.cn>
5 years agoavfilter/af_anlmdn: avoid creating frames with zero samples
Paul B Mahol [Sun, 2 Jun 2019 11:00:35 +0000 (13:00 +0200)]
avfilter/af_anlmdn: avoid creating frames with zero samples

5 years agoavfilter/af_anlmdn: try to recover when cache becomes negative
Paul B Mahol [Sun, 2 Jun 2019 10:58:07 +0000 (12:58 +0200)]
avfilter/af_anlmdn: try to recover when cache becomes negative

5 years agoavfilter/af_anlmdn: add smooth factor option
Paul B Mahol [Sun, 2 Jun 2019 09:58:49 +0000 (11:58 +0200)]
avfilter/af_anlmdn: add smooth factor option

5 years agoavfilter/vf_xmedian: remove limitation of only odd number of inputs
Paul B Mahol [Sun, 2 Jun 2019 09:03:08 +0000 (11:03 +0200)]
avfilter/vf_xmedian: remove limitation of only odd number of inputs

5 years agodoc/filters: move reference to framesync options from lut3d to haldclut
Marton Balint [Fri, 31 May 2019 21:05:52 +0000 (23:05 +0200)]
doc/filters: move reference to framesync options from lut3d to haldclut

Signed-off-by: Marton Balint <cus@passwd.hu>
5 years agoavutil/dynarry.h: fix comment grammar mistakes of FF_DYNARRAY_ADD
Steven Liu [Thu, 30 May 2019 14:27:28 +0000 (22:27 +0800)]
avutil/dynarry.h: fix comment grammar mistakes of FF_DYNARRAY_ADD

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
5 years agoavcodec/gdv: Check remaining output after decode 5/6/8/
Michael Niedermayer [Tue, 28 May 2019 23:12:39 +0000 (01:12 +0200)]
avcodec/gdv: Check remaining output after decode 5/6/8/

Improves: Timeout (355sec -> 97sec)
Improves: 14709/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5704215281795072

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
5 years agotools: Add fuzzer for demuxers
Michael Niedermayer [Mon, 27 May 2019 19:50:08 +0000 (21:50 +0200)]
tools: Add fuzzer for demuxers

This is based on target_dec_fuzzer

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agolavfi/showspatial: Remove two write-only variables.
Carl Eugen Hoyos [Fri, 31 May 2019 20:30:46 +0000 (22:30 +0200)]
lavfi/showspatial: Remove two write-only variables.

Fixes two warnings:
libavfilter/avf_showspatial.c:157:26: warning: variable â€˜w’ set but not used
libavfilter/avf_showspatial.c:157:23: warning: variable â€˜h’ set but not used

5 years agoavfilter: add showspatial multimedia filter
Paul B Mahol [Tue, 30 Apr 2019 14:44:28 +0000 (16:44 +0200)]
avfilter: add showspatial multimedia filter

5 years agoavcodec/tiff: Recognize DNG/CinemaDNG images
Nick Renieris [Thu, 30 May 2019 10:42:42 +0000 (13:42 +0300)]
avcodec/tiff: Recognize DNG/CinemaDNG images

Additionally:
- Renamed TIFF_WHITE_LEVEL to DNG_WHITE_LEVEL since it is specified
  in the DNG spec.
- Added/changed some comments to be more precise in differentiating
  between TIFF, TIFF/EP and DNG values.

Related to ticket: https://trac.ffmpeg.org/ticket/4364

Signed-off-by: Nick Renieris <velocityra@gmail.com>
5 years agolibavcodec/tiff: Process SubIFDs tag with multiple entries
Nick Renieris [Thu, 30 May 2019 10:42:41 +0000 (13:42 +0300)]
libavcodec/tiff: Process SubIFDs tag with multiple entries

SubIFDs that were part of more than single-sized "SubIFDs" tags were
being ignored due to existing code ignoring that case.

This patch makes is so the first entry is read, which is not ideal
but enough for some DNG images present in the wild to be decodeable
More specifically, the first SubIFD which we would process with this
patch is the main image and the second one is a second thumbnail,
which is not as important to decode.

In DNG images with the .tiff extension, it solves the issue where
the TIFF thumbnail in IFD 0 was incorrectly parsed (related
confusion: [1]).

Embedded thumbnails for DNG images can still be decoded with the
"-thumbnail" option.

Related to ticket: https://trac.ffmpeg.org/ticket/4364

[1]: https://superuser.com/questions/546879/creating-video-from-dng-images-with-ffmpeg

Signed-off-by: Nick Renieris <velocityra@gmail.com>
5 years agoavcodec/tiff: Option to decode embedded thumbnail
Nick Renieris [Thu, 30 May 2019 10:42:40 +0000 (13:42 +0300)]
avcodec/tiff: Option to decode embedded thumbnail

Adds the "-thumbnail" option, that works like the current "-subifd"
option, but only for non-full-sized images.

This is particularly useful for DNG images (see next commit) that
have SubIFDs that are not necessarily thumbnails.

Signed-off-by: Nick Renieris <velocityra@gmail.com>
5 years agolavf/qsvvpp: avoid the double-free when working in sys memory mode
Linjie Fu [Mon, 15 Apr 2019 13:24:06 +0000 (21:24 +0800)]
lavf/qsvvpp: avoid the double-free when working in sys memory mode

Currently, picref will be freed by calling av_frame_free(&picref) in
submit_frame() in qsvvpp.c when working in system memory mode,and normally it
is freed in filter_frame() in vf_vpp_qsv.c when working in other modes.

Double free happens when working in system memory mode, remove to
fix the memory issue.

Reproduce:
ffmpeg -init_hw_device qsv=foo -filter_hw_device foo -f rawvideo -pix_fmt nv12 -s:v 852x480 \
-i 852x480.nv12 -vf 'vpp_qsv=w=500:h=400' -f rawvideo -pix_fmt nv12 qsv.nv12

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
5 years agoavformat/gif: abort early if nothing was written yet
Paul B Mahol [Wed, 29 May 2019 08:57:18 +0000 (10:57 +0200)]
avformat/gif: abort early if nothing was written yet

Fixes crash when writting trailer without any previous packets.

5 years agoavcodec/cbs_mpeg2: fix leak of extra_information_slice buffer in cbs_mpeg2_read_slice...
James Almer [Wed, 22 May 2019 01:04:38 +0000 (03:04 +0200)]
avcodec/cbs_mpeg2: fix leak of extra_information_slice buffer in cbs_mpeg2_read_slice_header()

cbs_mpeg2_free_slice() calls av_buffer_unref() on extra_information_ref,
meaning allocating with av_malloc() was not the intention.

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agocbs_mpeg2: Correct error codes
Andreas Rheinhardt [Wed, 22 May 2019 01:04:35 +0000 (03:04 +0200)]
cbs_mpeg2: Correct error codes

Up until now, things that are merely unsupported by cbs_mpeg2 have been
declared to be invalid input. This has been changed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
5 years agocbs_mpeg2: Fix storage type for frame_centre_*_offset
Andreas Rheinhardt [Wed, 22 May 2019 01:04:34 +0000 (03:04 +0200)]
cbs_mpeg2: Fix storage type for frame_centre_*_offset

The frame_centre_horizontal/vertical_offset values contained in picture
display extensions are actually signed values (i.e. it is possible to
indicate that the display device should add black bars/pillars).

The files sony-ct3.bs and tcela-6.bits (which are both used in fate
tests for mpeg2_metadata) contain picture display extensions; the former
even contains a negative frame_centre_vertical_offset. Fortunately, the
old code did not damage the picture display extensions when one did a
cycle of reading and writing. For the same reason the fate tests needn't
be updated either.

Furthermore these fields now use the trace output for matrices.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
5 years agocbs_mpeg2: Improve checks for invalid values
Andreas Rheinhardt [Wed, 22 May 2019 01:04:32 +0000 (03:04 +0200)]
cbs_mpeg2: Improve checks for invalid values

MPEG-2 contains several elements that mustn't be zero according to the
specifications: horizontal/vertical_size_value, aspect_ratio_information,
frame_rate_code, the quantiser matrices, the colour_description
elements, picture_coding_type, the f_code[r][s] values and
quantiser_scale_code. It is now checked that the invalid values don't
occur.

The colour_description elements are treated specially in this regard:
Given that there are files in the wild which use illegal values for the
colour_description elements (some of them created by mpeg2_metadata),
they will be corrected to the value meaning "unknown" (namely 2) during
reading. This has been done in such a way that trace_headers will
nevertheless report the original value, together with a message about
the fixup.

Furthermore, the trace_headers output of user_data has been beautified.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
5 years agocbs_mpeg2: Correct and use enum values
Andreas Rheinhardt [Wed, 22 May 2019 01:04:31 +0000 (03:04 +0200)]
cbs_mpeg2: Correct and use enum values

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
5 years agoavfilter/avf_aphasemeter: make use of av_rescale
Paul B Mahol [Tue, 28 May 2019 09:10:51 +0000 (11:10 +0200)]
avfilter/avf_aphasemeter: make use of av_rescale