]> git.sesse.net Git - ffmpeg/log
ffmpeg
5 years agotests/checkasm/checkasm: Do not define an unused function.
Carl Eugen Hoyos [Thu, 31 Jan 2019 19:16:17 +0000 (20:16 +0100)]
tests/checkasm/checkasm: Do not define an unused function.

Fixes the following warning:
tests/checkasm/checkasm.c:615:12: warning: 'bench_init_ffmpeg' defined but not used

5 years agoavformat/rtsp: Check number of streams in sdp_parse_line()
Michael Niedermayer [Fri, 25 Jan 2019 20:30:04 +0000 (21:30 +0100)]
avformat/rtsp: Check number of streams in sdp_parse_line()

Fixes: OOM
Found-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Michael Hanselmann <public@hansmi.ch>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/ffv1: Simplify update_vlc_state()
Michael Niedermayer [Sat, 26 Jan 2019 23:56:59 +0000 (00:56 +0100)]
avcodec/ffv1: Simplify update_vlc_state()

About 0.5% faster

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/ffv1: Simplify fold()
Michael Niedermayer [Sat, 26 Jan 2019 23:49:14 +0000 (00:49 +0100)]
avcodec/ffv1: Simplify fold()

No speed difference, or slightly faster (the difference is too small so it may be noise
that this appears faster)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agolibavcodec/rscc.c: add missing semicolon
Mateusz [Thu, 31 Jan 2019 15:36:59 +0000 (16:36 +0100)]
libavcodec/rscc.c: add missing semicolon

Signed-off-by: Mateusz Brzostek <mateuszb@poczta.onet.pl>
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/hlsenc: add var_stream_map LANGUAGE field string parameter
Steven Liu [Wed, 23 Jan 2019 11:19:49 +0000 (19:19 +0800)]
avformat/hlsenc: add var_stream_map LANGUAGE field string parameter

use a:0,agroup:aud_low,default:Yes,language:CHN a:1,agroup:aud_low,language:ENG
        a:2,agroup:aud_high,default:YesYes,language:CHN a:3,agroup:aud_high,language:ENG
        v:0,agroup:aud_low v:1,agroup:aud_high
        create master m3u8 list.

result:
EXTM3U
EXT-X-VERSION:3
EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_aud_low",NAME="audio_0",DEFAULT=YES,LANGUAGE="CHN",URI="out_0.m3u8"
EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_aud_low",NAME="audio_1",DEFAULT=NO,LANGUAGE="ENG",URI="out_1.m3u8"
EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_aud_high",NAME="audio_2",DEFAULT=YES,LANGUAGE="CHN",URI="out_2.m3u8"
EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_aud_high",NAME="audio_3",DEFAULT=NO,LANGUAGE="ENG",URI="out_3.m3u8"
EXT-X-STREAM-INF:BANDWIDTH=1170400,RESOLUTION=640x480,CODECS="avc1.64001e,mp4a.40.2",AUDIO="group_aud_low"
out_4.m3u8
EXT-X-STREAM-INF:BANDWIDTH=3440800,RESOLUTION=640x480,CODECS="avc1.64001e,mp4a.40.2",AUDIO="group_aud_high"
out_5.m3u8

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
5 years agoavformat/hlsenc: add var_stream_map DEFAULT field status parameter
Steven Liu [Wed, 23 Jan 2019 10:52:02 +0000 (18:52 +0800)]
avformat/hlsenc: add var_stream_map DEFAULT field status parameter

use a:0,agroup:aud_low,default:Yes a:1,agroup:aud_low,
    a:2,agroup:aud_high,default:Yes a:3, agroup:aud_high,
    v:0,agroup:aud_low v:1,agroup:aud_high
    create master m3u8 list.

result:
EXTM3U
EXT-X-VERSION:3
EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_aud_low",NAME="audio_0",DEFAULT=YES,URI="out_0.m3u8"
EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_aud_low",NAME="audio_1",DEFAULT=NO,URI="out_1.m3u8"
EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_aud_high",NAME="audio_2",DEFAULT=YES,URI="out_2.m3u8"
EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_aud_high",NAME="audio_3",DEFAULT=NO,URI="out_3.m3u8"
EXT-X-STREAM-INF:BANDWIDTH=1170400,RESOLUTION=640x480,CODECS="avc1.64001e,mp4a.40.2",AUDIO="group_aud_low"
out_4.m3u8
EXT-X-STREAM-INF:BANDWIDTH=3440800,RESOLUTION=640x480,CODECS="avc1.64001e,mp4a.40.2",AUDIO="group_aud_high"
out_5.m3u8

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
5 years agoavformat/hlsenc: make the EXT-X-MEDIA NAME field by stream id.
Steven Liu [Mon, 21 Jan 2019 08:32:57 +0000 (16:32 +0800)]
avformat/hlsenc: make the EXT-X-MEDIA NAME field by stream id.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
5 years agoavformat/rtsp: Clear reply in every iteration in ff_rtsp_connect()
Michael Niedermayer [Sun, 27 Jan 2019 23:53:22 +0000 (00:53 +0100)]
avformat/rtsp: Clear reply in every iteration in ff_rtsp_connect()

