ffmpeg.git
20 hours agoavfilter/vf_v360: do not reset yaw/pitch/roll with reset_rot true master
Paul B Mahol [Sun, 24 Oct 2021 12:05:28 +0000 (14:05 +0200)]
avfilter/vf_v360: do not reset yaw/pitch/roll with reset_rot true

20 hours agoavfilter/vf_v360: replace deprecated FF_CEIL_RSHIFT()
Paul B Mahol [Sun, 24 Oct 2021 12:00:49 +0000 (14:00 +0200)]
avfilter/vf_v360: replace deprecated FF_CEIL_RSHIFT()

22 hours agoavformat/avio{,buf}: introduce public AVIOContext::bytes_{read,written}
Jan Ekström [Sun, 17 Oct 2021 21:35:48 +0000 (00:35 +0300)]
avformat/avio{,buf}: introduce public AVIOContext::bytes_{read,written}

Such fields can be seen as generally useful in cases where the
API user is not implementing custom AVIO callbacks, but still would
like to know if data is being read or written out, such as in case
data is being read from input but no AVPacket has been received yet.

22 hours agoavformat/avio{,buf}: deprecate AVIOContext::written
Jan Ekström [Wed, 13 Oct 2021 20:05:40 +0000 (23:05 +0300)]
avformat/avio{,buf}: deprecate AVIOContext::written

Originally added as a private entry in commit
3f75e5116b900f1428aa13041fc7d6301bf1988a, but its grouping with
the comment noting its private state was missed during merging of
the field from Libav (most likely due to an already existing field
in between).

22 hours agoavformat/avio: privatize source of truth for AVIOContext::written
Jan Ekström [Wed, 13 Oct 2021 19:21:51 +0000 (22:21 +0300)]
avformat/avio: privatize source of truth for AVIOContext::written

Looking at 3f75e5116b900f1428aa13041fc7d6301bf1988a, the field
was supposed to be private, but during merging the field and the
group that had the comment about it got separated.

Thus, move the actual privately utilized state of this variable
into the private FFIOContext. Additionally, name the private field
somewhat better, so that it does not get confused with the amount
of bytes written out.

34 hours agoavfilter/vf_dblur: add clipping
Paul B Mahol [Sat, 23 Oct 2021 21:51:42 +0000 (23:51 +0200)]
avfilter/vf_dblur: add clipping

34 hours agoavfilter/vf_dblur: use lrintf()
Paul B Mahol [Sat, 23 Oct 2021 18:31:24 +0000 (20:31 +0200)]
avfilter/vf_dblur: use lrintf()

34 hours agoavfilter/vf_dblur: fix artifacts
Paul B Mahol [Sat, 23 Oct 2021 14:59:38 +0000 (16:59 +0200)]
avfilter/vf_dblur: fix artifacts

43 hours agoavfilter/vf_convolution: improve runtime support for convolution filter
Paul B Mahol [Sat, 23 Oct 2021 12:47:11 +0000 (14:47 +0200)]
avfilter/vf_convolution: improve runtime support for convolution filter

43 hours agoavfilter/vf_convolution: unbreak runtime planes option functionality
Paul B Mahol [Sat, 23 Oct 2021 12:15:24 +0000 (14:15 +0200)]
avfilter/vf_convolution: unbreak runtime planes option functionality

For non-convolution filters like sobel.

2 days agoavcodec/flac_parser: Consider AV_INPUT_BUFFER_PADDING_SIZE
Michael Niedermayer [Thu, 21 Oct 2021 11:25:59 +0000 (13:25 +0200)]
avcodec/flac_parser: Consider AV_INPUT_BUFFER_PADDING_SIZE

Fixes: out if array read
Fixes: 40109/clusterfuzz-testcase-minimized-ffmpeg_dem_FLAC_fuzzer-4805686811295744

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Mattias Wadman <mattias.wadman@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 days agoavfilter/vf_selectivecolor: no need to use doubles
Paul B Mahol [Fri, 22 Oct 2021 11:47:16 +0000 (13:47 +0200)]
avfilter/vf_selectivecolor: no need to use doubles

2 days agoavfilter/vf_bilateral: add slice threading support
Paul B Mahol [Fri, 22 Oct 2021 09:01:23 +0000 (11:01 +0200)]
avfilter/vf_bilateral: add slice threading support

3 days agoavfilter/vf_bilateral: add direct aka writable frame support
Paul B Mahol [Fri, 22 Oct 2021 07:34:51 +0000 (09:34 +0200)]
avfilter/vf_bilateral: add direct aka writable frame support

3 days agoavfilter/vf_bilateral: properly round float result
Paul B Mahol [Thu, 21 Oct 2021 19:59:14 +0000 (21:59 +0200)]
avfilter/vf_bilateral: properly round float result

3 days agoavfilter/vf_bilateral: remove unused arguments
Paul B Mahol [Thu, 21 Oct 2021 19:15:48 +0000 (21:15 +0200)]
avfilter/vf_bilateral: remove unused arguments

3 days agoavfilter/vf_bilateral: remove unneeded multiplications
Paul B Mahol [Thu, 21 Oct 2021 19:05:02 +0000 (21:05 +0200)]
avfilter/vf_bilateral: remove unneeded multiplications

3 days agoavformat/mov: Do not hard fail if bit rate calculation overflows unless in explode...
Derek Buitenhuis [Tue, 12 Oct 2021 13:48:31 +0000 (14:48 +0100)]
avformat/mov: Do not hard fail if bit rate calculation overflows unless in explode mode

bit_rate is not a critical field, and we shouln't hard fail if we
can't caluclate it due to a large timebase - it needlessly breaks
valid files.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 days agoavformat/mov: Use av_rescale when calculating bit rate
Derek Buitenhuis [Wed, 20 Oct 2021 13:52:06 +0000 (14:52 +0100)]
avformat/mov: Use av_rescale when calculating bit rate

It is less susceptible to overflows.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 days agoavcodec/ttadsp: Fix integer overflows in tta_filter_process_c()
Michael Niedermayer [Thu, 14 Oct 2021 22:04:59 +0000 (00:04 +0200)]
avcodec/ttadsp: Fix integer overflows in tta_filter_process_c()

Fixes: signed integer overflow: 822841647 + 1647055738 cannot be represented in type 'int'
Fixes: 39935/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TTA_fuzzer-4592657142251520

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 days agotools/target_dec_fuzzer: Adjust threshold for MXPEG
Michael Niedermayer [Tue, 12 Oct 2021 12:59:49 +0000 (14:59 +0200)]
tools/target_dec_fuzzer: Adjust threshold for MXPEG

Fixes: Timeout
Fixes: 39813/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MXPEG_fuzzer-6010298067189760

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 days agoavutil/mathematics: Document av_rescale_rnd() behavior on non int64 results
Michael Niedermayer [Wed, 20 Oct 2021 17:51:08 +0000 (19:51 +0200)]
avutil/mathematics: Document av_rescale_rnd() behavior on non int64 results

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 days agoavfilter/vf_eq: add support for alpha channel
the.real.laplace@gmail.com [Mon, 18 Oct 2021 11:29:48 +0000 (14:29 +0300)]
avfilter/vf_eq: add support for alpha channel

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 days agodoc/filters: add notes for varblur
Gyan Doshi [Thu, 21 Oct 2021 10:43:54 +0000 (16:13 +0530)]
doc/filters: add notes for varblur

4 days agoavcodec/atsc_a53: use AVERROR_INVALIDDATA
Limin Wang [Wed, 13 Oct 2021 11:37:10 +0000 (19:37 +0800)]
avcodec/atsc_a53: use AVERROR_INVALIDDATA

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 days agoavcodec/hevc_sei: remove the duplicate check
Limin Wang [Wed, 13 Oct 2021 11:06:40 +0000 (19:06 +0800)]
avcodec/hevc_sei: remove the duplicate check

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 days agoavfilter/vf_showinfo: small adjustments for the HDR10+ dump
Limin Wang [Wed, 13 Oct 2021 11:20:29 +0000 (19:20 +0800)]
avfilter/vf_showinfo: small adjustments for the HDR10+ dump

summary for the adjustments:
1, remove the extra "," in the ,}
...{0.2004,0.3001,0.4008,0.5005,0.6002,0.7009,0.8006,0.9013,}
to
...{0.2004,0.3001,0.4008,0.5005,0.6002,0.7009,0.8006,0.9013}

2, add "," between the } and new field
} fraction_bright_pixels
to
}, fraction_bright_pixels

3, remove the extra space between "} }"
...{0.2004,0.3001,0.4008,0.5005,0.6002,0.7009,0.8006,0.9013,} }
to
...{0.2004,0.3001,0.4008,0.5005,0.6002,0.7009,0.8006,0.9013,}}

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 days agoavfilter/af_replaygain: use fabsf() instead of fabs()
Limin Wang [Wed, 13 Oct 2021 12:23:06 +0000 (20:23 +0800)]
avfilter/af_replaygain: use fabsf() instead of fabs()

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 days agoavformat/mpegtsenc: add AVSV format_identifier for AVS standard
Limin Wang [Tue, 24 Aug 2021 12:22:25 +0000 (20:22 +0800)]
avformat/mpegtsenc: add AVSV format_identifier for AVS standard