Fixes: Infinite loop
Found-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Michael Hanselmann <public@hansmi.ch>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/rasc: Move ff_get_buffer() after frame checks
Michael Niedermayer [Tue, 22 Jan 2019 23:19:14 +0000 (00:19 +0100)]
avcodec/rasc: Move ff_get_buffer() after frame checks

If the frame1/2 checks fail this avoids doing the allocation of a new frame

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/rasc: Check uncompressed dlta size
Michael Niedermayer [Tue, 22 Jan 2019 23:16:02 +0000 (00:16 +0100)]
avcodec/rasc: Check uncompressed dlta size

We assume that if the compressed size is bigger than if each byte is encoded in a single raw packet
that the data is invalid.

Fixes: Out of memory
Fixes: 12208/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-5648916473708544
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/fic: Check that there is input left in fic_decode_block()
Michael Niedermayer [Tue, 22 Jan 2019 23:30:53 +0000 (00:30 +0100)]
avcodec/fic: Check that there is input left in fic_decode_block()

Fixes: Timeout
Fixes: 12450/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FIC_fuzzer-5661984622641152
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 agoavformat/flvdec: Try to support some concatenated flv files
Michael Niedermayer [Thu, 3 Jan 2019 00:08:31 +0000 (01:08 +0100)]
avformat/flvdec: Try to support some concatenated flv files

Fixes: discont.flv
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agolavf/asf: Remove an unneeded forward declaration.
Carl Eugen Hoyos [Wed, 30 Jan 2019 22:15:28 +0000 (23:15 +0100)]
lavf/asf: Remove an unneeded forward declaration.

5 years agolibavdevice/gdigrab: fix HIDPI support for mouse positioning
Dilshod Mukhtarov [Sun, 27 Jan 2019 19:10:37 +0000 (23:10 +0400)]
libavdevice/gdigrab: fix HIDPI support for mouse positioning

Mouse position was not calculated properly in area or window mode

Signed-off-by: Dilshod Mukhtarov <dilshodm@gmail.com>
5 years agolibavdevice/gdigrab: fix HIDPI support for window capture
Dilshod Mukhtarov [Sun, 27 Jan 2019 19:09:53 +0000 (23:09 +0400)]
libavdevice/gdigrab: fix HIDPI support for window capture

In Windows if using scaling other than 100% then the grabbed window was not captured fully (cropped)

Signed-off-by: Dilshod Mukhtarov <dilshodm@gmail.com>
5 years agoavformat/tee : Pass standards compliance value to slave muxers as well
Karthick J [Wed, 30 Jan 2019 13:30:59 +0000 (19:00 +0530)]
avformat/tee : Pass standards compliance value to slave muxers as well

5 years agoavformat/http: clarify that ffmpeg will attempt to add missing CRLF
Gyan Doshi [Mon, 28 Jan 2019 06:50:02 +0000 (12:20 +0530)]
avformat/http: clarify that ffmpeg will attempt to add missing CRLF

5 years agoavcodec/arbc: clear decoder state when seeking
James Almer [Mon, 28 Jan 2019 16:16:32 +0000 (13:16 -0300)]
avcodec/arbc: clear decoder state when seeking

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoavcodec/motion_est: remove duplicate function
Marton Balint [Sun, 6 Jan 2019 13:26:11 +0000 (14:26 +0100)]
avcodec/motion_est: remove duplicate function

Signed-off-by: Marton Balint <cus@passwd.hu>
5 years agoavformat/dashenc: Skip writing trailer for MP4 output when in streaming mode
Karthick J [Tue, 22 Jan 2019 05:55:21 +0000 (11:25 +0530)]
avformat/dashenc: Skip writing trailer for MP4 output when in streaming mode

In streaming mode mp4 trailer is not required for playout.

5 years agoavcodec/rscc: Avoid returning frames that have nearly no undamaged pixels in them
Michael Niedermayer [Fri, 18 Jan 2019 23:00:49 +0000 (00:00 +0100)]
avcodec/rscc: Avoid returning frames that have nearly no undamaged pixels in them

Fixes: Timeout
Fixes: 12192/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-6279038004363264
Before: clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-6279038004363264 in 15423 ms
After:  clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-6279038004363264 in 190 ms

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: Add discard_sample_percentage
Michael Niedermayer [Fri, 18 Jan 2019 23:00:48 +0000 (00:00 +0100)]
avcodec: Add discard_sample_percentage

Suggested-by: BBB
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agotools/target_dec_fate.list: add entries upto 1214
Michael Niedermayer [Sat, 19 Jan 2019 00:21:28 +0000 (01:21 +0100)]
tools/target_dec_fate.list: add entries upto 1214

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/huffyuvdec: Check slice_offset/size
Michael Niedermayer [Sun, 20 Jan 2019 23:39:43 +0000 (00:39 +0100)]
avcodec/huffyuvdec: Check slice_offset/size

Fixes: out of array access
Fixes: 12447/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5201623956062208
Fixes: 12458/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5705567736168448
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/ilbcdec: Fix undefined integer overflow lsf2poly()
Michael Niedermayer [Mon, 14 Jan 2019 23:09:30 +0000 (00:09 +0100)]
avcodec/ilbcdec: Fix undefined integer overflow lsf2poly()

The addition is moved up into the context where the variable is unsigned avoiding
the undefined behavior

Fixes: runtime error: signed integer overflow: 2147481972 + 4096 cannot be represented in type 'int'
Fixes: 12444/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ILBC_fuzzer-5755706244857856
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/ilbcdec: Fix integer overflow in construct_vector()
Michael Niedermayer [Mon, 14 Jan 2019 23:02:25 +0000 (00:02 +0100)]
avcodec/ilbcdec: Fix integer overflow in construct_vector()

webrtc contains explicit code to ignore the undefined behavior (RTC_NO_SANITIZE / OverflowingAddS32S32ToS32())

Probably fixes: Integer overflow (unreproducable here)
Probably fixes: 12215/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ILBC_fuzzer-5767142427852800

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 agoMAINTAINERS: add AVS2 section
hwren [Sat, 28 Jul 2018 03:20:48 +0000 (11:20 +0800)]
MAINTAINERS: add AVS2 section

Signed-off-by: hwren <hwrenx@126.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agovaapi_encode_h265: Ensure that ref pics are always in the RPS
Mark Thompson [Fri, 25 Jan 2019 19:54:27 +0000 (19:54 +0000)]
vaapi_encode_h265: Ensure that ref pics are always in the RPS

When making a new P-frame when B-frames are present the previous P-frame
is normally in the DPB because it will be referred to by subsequent
B-frames.  However, this is not true if there are no B-frames, or in edge
cases where a GOP ends with two P-frames.  Fix this by adding the direct
ref pics to the RPS explicitly.

Fixes #7699.

Tested-by: Ullysses A Eoff <ullysses.a.eoff@intel.com>
5 years agolavf/subviewerdec: Skip leading BOM.
Carl Eugen Hoyos [Wed, 23 Jan 2019 23:22:47 +0000 (00:22 +0100)]
lavf/subviewerdec: Skip leading BOM.

Fixes ticket #7661.

5 years agoavfilter/buffersrc: print relevant info when skipping filter reinit
Gyan Doshi [Fri, 25 Jan 2019 12:26:11 +0000 (17:56 +0530)]
avfilter/buffersrc: print relevant info when skipping filter reinit

The timestamp of the changed input frame as well as its relevant
properties can be examined by the user. Only applicable when
reinit_filter is disabled on the input stream.

5 years agolavf/cafdec: Do not fail for unknown atoms with negative size.
Carl Eugen Hoyos [Mon, 14 Jan 2019 23:22:50 +0000 (00:22 +0100)]
lavf/cafdec: Do not fail for unknown atoms with negative size.

The specification requires the demuxer to only read the data
atom up to its given size, this is necessary as atoms are
allowed at the end of the file.
This patch duplicates the behaviour of the QuickTime player.

5 years agoavcodec: add ARBC decoder
Paul B Mahol [Sun, 20 Jan 2019 10:18:38 +0000 (11:18 +0100)]
avcodec: add ARBC decoder

Thanks Kostya for great help in reversing binary.

5 years agoavcodec/vp6: select idct based (loosely) on number of coefficients decoded
Peter Ross [Sun, 13 Jan 2019 04:45:07 +0000 (15:45 +1100)]
avcodec/vp6: select idct based (loosely) on number of coefficients decoded