Listing of Registered Identifiers:
https://smpte-ra.org/registered-mpeg-ts-ids

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 days agoavformat/mpegts: add support for stream_type 0xd4, which is AVS3
Limin Wang [Tue, 24 Aug 2021 10:39:13 +0000 (18:39 +0800)]
avformat/mpegts: add support for stream_type 0xd4, which is AVS3

GB/T 17975.1
Information technology-Generic coding of moving pictures and associated audio
information-Part 1:Systems

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 days agoavfilter/vf_v360: make reset_rot option not lose its value
Paul B Mahol [Wed, 20 Oct 2021 12:40:30 +0000 (14:40 +0200)]
avfilter/vf_v360: make reset_rot option not lose its value

Unless -1 value is provided then rotation is reset single time.

5 days agoavcodec/libx264: move sei_data_size out of the for loop
James Almer [Wed, 20 Oct 2021 03:21:44 +0000 (00:21 -0300)]
avcodec/libx264: move sei_data_size out of the for loop

Otherwise its value will be reset on each iteration.

Signed-off-by: James Almer <jamrial@gmail.com>
5 days agoavformat/mpegts: add support for stream_type 0xd2, which is AVS2
Limin Wang [Tue, 24 Aug 2021 10:27:07 +0000 (18:27 +0800)]
avformat/mpegts: add support for stream_type 0xd2, which is AVS2

GB/T 17975.1
Information technology-Generic coding of moving pictures and associated audio
information-Part 1:Systems

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
5 days agoavcodec/extract_extradata_bsf: add support for AVS3
Limin Wang [Tue, 24 Aug 2021 11:10:19 +0000 (19:10 +0800)]
avcodec/extract_extradata_bsf: add support for AVS3

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
5 days agoavformat: add raw avs3 muxer
Limin Wang [Tue, 24 Aug 2021 10:10:19 +0000 (18:10 +0800)]
avformat: add raw avs3 muxer

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
6 days agoavfilter: add varblur video filter
Paul B Mahol [Mon, 11 Oct 2021 13:56:30 +0000 (15:56 +0200)]
avfilter: add varblur video filter

6 days agoavcodec/libx264: copy unregistered data SEI messages to the input x264 picture
James Almer [Tue, 19 Oct 2021 00:07:11 +0000 (21:07 -0300)]
avcodec/libx264: copy unregistered data SEI messages to the input x264 picture

Fixes undefined behavior.

Signed-off-by: James Almer <jamrial@gmail.com>
6 days agoavfilter/af_alimiter: add timeline and commands support
Paul B Mahol [Mon, 18 Oct 2021 20:44:40 +0000 (22:44 +0200)]
avfilter/af_alimiter: add timeline and commands support

6 days agolibavcodec/flac_parser: Validate subframe zero bit and type
Mattias Wadman [Wed, 13 Oct 2021 16:15:26 +0000 (18:15 +0200)]
libavcodec/flac_parser: Validate subframe zero bit and type

Reduces the risk of finding false frames that happens to have valid values and CRC.

Fixes ticket #9185 ffmpeg flac decoder incorrectly finds junk frame
https://trac.ffmpeg.org/ticket/9185

6 days agoavfilter/vf_fftdnoiz: fix missing funcionality
Paul B Mahol [Mon, 18 Oct 2021 19:32:06 +0000 (21:32 +0200)]
avfilter/vf_fftdnoiz: fix missing funcionality

6 days agoavfilter/vf_fftdnoiz: add command options support
Paul B Mahol [Mon, 18 Oct 2021 19:28:25 +0000 (21:28 +0200)]
avfilter/vf_fftdnoiz: add command options support

6 days agoavfilter/vf_fftdnoiz: add slice threading support
Paul B Mahol [Mon, 18 Oct 2021 16:03:16 +0000 (18:03 +0200)]
avfilter/vf_fftdnoiz: add slice threading support

6 days agoavcodec/h264_picture: don't assume Film Grain Params side data will be present
James Almer [Sun, 17 Oct 2021 16:25:04 +0000 (13:25 -0300)]
avcodec/h264_picture: don't assume Film Grain Params side data will be present

If a decoding error happens before frame side data is allocated, this assert may be
triggered. And since applying film grain is not enforced (we just warn it wasn't
applied and move on), we can just do that in such scenarios.

Fixes: Assertion failure
Fixes: clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5528650032742400

Signed-off-by: James Almer <jamrial@gmail.com>
6 days agolibavcodec/libx264: add user data unregistered SEI encoding
Brad Hards [Fri, 6 Aug 2021 09:16:33 +0000 (19:16 +1000)]
libavcodec/libx264: add user data unregistered SEI encoding

MISB ST 0604 and ST 2101 require user data unregistered SEI messages
(precision timestamps and sensor identifiers) to be included. That
currently isn't supported for libx264. This patch adds support
for user data unregistered SEI messages in accordance with ISO/IEC
14496-10:2020(E) section D.1.7 (syntax) and D.2.7 (semantics).

This code is based on a similar change for libx265 (commit
1f58503013720700a5adfd72c708e6275aefc165).

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
6 days agoseek: Fix crashes in ff_seek_frame_binary if built with latest Clang 14
Martin Storsjö [Mon, 18 Oct 2021 09:31:38 +0000 (12:31 +0300)]
seek: Fix crashes in ff_seek_frame_binary if built with latest Clang 14

Passing an uninitialized variable as argument to a function is
undefined behaviour (UB). The compiler can assume that UB does not
happen.

Hence, the compiler can assume that the variables are never
uninitialized when passed as argument, which means that the codepaths
that initializes them must be taken.

In ff_seek_frame_binary, this means that the compiler can assume
that the codepaths that initialize pos_min and pos_max are taken,
which means that the conditions "if (sti->index_entries)" and
"if (index >= 0)" can be optimized out.

Current Clang git versions (upcoming Clang 14) enabled an optimization
that does this, which broke the current version of this function
(which intentionally left the variables uninitialized, but silencing
warnings about being uninitialized). See [1] for discussion on
the matter.

[1] https://reviews.llvm.org/D105169#3069555

Signed-off-by: Martin Storsjö <martin@martin.st>
6 days agoaarch64: h264qpel: Do vertical filtering without transposing
Martin Storsjö [Fri, 3 Sep 2021 10:56:05 +0000 (13:56 +0300)]
aarch64: h264qpel: Do vertical filtering without transposing

This gives rather big speedups on these functions:

Before:
put_h264_qpel_8_mc01_8_neon:     241.0   131.5   138.7
put_h264_qpel_8_mc02_8_neon:     214.7   121.2   127.5
put_h264_qpel_8_mc03_8_neon:     242.5   131.2   135.7
put_h264_qpel_8_mc11_8_neon:     421.2   218.7   251.0
put_h264_qpel_8_mc12_8_neon:     878.0   509.5   537.5
put_h264_qpel_8_mc13_8_neon:     423.7   217.0   252.0
put_h264_qpel_8_mc21_8_neon:     858.2   479.5   514.0
put_h264_qpel_8_mc22_8_neon:     649.7   385.2   403.0
put_h264_qpel_8_mc23_8_neon:     860.2   476.5   517.7
put_h264_qpel_8_mc31_8_neon:     437.2   219.5   252.5
put_h264_qpel_8_mc32_8_neon:     892.5   510.5   546.0
put_h264_qpel_8_mc33_8_neon:     438.2   218.5   257.0
put_h264_qpel_16_mc01_8_neon:    944.2   509.7   546.7
put_h264_qpel_16_mc02_8_neon:    878.7   469.5   509.7
put_h264_qpel_16_mc03_8_neon:    945.7   510.7   557.0
put_h264_qpel_16_mc11_8_neon:   1663.2   858.5   979.5
put_h264_qpel_16_mc12_8_neon:   3510.2  2027.7  2112.7
put_h264_qpel_16_mc13_8_neon:   1664.7   857.5   980.5
put_h264_qpel_16_mc21_8_neon:   3366.2  1928.5  2030.5
put_h264_qpel_16_mc22_8_neon:   2584.7  1514.7  1590.2
put_h264_qpel_16_mc23_8_neon:   3367.7  1927.7  2035.0
put_h264_qpel_16_mc31_8_neon:   1716.7   849.7   997.0
put_h264_qpel_16_mc32_8_neon:   3564.0  2044.2  3835.2
put_h264_qpel_16_mc33_8_neon:   1717.7   863.0   989.5