The VP3/4/5/6 reference decoders all use three IDCT versions: one for the
DC-only case, another for blocks with more than 10 coefficients, and an
optimised one for blocks with up to 10 AC coefficents. VP6 relies on the
sparse 10 coefficient version, and without it, IDCT drift occurs.

Fixes: https://trac.ffmpeg.org/ticket/1282
Signed-off-by: Peter Ross <pross@xvid.org>
5 years agoavcodec/vp6: use ff_vp3dsp_[hv]_loop_filter_12
Peter Ross [Sun, 13 Jan 2019 04:15:29 +0000 (15:15 +1100)]
avcodec/vp6: use ff_vp3dsp_[hv]_loop_filter_12

Partially fixes: https://trac.ffmpeg.org/ticket/1282

Signed-off-by: Peter Ross <pross@xvid.org>
5 years agoavcodec/vp6: use rounded shift for chroma motion vector calculation
Peter Ross [Thu, 10 Jan 2019 09:55:06 +0000 (20:55 +1100)]
avcodec/vp6: use rounded shift for chroma motion vector calculation

Partially fixes: https://trac.ffmpeg.org/ticket/1282

Signed-off-by: Peter Ross <pross@xvid.org>
5 years agoavcodec/vp3dsp: add 10 coefficient version of the VP3 IDCT
Peter Ross [Sun, 13 Jan 2019 07:37:28 +0000 (18:37 +1100)]
avcodec/vp3dsp: add 10 coefficient version of the VP3 IDCT

This version of the IDCT is used by the VP6 decoder.

Signed-off-by: Peter Ross <pross@xvid.org>
5 years agoavcodec/vp3dsp: add 12 pixel loop filter functions
Peter Ross [Sun, 6 Jan 2019 01:45:40 +0000 (12:45 +1100)]
avcodec/vp3dsp: add 12 pixel loop filter functions

Signed-off-by: Peter Ross <pross@xvid.org>
5 years agoavcodec/vp3dsp: move vp3 init loop filter function to vp3dsp
Peter Ross [Sun, 13 Jan 2019 03:55:53 +0000 (14:55 +1100)]
avcodec/vp3dsp: move vp3 init loop filter function to vp3dsp

This is also used by the VP6 decoder.

Signed-off-by: Peter Ross <pross@xvid.org>
5 years agolavf/vaapi_deinterlace: return error if mode unsupported
Zhong Li [Mon, 14 Jan 2019 07:29:54 +0000 (15:29 +0800)]
lavf/vaapi_deinterlace: return error if mode unsupported

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Fuwei Tang <fuweix.tang@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
5 years agolavc/qsvenc: enable QVBR mode
Zhong Li [Wed, 23 Jan 2019 11:16:17 +0000 (19:16 +0800)]
lavc/qsvenc: enable QVBR mode

QVBR mode is to use the variable bitrate control algorithm
with constant quality.
mfxExtCodingOption3 should be supported to enable QVBR mode.

It is neccesary to specify a max_rate for QVBR, else it may be ICQ mode.
Example usage: ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -c:v
h264_qsv -global_quality 25 -maxrate 2M test_qvbr.mp4 -v verbose

Clip QVBR quality range to be [0, 51] as Mark's commments.
It is similar to qp range of CQP but possibly should be updated when VP8/VP9
encoding can be supported.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Zhong Li <zhong.li@intel.com>
5 years agoavfilter/afade+acrossfade: allow skipping fade on inputs
Gyan Doshi [Wed, 23 Jan 2019 08:05:23 +0000 (13:35 +0530)]
avfilter/afade+acrossfade: allow skipping fade on inputs

New fade curve value 'nofade' passes audio samples as-is.
Primarily useful in carrying out acrossfade without fades.

5 years agoavcodec/libx265: add support for ROI-based encoding
Guo, Yejun [Wed, 23 Jan 2019 16:11:05 +0000 (00:11 +0800)]
avcodec/libx265: add support for ROI-based encoding

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
5 years agolavf/supenc: Remove some unneeded casts.
Carl Eugen Hoyos [Thu, 24 Jan 2019 12:08:27 +0000 (13:08 +0100)]
lavf/supenc: Remove some unneeded casts.

5 years agolavf/movenc: Mention video_track_timescale as option to fix the timescale.
Carl Eugen Hoyos [Thu, 24 Jan 2019 11:52:50 +0000 (12:52 +0100)]
lavf/movenc: Mention video_track_timescale as option to fix the timescale.

Smarter improvements for this error message were suggested in the past
but this is certainly an improvement.

5 years agolibavfilter: add transpose_vaapi filter
Zachary Zhou [Thu, 17 Jan 2019 03:33:05 +0000 (11:33 +0800)]
libavfilter: add transpose_vaapi filter

Swap width and height when do clock/cclock rotation
Add reversal/hflip/vflip options

ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128
-hwaccel_output_format vaapi -i input.264 -vf "transpose_vaapi=clock_flip"
-c:v h264_vaapi output.h264

Signed-off-by: Zachary Zhou <zachary.zhou@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
5 years agovaapi_encode_vp9: Support more complex reference structures
Mark Thompson [Thu, 20 Dec 2018 20:40:00 +0000 (20:40 +0000)]
vaapi_encode_vp9: Support more complex reference structures

5 years agovaapi_encode_h265: Support more complex reference structures
Mark Thompson [Thu, 20 Dec 2018 20:39:59 +0000 (20:39 +0000)]
vaapi_encode_h265: Support more complex reference structures

The reference picture sets are now constructed directly from the DPB
information.

5 years agovaapi_encode_h264: Support more complex reference structures
Mark Thompson [Thu, 20 Dec 2018 20:39:58 +0000 (20:39 +0000)]
vaapi_encode_h264: Support more complex reference structures

5 years agovaapi_encode: Let the reconstructed frame pool be sized dynamically
Mark Thompson [Thu, 20 Dec 2018 20:39:57 +0000 (20:39 +0000)]
vaapi_encode: Let the reconstructed frame pool be sized dynamically

No supported encode driver requires the pool to be fixed-size, so just
remove this constraint.

5 years agovaapi_encode: Convert to send/receive API
Mark Thompson [Thu, 20 Dec 2018 20:39:56 +0000 (20:39 +0000)]
vaapi_encode: Convert to send/receive API

This attaches the logic of picking the mode of for the next picture to
the output, which simplifies some choices by removing the concept of
the picture for which input is not yet available.  At the same time,
we allow more complex reference structures and track more reference
metadata (particularly the contents of the DPB) for use in the
codec-specific code.

It also adds flags to explicitly track the available features of the
different codecs.  The new structure also allows open-GOP support, so
that is now available for codecs which can do it.

5 years agovaapi_encode: Allocate picture-private data in generic code
Mark Thompson [Thu, 20 Dec 2018 20:39:55 +0000 (20:39 +0000)]
vaapi_encode: Allocate picture-private data in generic code

5 years agocbs_h2645: Avoid memcpy when splitting fragment #2
Andreas Rheinhardt [Wed, 28 Nov 2018 00:24:10 +0000 (01:24 +0100)]
cbs_h2645: Avoid memcpy when splitting fragment #2

Now memcpy can be avoided for NAL units containing escapes, too.