After:
put_h264_qpel_8_mc01_8_neon:     136.0    73.7    76.0
put_h264_qpel_8_mc02_8_neon:     108.7    65.0    64.0
put_h264_qpel_8_mc03_8_neon:     137.5    72.7    73.0
put_h264_qpel_8_mc11_8_neon:     316.2   159.0   188.5
put_h264_qpel_8_mc12_8_neon:     653.0   375.5   384.7
put_h264_qpel_8_mc13_8_neon:     318.7   165.5   189.5
put_h264_qpel_8_mc21_8_neon:     739.2   385.7   432.5
put_h264_qpel_8_mc22_8_neon:     530.7   295.5   309.5
put_h264_qpel_8_mc23_8_neon:     741.2   393.7   421.0
put_h264_qpel_8_mc31_8_neon:     332.2   162.5   190.0
put_h264_qpel_8_mc32_8_neon:     667.5   378.2   390.5
put_h264_qpel_8_mc33_8_neon:     332.7   166.5   195.5
put_h264_qpel_16_mc01_8_neon:    524.2   285.2   294.0
put_h264_qpel_16_mc02_8_neon:    454.7   252.2   250.2
put_h264_qpel_16_mc03_8_neon:    525.7   286.0   283.0
put_h264_qpel_16_mc11_8_neon:   1243.2   630.7   726.7
put_h264_qpel_16_mc12_8_neon:   2610.2  1479.7  1481.2
put_h264_qpel_16_mc13_8_neon:   1250.5   631.7   727.7
put_h264_qpel_16_mc21_8_neon:   2890.2  1571.2  1679.7
put_h264_qpel_16_mc22_8_neon:   2108.7  1177.5  1223.5
put_h264_qpel_16_mc23_8_neon:   2891.7  1578.7  1667.7
put_h264_qpel_16_mc31_8_neon:   1296.7   630.5   752.5
put_h264_qpel_16_mc32_8_neon:   2664.0  1483.2  1503.5
put_h264_qpel_16_mc33_8_neon:   1297.7   632.5   747.2

I.e. overall a 20%-60% reduction in runtime of these
functions.

Signed-off-by: Martin Storsjö <martin@martin.st>
6 days agoarm/aarch64: Improve scheduling in the avg form of h264_qpel
Martin Storsjö [Fri, 3 Sep 2021 10:23:31 +0000 (13:23 +0300)]
arm/aarch64: Improve scheduling in the avg form of h264_qpel

Don't use the loaded registers directly, avoiding stalls on in
order cores. Use vrhadd.u8 with q registers where easily possible.

Signed-off-by: Martin Storsjö <martin@martin.st>
6 days agodoc/filters: correct description of select filter variables
Gyan Doshi [Mon, 18 Oct 2021 08:58:04 +0000 (14:28 +0530)]
doc/filters: correct description of select filter variables

7 days agoavfilter/vf_w3fdif: do not output extra frame at start with deint=interlaced
Paul B Mahol [Mon, 18 Oct 2021 07:26:42 +0000 (09:26 +0200)]
avfilter/vf_w3fdif: do not output extra frame at start with deint=interlaced

7 days agoavcodec/speexdec: Seed should be unsigned otherwise the operations done on it are...
Michael Niedermayer [Tue, 12 Oct 2021 12:50:41 +0000 (14:50 +0200)]
avcodec/speexdec: Seed should be unsigned otherwise the operations done on it are undefined

Fixes: signed integer overflow: 1664525000 + 1013904223 cannot be represented in type 'int'
Fixes: 39865/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEX_fuzzer-4979694508834816

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>
7 days agoavcodec/hevc_filter: Correct indention
Limin Wang [Sat, 9 Oct 2021 01:22:18 +0000 (09:22 +0800)]
avcodec/hevc_filter: Correct indention

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
7 days agoavcodec/hevc_filter: remove unneeded headers
Limin Wang [Sat, 9 Oct 2021 14:00:50 +0000 (22:00 +0800)]
avcodec/hevc_filter: remove unneeded headers

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
7 days agoavcodec/hevcdec: remove unused code
Limin Wang [Sat, 9 Oct 2021 14:17:54 +0000 (22:17 +0800)]
avcodec/hevcdec: remove unused code

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
7 days agoavformat/rtpdec_rfc4175: add support for RANGE
Limin Wang [Mon, 11 Oct 2021 16:17:14 +0000 (00:17 +0800)]
avformat/rtpdec_rfc4175: add support for RANGE

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
7 days agoavformat/rtpdec_rfc4175: add support for colorimetry
Limin Wang [Mon, 11 Oct 2021 16:13:28 +0000 (00:13 +0800)]
avformat/rtpdec_rfc4175: add support for colorimetry

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
7 days agoavformat/rtpdec_rfc4175: add support for TCS
Limin Wang [Mon, 11 Oct 2021 16:08:42 +0000 (00:08 +0800)]
avformat/rtpdec_rfc4175: add support for TCS

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
7 days agoavformat/rtpdec_rfc4175: add support for exactframerate
Limin Wang [Mon, 11 Oct 2021 15:37:17 +0000 (23:37 +0800)]
avformat/rtpdec_rfc4175: add support for exactframerate

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
8 days agoavcodec/av1_vaapi: improve decode quality
Fei Wang [Tue, 12 Oct 2021 08:24:04 +0000 (16:24 +0800)]
avcodec/av1_vaapi: improve decode quality