Particularly improves performance for files with hardcoded black bars.
For such a file, time spent in cbs_h2645_split_fragment went down from
369410 decicycles to 327677 decicycles. (It were 379114 decicycles when
every NAL unit was copied.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
5 years agoh2645_parse: Make ff_h2645_packet_split reference-compatible
Andreas Rheinhardt [Wed, 28 Nov 2018 00:24:09 +0000 (01:24 +0100)]
h2645_parse: Make ff_h2645_packet_split reference-compatible

This is in preparation for a patch for cbs_h2645. Now the packet's
rbsp_buffer can be owned by an AVBuffer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
5 years agolavc/g723_1enc: Set the default bitrate to 6300.
Carl Eugen Hoyos [Tue, 22 Jan 2019 11:22:23 +0000 (12:22 +0100)]
lavc/g723_1enc: Set the default bitrate to 6300.

5 years agolavf/hlsproto: Replace a wrong eol comma with a semicolon.
caohui [Wed, 23 Jan 2019 03:13:27 +0000 (11:13 +0800)]
lavf/hlsproto: Replace a wrong eol comma with a semicolon.

5 years agoavformat/img2enc: mention -frames:v in error message
Lou Logan [Tue, 15 Jan 2019 00:14:48 +0000 (15:14 -0900)]
avformat/img2enc: mention -frames:v in error message

Signed-off-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Kieran O Leary <kieran.o.leary@gmail.com>
5 years agoavformat/concatdec: always re-calculate start time and duration
Marton Balint [Wed, 21 Nov 2018 23:59:45 +0000 (00:59 +0100)]
avformat/concatdec: always re-calculate start time and duration

This allows the underlying files to change their duration on subsequent
avformat context opens.

An example use case where this matters:

ffconcat version 1.0
file dummy.mxf
file dummy.mxf

ffmpeg -re -stream_loop -1 -i dummy.ffconcat -f sdl2 none

The user can seamlessly change the input by atomically replacing dummy.mxf.

v2: Set ConcatFile duration in read_header for all segments with known
durations because from now on we always recalculate the start time in
open_file, and an instant seek could have caused unset ConcatFile durations.

Signed-off-by: Marton Balint <cus@passwd.hu>
5 years agoavformat/concatdec: fix cur_dts based duration calculation with nonzero stream start_time
Marton Balint [Wed, 21 Nov 2018 23:59:04 +0000 (00:59 +0100)]
avformat/concatdec: fix cur_dts based duration calculation with nonzero stream start_time

Signed-off-by: Marton Balint <cus@passwd.hu>
5 years agoavformat/concatdec: factorize the duration calculating function
Marton Balint [Wed, 21 Nov 2018 23:57:01 +0000 (00:57 +0100)]
avformat/concatdec: factorize the duration calculating function

Signed-off-by: Marton Balint <cus@passwd.hu>
5 years agolavc/qsvenc: set BRCParamMultiplier to aviod BRC overflow
Zhong Li [Mon, 14 Jan 2019 07:12:15 +0000 (15:12 +0800)]
lavc/qsvenc: set BRCParamMultiplier to aviod BRC overflow

Fix ticket #7663

Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
5 years agoavcodec/mips: [loongson] optimize put_hevc_qpel_bi_hv_8 with mmi.
Shiyou Yin [Mon, 21 Jan 2019 10:10:25 +0000 (18:10 +0800)]
avcodec/mips: [loongson] optimize put_hevc_qpel_bi_hv_8 with mmi.

Optimize put_hevc_qpel_bi_hv_8 with mmi in the case width=4/8/12/16/24/32/48/64.
This optimization improved HEVC decoding performance 11.4%(2.01x to 2.24x, tested on loongson 3A3000).

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/mips: [loongson] optimize put_hevc_qpel_hv_8 with mmi.
Shiyou Yin [Mon, 21 Jan 2019 10:10:24 +0000 (18:10 +0800)]
avcodec/mips: [loongson] optimize put_hevc_qpel_hv_8 with mmi.

Optimize put_hevc_qpel_hv_8 with mmi in the case width=4/8/12/16/24/32/48/64.
This optimization improved HEVC decoding performance 11%(1.81x to 2.01x, tested on loongson 3A3000).

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/tests: Add codec_desc to .gitignore
FeRD (Frank Dana) [Mon, 21 Jan 2019 18:21:51 +0000 (13:21 -0500)]
avcodec/tests: Add codec_desc to .gitignore

The compiled libavcodec/tests/codec_desc was left out of that dir's
.gitignore when the test was added, so it shows up in 'git status'
as an untracked file if it's been built.

Signed-off-by: FeRD (Frank Dana) <ferdnyc@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/dashenc: Added documentation for $ext$ identifier in filenames
Karthick J [Thu, 17 Jan 2019 09:36:56 +0000 (15:06 +0530)]
avformat/dashenc: Added documentation for $ext$ identifier in filenames

5 years agoavformat/dashenc: Format xs:datetime in millisecond precision
Karthick J [Thu, 17 Jan 2019 08:58:20 +0000 (14:28 +0530)]
avformat/dashenc: Format xs:datetime in millisecond precision

For low latency streaming even milliseconds matter!

5 years agoavcodec/prosumer: Error out if decompress() stops reading data
Michael Niedermayer [Sat, 12 Jan 2019 21:36:00 +0000 (22:36 +0100)]
avcodec/prosumer: Error out if decompress() stops reading data

if 0 is encountered in the LUT then decompress() will continue to output 0 bytes but never read more data.
Without a specification it is impossible to say if this is invalid or a feature.
None of the valid prosumer files tested cause a 0 to be read, so it is likely
not a intended feature.

Fixes: Timeout
Fixes: 11266/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PROSUMER_fuzzer-5681827423977472
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/prosumer: Reduce lut size
Michael Niedermayer [Sat, 12 Jan 2019 21:29:27 +0000 (22:29 +0100)]
avcodec/prosumer: Reduce lut size

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/prosumer: Simplify code slightly in decompress()
Michael Niedermayer [Sat, 12 Jan 2019 20:56:14 +0000 (21:56 +0100)]
avcodec/prosumer: Simplify code slightly in decompress()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/tiff: Check for 12bit gray fax
Michael Niedermayer [Sat, 12 Jan 2019 18:37:18 +0000 (19:37 +0100)]
avcodec/tiff: Check for 12bit gray fax

Fixes: Assertion failure
Fixes: 11898/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5759794191794176
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 agoavutil/imgutils: Optimize memset_bytes() by using av_memcpy_backptr()
Michael Niedermayer [Tue, 25 Dec 2018 22:15:20 +0000 (23:15 +0100)]
avutil/imgutils: Optimize memset_bytes() by using av_memcpy_backptr()

This is strongly based on code by Marton Balint, and depends on the previous commit

Fixes: Timeout
Fixes: 11502/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920
Before: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920 in 11209 ms
After:  Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920 in  4104 ms

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavutil/mem: Optimize fill32() by unrolling and using 64bit
Michael Niedermayer [Thu, 17 Jan 2019 21:35:10 +0000 (22:35 +0100)]
avutil/mem: Optimize fill32() by unrolling and using 64bit

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/mips: [loongson] optimize put_hevc_pel_bi_pixels_8 with mmi.
Shiyou Yin [Fri, 18 Jan 2019 06:42:20 +0000 (14:42 +0800)]
avcodec/mips: [loongson] optimize put_hevc_pel_bi_pixels_8 with mmi.

Optimize put_hevc_pel_bi_pixels_8 with mmi in the case width=8/16/24/32/48/64.
This optimization improved HEVC decoding performance 2%(1.77x to 1.81x, tested on loongson 3A3000).

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agolavc/hls: Cosmetics: Fix indentation for free_segment_list
Jun Zhao [Mon, 14 Jan 2019 15:42:09 +0000 (23:42 +0800)]
lavc/hls: Cosmetics: Fix indentation for free_segment_list

Commit 673d8cfd518 missed the indent

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
5 years agolavu/frame: Fix typo.
Carl Eugen Hoyos [Fri, 18 Jan 2019 11:34:19 +0000 (12:34 +0100)]
lavu/frame: Fix typo.

5 years agoavcodec/libx264: add support for ROI-based encoding
Guo, Yejun [Thu, 10 Jan 2019 08:54:30 +0000 (16:54 +0800)]
avcodec/libx264: add support for ROI-based encoding

This patch just enables the path from ffmpeg to libx264,
the more encoders can be added later.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
5 years agoavutil: add ROI (Region Of Interest) data struct and bump version
Guo, Yejun [Thu, 10 Jan 2019 08:53:30 +0000 (16:53 +0800)]
avutil: add ROI (Region Of Interest) data struct and bump version

The encoders such as libx264 support different QPs offset for different MBs,
it makes possible for ROI-based encoding. It makes sense to add support
within ffmpeg to generate/accept ROI infos and pass into encoders.

Typical usage: After AVFrame is decoded, a ffmpeg filter or user's code
generates ROI info for that frame, and the encoder finally does the
ROI-based encoding.

The ROI info is maintained as side data of AVFrame.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
5 years agoavfilter/vf_paletteuse: don't constantly free and realloc internal frames
James Almer [Tue, 15 Jan 2019 04:14:34 +0000 (01:14 -0300)]
avfilter/vf_paletteuse: don't constantly free and realloc internal frames

Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoavfilter/extractplanes: add support for 12-bit YUVA formats
Gyan Doshi [Thu, 17 Jan 2019 09:31:11 +0000 (15:01 +0530)]
avfilter/extractplanes: add support for 12-bit YUVA formats

At present, 16-bit auto-scaled format results in incorrect alpha
extraction.

5 years agoavformat/hcom: check probe buffer size
Paul B Mahol [Wed, 16 Jan 2019 09:26:53 +0000 (10:26 +0100)]
avformat/hcom: check probe buffer size

5 years agoavcodec/dirac_arith: Treat overread as error
Michael Niedermayer [Tue, 8 Jan 2019 22:40:54 +0000 (23:40 +0100)]
avcodec/dirac_arith: Treat overread as error

Fixes: Timeout
Fixes: 11663/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5636791864918016
Before:Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5636791864918016 in 26006 ms
After: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5636791864918016 in 106 ms

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: Propagate errors from dirac_get_arith_uint()
Michael Niedermayer [Tue, 8 Jan 2019 22:29:38 +0000 (23:29 +0100)]
avcodec/diracdec: Propagate errors from dirac_get_arith_uint()

Testcase: 11663/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5636791864918016

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/ac3dec: Optimize frame start search
Michael Niedermayer [Tue, 8 Jan 2019 17:11:47 +0000 (18:11 +0100)]
avcodec/ac3dec: Optimize frame start search

Fixes: Timeout
Fixes: 11619/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5632398021099520
Fixes: 11620/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_fuzzer-5711996515778560
Fixes: 11658/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-5701006524940288
Before: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5632398021099520 in 20338 ms
After:  Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5632398021099520 in 11825 ms

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/lzw: Check for end of input
Michael Niedermayer [Fri, 11 Jan 2019 21:38:35 +0000 (22:38 +0100)]
avcodec/lzw: Check for end of input

Fixes: Timeout
Fixes: 11873/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5093495044308992
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 agolavd/iec61883: Fix the include path for poll.h.
Carl Eugen Hoyos [Tue, 15 Jan 2019 23:13:49 +0000 (00:13 +0100)]
lavd/iec61883: Fix the include path for poll.h.

5 years agolavf/rtpproto: Use the correct patch when including poll.h
Carl Eugen Hoyos [Mon, 14 Jan 2019 17:21:15 +0000 (18:21 +0100)]
lavf/rtpproto: Use the correct patch when including poll.h

Fixes a warning using musl:
In file included from libavformat/rtpproto.c:43:0:
/usr/local/musl/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h>

5 years agoavcodec/hcom: get rid of single line brackets
Paul B Mahol [Tue, 15 Jan 2019 10:34:11 +0000 (11:34 +0100)]
avcodec/hcom: get rid of single line brackets

5 years agoavformat: add HCOM demuxer
Paul B Mahol [Wed, 2 Jan 2019 16:47:30 +0000 (17:47 +0100)]
avformat: add HCOM demuxer

5 years agoavcodec: add HCOM decoder
Paul B Mahol [Wed, 2 Jan 2019 17:50:38 +0000 (18:50 +0100)]
avcodec: add HCOM decoder

5 years agoffmpeg_opt: Print a warning if more than one -vf/-af option was specified.
Carl Eugen Hoyos [Mon, 14 Jan 2019 12:34:22 +0000 (13:34 +0100)]
ffmpeg_opt: Print a warning if more than one -vf/-af option was specified.

Fixes ticket #4184.

5 years agolavf/mov: Do not fail hard for more invalid atoms.
Carl Eugen Hoyos [Mon, 14 Jan 2019 11:44:01 +0000 (12:44 +0100)]
lavf/mov: Do not fail hard for more invalid atoms.

This is what several other players do and what FFmpeg already does for the sidx atom.

Fixes ticket #7679.

5 years agoavcodec/tests/rangecoder: initialize array to avoid valgrind warning
Michael Niedermayer [Fri, 4 Jan 2019 01:46:29 +0000 (02:46 +0100)]
avcodec/tests/rangecoder: initialize array to avoid valgrind warning

Found-by: jamrial
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/gdv: Optimize and factorize scaling loops
Michael Niedermayer [Fri, 4 Jan 2019 18:51:04 +0000 (19:51 +0100)]
avcodec/gdv: Optimize and factorize scaling loops

Fixes: Timeout
Fixes: 11067/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5686623711264768
Before change: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5686623711264768 in 34386 ms
After  change: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5686623711264768 in 24327 ms

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 agoapi-h264-slice-test: fix arguments and help
Rafaël Carré [Thu, 10 Jan 2019 11:00:27 +0000 (12:00 +0100)]
api-h264-slice-test: fix arguments and help

This program only takes 2 arguments
Remove comment that was never right

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/vc1: fix B predictor validity for 4-MV MBs
Jerome Borsboom [Mon, 14 Jan 2019 08:05:24 +0000 (09:05 +0100)]
avcodec/vc1: fix B predictor validity for 4-MV MBs

The B predictor for 4-MV MBs in interlace field pictures is not used
for blocks 0 and 2 when the picture is 1 MB wide.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
5 years agoavcodec/vp3: ref_frame/ref_frames are only required when HAVE_THREADS=1
Peter Ross [Fri, 4 Jan 2019 02:06:07 +0000 (13:06 +1100)]
avcodec/vp3: ref_frame/ref_frames are only required when HAVE_THREADS=1

5 years agocheckasm/af_afir: relax the max allowed absolute difference
James Almer [Thu, 10 Jan 2019 23:33:06 +0000 (20:33 -0300)]
checkasm/af_afir: relax the max allowed absolute difference

Should fix failures on x86_32.

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoavfilter/af_anlmdn: add timeline support
Paul B Mahol [Sun, 13 Jan 2019 10:55:01 +0000 (11:55 +0100)]
avfilter/af_anlmdn: add timeline support

5 years agoavfilter: add maskfun filter
Paul B Mahol [Mon, 19 Nov 2018 12:11:24 +0000 (13:11 +0100)]
avfilter: add maskfun filter

5 years agolavc: Allow very high bitrates in AVCPBProperties after next version bump.
Carl Eugen Hoyos [Thu, 10 Jan 2019 21:23:39 +0000 (22:23 +0100)]
lavc: Allow very high bitrates in AVCPBProperties after next version bump.