- quantizer delta and matrix level specific.
- support loop filter delta.
- support use superres.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
8 days agoavcodec/av1_vaapi: enable segmentation features
Fei Wang [Tue, 12 Oct 2021 08:24:03 +0000 (16:24 +0800)]
avcodec/av1_vaapi: enable segmentation features

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
8 days agoavcodec/av1_vaapi: setting 2 output surface for film grain
Fei Wang [Tue, 12 Oct 2021 08:24:02 +0000 (16:24 +0800)]
avcodec/av1_vaapi: setting 2 output surface for film grain

VAAPI needs 2 output surface for film grain frame. One used for
reference and the other used for applying film grain and pushing
to downstream.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
8 days agoavcodec/vaapi: increase av1 decode pool size
Fei Wang [Tue, 12 Oct 2021 08:24:01 +0000 (16:24 +0800)]
avcodec/vaapi: increase av1 decode pool size

For film grain clip, vaapi_av1 decoder will cache additional 8
surfaces that will be used to store frames which apply film grain.
So increase the pool size by plus 8 to avoid leak of surface.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
8 days agoavcodec/dxva2_av1: fix global motion params
Tong Wu [Tue, 12 Oct 2021 08:24:00 +0000 (16:24 +0800)]
avcodec/dxva2_av1: fix global motion params

Defined in spec 5.9.24/5.9.25. Since function void
global_motion_params(AV1DecContext *s) already updates
gm type/params, the wminvalid parameter only need to get
the value from cur_frame.gm_invalid.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
8 days agoavcodec/av1_vaapi: add gm params valid check
Fei Wang [Tue, 12 Oct 2021 08:23:59 +0000 (16:23 +0800)]
avcodec/av1_vaapi: add gm params valid check

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
8 days agoavcodec/av1dec: support setup shear process
Fei Wang [Tue, 12 Oct 2021 08:23:58 +0000 (16:23 +0800)]
avcodec/av1dec: support setup shear process

Defined in spec 7.11.3.6/7.11.3.7.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
8 days agoavcodec/av1: extend some definitions in spec section 3
Fei Wang [Tue, 12 Oct 2021 08:23:57 +0000 (16:23 +0800)]
avcodec/av1: extend some definitions in spec section 3

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
8 days agocbs_av1: fix incorrect data type
Fei Wang [Tue, 12 Oct 2021 08:23:56 +0000 (16:23 +0800)]
cbs_av1: fix incorrect data type

Since order_hint_bits_minus_1 range is 0~7, cur_frame_hint can be
most 128. And similar return value for cbs_av1_get_relative_dist.
So if plus them and use int8_t for the result may lose its precision.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
8 days agoavfilter/opencl: Fix program_opencl for source code larger than 64kB
Tsutomu Seki [Thu, 6 May 2021 05:13:15 +0000 (14:13 +0900)]
avfilter/opencl: Fix program_opencl for source code larger than 64kB

The condition (pos < len) is always true and the
rest of the OpenCL program code would not be read, while
the maximum number of "rb" is "len - pos - 1", and then, the
maximum number of the "pos" is "len - 1".

Fixes: trac.ffmpeg.org/ticket/9217

8 days agoavfilter/vf_v360: add reset_rot option
Paul B Mahol [Sat, 16 Oct 2021 09:37:07 +0000 (11:37 +0200)]
avfilter/vf_v360: add reset_rot option

9 days agoavcodec/hevcdec: apply H.274 film grain
Niklas Haas [Tue, 28 Sep 2021 23:06:02 +0000 (01:06 +0200)]
avcodec/hevcdec: apply H.274 film grain

Similar in spirit and design to 66845cffc3bbb, but slightly simpler due
to the lack of interlaced frames in HEVC. See that commit for more
details.

For the seed value, since no specification for this appears to exist, I
semi-arbitrarily decided to base it off the POC id alone, since there's
no analog of the idr_pic_id in HEVC's I-frames. This design is stable
across remuxes and seeks, but changes for adjacent frames with a period
that's typically long enough not to be noticeable, which makes it
satisfy all of the requirements that a film grain seed should have.

Tested with and without threading, using a patch to insert film grain
metadata artificially (for lack of real files containing film grain).

9 days agoavformat/argo_asf: use title metadata when muxing
Zane van Iperen [Mon, 11 Oct 2021 11:20:28 +0000 (21:20 +1000)]
avformat/argo_asf: use title metadata when muxing

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
9 days agoavformat/argo_asf: pass name through as metadata
Zane van Iperen [Mon, 11 Oct 2021 11:21:35 +0000 (21:21 +1000)]
avformat/argo_asf: pass name through as metadata

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
9 days agoavformat/argo_asf: cleanup and NULL-terminate name field in header
Zane van Iperen [Tue, 12 Oct 2021 10:45:45 +0000 (20:45 +1000)]
avformat/argo_asf: cleanup and NULL-terminate name field in header

Preparation for metadata changes in the following patches. Saves
having to create an extra buffer.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
9 days agolibswscale/x86/rgb2rgb: add shuffle_bytes avx2
Wu Jianhua [Thu, 30 Sep 2021 01:56:09 +0000 (09:56 +0800)]
libswscale/x86/rgb2rgb: add shuffle_bytes avx2

Performance data(Less is better):
    shuffle_bytes_ssse3   3.64654
    shuffle_bytes_avx2    0.94288

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
9 days agoavfilter/window_func: unify all filters win_func option that use this header
Paul B Mahol [Fri, 15 Oct 2021 08:41:01 +0000 (10:41 +0200)]
avfilter/window_func: unify all filters win_func option that use this header

10 days agox86/vf_lut3d: use three operand form for some instructions
James Almer [Thu, 14 Oct 2021 21:09:08 +0000 (18:09 -0300)]
x86/vf_lut3d: use three operand form for some instructions

Fixes compilation with old yasm.

Signed-off-by: James Almer <jamrial@gmail.com>
10 days agoavfilter/vf_fftfilt: export FFT arrays size
Paul B Mahol [Thu, 14 Oct 2021 18:22:20 +0000 (20:22 +0200)]
avfilter/vf_fftfilt: export FFT arrays size

10 days agoavfilter/vf_overlay: unbreak alpha composition with negative y and threads > 1
Paul B Mahol [Thu, 14 Oct 2021 17:58:56 +0000 (19:58 +0200)]
avfilter/vf_overlay: unbreak alpha composition with negative y and threads > 1

10 days agoavfilter/vf_fftfilt: Use av_clip_uint8
Martin Storsjö [Thu, 14 Oct 2021 06:29:08 +0000 (09:29 +0300)]
avfilter/vf_fftfilt: Use av_clip_uint8

The refactoring in 844890b1bc86316a38bc9e1dbf8ba0dd254307e3 caused
fate-source to point out that this could be av_clip_uintp2 (or
rather av_clip_uint8).

Signed-off-by: Martin Storsjö <martin@martin.st>
10 days agofate: update histogram test results
Paul B Mahol [Thu, 14 Oct 2021 10:20:57 +0000 (12:20 +0200)]
fate: update histogram test results

10 days agoavfilter/vf_histogram: add colors_mode option
Paul B Mahol [Thu, 14 Oct 2021 10:04:19 +0000 (12:04 +0200)]
avfilter/vf_histogram: add colors_mode option

11 days agoavfilter/vf_fftfilt: add gray formats >8 depth support
Paul B Mahol [Thu, 14 Oct 2021 08:08:01 +0000 (10:08 +0200)]
avfilter/vf_fftfilt: add gray formats >8 depth support

11 days agoavformat/westwood_vqa: Store VQFL codebook chunks
Pekka Väänänen [Wed, 22 Sep 2021 12:42:23 +0000 (15:42 +0300)]
avformat/westwood_vqa: Store VQFL codebook chunks

High color 15-bit VQA3 video streams contain high level chunks with
only codebook updates that shouldn't be considered new frames. Now
the demuxer stores a reference to such VQFL chunks and returns them
later along with a VQFR chunk with full frame data.

11 days agoavfilter/vf_fftfilt: add slice threading support
Paul B Mahol [Wed, 13 Oct 2021 22:57:03 +0000 (00:57 +0200)]
avfilter/vf_fftfilt: add slice threading support

11 days agoavfilter/vf_fftfilt: simplify bits/len calculation
Paul B Mahol [Wed, 13 Oct 2021 21:10:05 +0000 (23:10 +0200)]
avfilter/vf_fftfilt: simplify bits/len calculation

11 days agoavfilter: add xcorrelate video filter
Paul B Mahol [Thu, 7 Oct 2021 17:33:54 +0000 (19:33 +0200)]
avfilter: add xcorrelate video filter

11 days agoavfilter: add limitdiff video filter
Paul B Mahol [Thu, 7 Oct 2021 09:56:39 +0000 (11:56 +0200)]
avfilter: add limitdiff video filter

11 days agoavfilter/vf_palettegen: cosmetic changes
Soft Works [Sun, 26 Sep 2021 17:23:01 +0000 (17:23 +0000)]
avfilter/vf_palettegen: cosmetic changes

Signed-off-by: softworkz <softworkz@hotmail.com>
11 days agoavfilter/vf_palette(gen|use): support palettes with alpha
Soft Works [Wed, 13 Oct 2021 16:33:05 +0000 (18:33 +0200)]
avfilter/vf_palette(gen|use): support palettes with alpha

11 days agoavfilter/vf_lut3d: fix building with --disable-optimizations
Mark Reid [Mon, 11 Oct 2021 06:10:26 +0000 (23:10 -0700)]
avfilter/vf_lut3d: fix building with --disable-optimizations

11 days agoavcodec/videotoolboxenc: use goto end for memory cleanup
Limin Wang [Mon, 4 Oct 2021 03:59:21 +0000 (11:59 +0800)]
avcodec/videotoolboxenc: use goto end for memory cleanup

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
11 days agoavcodec/avs3_parser: Fix usage of init_get_bits() and use init_get_bits8()
Limin Wang [Fri, 8 Oct 2021 14:08:12 +0000 (22:08 +0800)]
avcodec/avs3_parser: Fix usage of init_get_bits() and use init_get_bits8()

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
11 days agoavcodec/audiotoolboxdec: Fix usage of init_get_bits() and use init_get_bits8()
Limin Wang [Fri, 8 Oct 2021 14:00:13 +0000 (22:00 +0800)]
avcodec/audiotoolboxdec: Fix usage of init_get_bits() and use init_get_bits8()

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
11 days agoavformat/dhav: make duration extraction more robust
Paul B Mahol [Wed, 13 Oct 2021 10:12:35 +0000 (12:12 +0200)]
avformat/dhav: make duration extraction more robust

11 days agoavformat/dhav: check if timestamp matches when seeking
Paul B Mahol [Wed, 13 Oct 2021 09:46:15 +0000 (11:46 +0200)]
avformat/dhav: check if timestamp matches when seeking

12 days agolibavformat/hls: correct indentation
Nachiket Tarate [Tue, 21 Sep 2021 18:42:28 +0000 (00:12 +0530)]
libavformat/hls: correct indentation

Signed-off-by: Nachiket Tarate <nachiket.programmer@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
12 days agolibavformat/hls: add support for decryption of HLS media segments encrypted using...
Nachiket Tarate [Tue, 21 Sep 2021 18:42:00 +0000 (00:12 +0530)]
libavformat/hls: add support for decryption of HLS media segments encrypted using SAMPLE-AES encryption method

Apple HTTP Live Streaming Sample Encryption:

https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/HLS_Sample_Encryption

Signed-off-by: Nachiket Tarate <nachiket.programmer@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
12 days agolibavformat/mov: add support for 'cens', 'cbc1' and 'cbcs' encryption schemes specifi...
Nachiket Tarate [Tue, 21 Sep 2021 18:41:31 +0000 (00:11 +0530)]
libavformat/mov: add support for 'cens', 'cbc1' and 'cbcs' encryption schemes specified in Common Encryption (CENC) standard

correct implementation of 'cenc' encryption scheme to support
decryption of partial cipher blocks at the end of subsamples

https://www.iso.org/standard/68042.html

Signed-off-by: Nachiket Tarate <nachiket.programmer@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
12 days agolibavcodec/adts_header: add frame_length field and avpriv function to parse AAC ADTS...
Nachiket Tarate [Tue, 21 Sep 2021 18:40:58 +0000 (00:10 +0530)]
libavcodec/adts_header: add frame_length field and avpriv function to parse AAC ADTS header

These will be used by HLS demuxer in case of sample decryption.

Signed-off-by: Nachiket Tarate <nachiket.programmer@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
13 days agoavcodec/gemdec: Use ff_set_dimensions()
Michael Niedermayer [Sun, 10 Oct 2021 21:31:13 +0000 (23:31 +0200)]
avcodec/gemdec: Use ff_set_dimensions()

Fixes: OOM
Fixes: 39798/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GEM_fuzzer-5611636853964800

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 days agoavcodec/utils: Ensure 8x8 alignment for ARGO in avcodec_align_dimensions2()
Michael Niedermayer [Sun, 10 Oct 2021 21:13:43 +0000 (23:13 +0200)]
avcodec/utils: Ensure 8x8 alignment for ARGO in avcodec_align_dimensions2()

Fixes: out of array access
Fixes: 39736/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARGO_fuzzer-4820016722214912

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>