ffmpeg.git
3 months agoavformat/concat: check the terminating character returned by av_get_token()
James Almer [Tue, 27 Jul 2021 15:00:03 +0000 (12:00 -0300)]
avformat/concat: check the terminating character returned by av_get_token()

Don't attempt to increase the cursor pointer if it was \0.
Fixes invalid reads.

Reviewed-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Almer <jamrial@gmail.com>
3 months agoavfilter/vf_pseudocolor: add three more presets
Paul B Mahol [Mon, 26 Jul 2021 20:49:02 +0000 (22:49 +0200)]
avfilter/vf_pseudocolor: add three more presets

3 months agoavcodec/h264_sei: honor the Film Grain Characteristics cancel flag
James Almer [Mon, 26 Jul 2021 02:09:00 +0000 (23:09 -0300)]
avcodec/h264_sei: honor the Film Grain Characteristics cancel flag

Film Grain persistence is cancelled when it's true.

Signed-off-by: James Almer <jamrial@gmail.com>
3 months agoavfilter/af_silenceremove: make window also depends on input sample format
Paul B Mahol [Sun, 25 Jul 2021 19:50:31 +0000 (21:50 +0200)]
avfilter/af_silenceremove: make window also depends on input sample format

3 months agoffmpeg: fix order between field order autodetection and override
Jan Ekström [Mon, 19 Jul 2021 20:25:28 +0000 (23:25 +0300)]
ffmpeg: fix order between field order autodetection and override

Having the override before autodetection meant that the overridden
value got overwritten by the autodetected result each time,
effectively disabling the ability to utilize the `-top` option
for override purposes.

Somehow I missed this in fbb44bc51a647862eb05ae3f9d7d49a0be9bed57 ,
even though the lines were within the context. Probably the code
originally being after this logic had something to do with it,
but previously it only touched the avformat context's codecpar,
which did not affect the encoder codec context whatsoever.

Fixes #9320
Fixes #9339

3 months agoavformat/yuv4mpegenc: add support for yuva444p
Paul B Mahol [Sat, 24 Jul 2021 16:07:57 +0000 (18:07 +0200)]
avformat/yuv4mpegenc: add support for yuva444p

3 months agoavfilter/af_silenceremove: add support for more sample formats
Paul B Mahol [Sun, 25 Jul 2021 13:38:33 +0000 (15:38 +0200)]
avfilter/af_silenceremove: add support for more sample formats

3 months agoavfilter/f_ebur128: fix video output regression
Paul B Mahol [Sun, 25 Jul 2021 11:04:03 +0000 (13:04 +0200)]
avfilter/f_ebur128: fix video output regression

3 months agoavfilter/f_ebur128: add all sample rates support
Paul B Mahol [Thu, 4 Mar 2021 13:01:39 +0000 (14:01 +0100)]
avfilter/f_ebur128: add all sample rates support

The magic constants come from the unofficial "ITU-R BS.1770-1 filter
specifications"¹ by Raiden (libebur128) which relies on "Parameter
Quantization in Direct-Form Recursive Audio Filters"² by Brian
Neunaber.

The constants seem to include a quantization bias, for example:
- Vb is supposed to be exactly √Vh in a high shelf filter
- the Pre-filter Gain should likely be 4dB
- Pre Q and RLB Q are respectively very close to √½ and ½

Those are not adjusted to prevent the values from drifting away from
the official specifications.

An alternative to this approach would be to requantize on the fly as
proposed by pbelkner³, where the 48kHz code path would use the exact
specifications constants while derivating constants for other
frequencies.

[1]: https://www.scribd.com/document/49991813/ITU-R-BS-1770-1-filters
[2]: https://www.scribd.com/document/6531763/Direct-Form-Filter-Parameter-Quantization
[3]: https://hydrogenaud.io/index.php?topic=86116.msg740092#msg740092

3 months agoavfilter/af_afwtdn: add forgotten break statement
Paul B Mahol [Sun, 25 Jul 2021 09:47:47 +0000 (11:47 +0200)]
avfilter/af_afwtdn: add forgotten break statement

3 months agoavfilter/vf_threshold: add support for commands
Paul B Mahol [Sun, 25 Jul 2021 09:24:18 +0000 (11:24 +0200)]
avfilter/vf_threshold: add support for commands

3 months agoavfilter/af_anlmdn: add longer names of filter options
Paul B Mahol [Sun, 25 Jul 2021 08:22:42 +0000 (10:22 +0200)]
avfilter/af_anlmdn: add longer names of filter options

3 months agolavfi/signature: fix always true expression
Valerii Zapodovnikov [Mon, 24 May 2021 01:00:24 +0000 (04:00 +0300)]
lavfi/signature: fix always true expression

Otherwise since "==" has higher precedence, mode is never checked.

Reviewed-by: Jai Luthra <me@jailuthra.in>
3 months agoavfilter/vf_pseudocolor: add solar preset
Paul B Mahol [Sat, 24 Jul 2021 21:12:13 +0000 (23:12 +0200)]
avfilter/vf_pseudocolor: add solar preset

Useful to emphasize bandings in video.

3 months agoavfilter/vf_fillborders: add another mode
Paul B Mahol [Sat, 24 Jul 2021 18:20:52 +0000 (20:20 +0200)]
avfilter/vf_fillborders: add another mode

3 months agoavfilter/avf_showspectrum: fix not rendering all channels with fscale=log:mode=separate
Paul B Mahol [Sat, 24 Jul 2021 15:30:58 +0000 (17:30 +0200)]
avfilter/avf_showspectrum: fix not rendering all channels with fscale=log:mode=separate

3 months agoconfigure: remove sofalizer triggering of avcodec dependency
Paul B Mahol [Sat, 24 Jul 2021 15:01:20 +0000 (17:01 +0200)]
configure: remove sofalizer triggering of avcodec dependency

3 months agoavfilter/avf_showspectrum: fix hz scale with legend enabled
Paul B Mahol [Sat, 24 Jul 2021 14:56:51 +0000 (16:56 +0200)]
avfilter/avf_showspectrum: fix hz scale with legend enabled

3 months agoavfilter/avf_showspectrum: switch to TX FFT from avutil
Paul B Mahol [Sat, 24 Jul 2021 12:22:38 +0000 (14:22 +0200)]
avfilter/avf_showspectrum: switch to TX FFT from avutil

3 months agoavfilter/af_headphone: switch to TX FFT from avutil
Paul B Mahol [Sat, 24 Jul 2021 10:17:36 +0000 (12:17 +0200)]
avfilter/af_headphone: switch to TX FFT from avutil

3 months agoavfilter/af_sofalizer: switch to TX FFT from avutil
Paul B Mahol [Sat, 24 Jul 2021 09:26:08 +0000 (11:26 +0200)]
avfilter/af_sofalizer: switch to TX FFT from avutil

3 months agoavfilter: add afwtdn filter
Paul B Mahol [Sun, 31 May 2020 08:22:23 +0000 (10:22 +0200)]
avfilter: add afwtdn filter

3 months agotools/graph2dot: Don't use sizeof(AVFilterGraph), check allocation
Andreas Rheinhardt [Thu, 22 Jul 2021 07:01:27 +0000 (09:01 +0200)]
tools/graph2dot: Don't use sizeof(AVFilterGraph), check allocation

Use avfilter_graph_alloc() instead of av_mallocz(sizeof(AVFilterGraph))
to allocate an AVFilterGraph; this also properly allocates the graph's
internal. The current code just happened to work because it did not
make any use of said internal.

Also check the allocation; this fixes Coverity #1292528.

Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec/h264_sei: parse and export Film Grain Characteristics SEI messages
James Almer [Fri, 23 Jul 2021 14:06:45 +0000 (11:06 -0300)]
avcodec/h264_sei: parse and export Film Grain Characteristics SEI messages

Signed-off-by: James Almer <jamrial@gmail.com>
3 months agoavutil/film_grain_params: add support for H.274 Film Grain Characteristics
James Almer [Fri, 23 Jul 2021 14:06:31 +0000 (11:06 -0300)]
avutil/film_grain_params: add support for H.274 Film Grain Characteristics

Used by codecs like H.264, HEVC, and VVC.

Signed-off-by: James Almer <jamrial@gmail.com>
3 months agocbs_h264: add support for Film Grain Characteristics SEI messages
James Almer [Fri, 23 Jul 2021 14:05:04 +0000 (11:05 -0300)]
cbs_h264: add support for Film Grain Characteristics SEI messages

Signed-off-by: James Almer <jamrial@gmail.com>
3 months agoavfilter/vf_shufflepixels: Check ff_get_video_buffer()
Andreas Rheinhardt [Thu, 22 Jul 2021 07:24:20 +0000 (09:24 +0200)]
avfilter/vf_shufflepixels: Check ff_get_video_buffer()

There would be a segfault in case of (likely memory allocation) failure.
Fixes Coverity issue #1322338.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavformat/yuv4mpegdec: Use table instead of repeated "else if"
Andreas Rheinhardt [Wed, 21 Jul 2021 11:15:00 +0000 (13:15 +0200)]
avformat/yuv4mpegdec: Use table instead of repeated "else if"

The code savings more than offset the size of the table
(1936B vs 768B with GCC 10.3 at -O3).

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec/tableprint_vlc: Fix building with hardcoded tables
Andreas Rheinhardt [Thu, 22 Jul 2021 23:00:13 +0000 (01:00 +0200)]
avcodec/tableprint_vlc: Fix building with hardcoded tables

This has been broken in 25c8507818d8559a6654a5b30a0f8aae11a48181,
because the hacks for headers that are incompatible with building
for the host in libavcodec/tableprint_vlc.h have not been adjusted.

Moving AV_INPUT_BUFFER_PADDING_SIZE to defs.h which is valid for
both the target as well as the host allowed to remove some of the hacks.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agotools/target_dec_fuzzer: Adjust threshold for libvorbis
Michael Niedermayer [Thu, 22 Apr 2021 16:13:38 +0000 (18:13 +0200)]
tools/target_dec_fuzzer: Adjust threshold for libvorbis

Fixes: Timeout
Fixes: 33513/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBVORBIS_fuzzer-6481006635909120

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavformat/mov: Avoid undefined overflow in time_offset calculation
Michael Niedermayer [Tue, 20 Apr 2021 15:40:56 +0000 (17:40 +0200)]
avformat/mov: Avoid undefined overflow in time_offset calculation

Fixes: signed integer overflow: 8511838621821575200 - -3954125146725285889 cannot be represented in type 'long'
Fixes: 33414/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6610119325515776

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoRemove/replace some unnecessary avcodec.h inclusions
Andreas Rheinhardt [Mon, 14 Jun 2021 16:03:55 +0000 (18:03 +0200)]
Remove/replace some unnecessary avcodec.h inclusions

Also remove other unnecessary headers and include headers directly while
at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec/g729postfilter.h: Include acelp_pitch_delay.h
Andreas Rheinhardt [Sun, 13 Jun 2021 13:44:20 +0000 (15:44 +0200)]
avcodec/g729postfilter.h: Include acelp_pitch_delay.h

Needed for PITCH_DELAY_MAX.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec: Remove some unnecessary mpegvideo.h inclusions
Andreas Rheinhardt [Sat, 12 Jun 2021 23:35:01 +0000 (01:35 +0200)]
avcodec: Remove some unnecessary mpegvideo.h inclusions

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoRemove unnecessary avassert.h inclusions
Andreas Rheinhardt [Thu, 22 Jul 2021 13:02:30 +0000 (15:02 +0200)]
Remove unnecessary avassert.h inclusions

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoRemove unnecessary mem.h inclusions
Andreas Rheinhardt [Thu, 22 Jul 2021 12:47:57 +0000 (14:47 +0200)]
Remove unnecessary mem.h inclusions

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoRemove obsolete version.h inclusions
Andreas Rheinhardt [Fri, 11 Jun 2021 19:54:31 +0000 (21:54 +0200)]
Remove obsolete version.h inclusions

These have mostly been added because of FF_API_*; yet when these were
removed, removing the header has been forgotten.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavutil/internal, swresample/audioconvert: Remove cpu.h inclusions
Andreas Rheinhardt [Sat, 12 Jun 2021 21:00:12 +0000 (23:00 +0200)]
avutil/internal, swresample/audioconvert: Remove cpu.h inclusions

These inclusions are not necessary, as cpu.h is already included
wherever it is needed (via direct inclusion or via the arch-specific
headers).
Also remove other unnecessary cpu.h inclusions from ordinary
non-headers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec/lossless_videodsp: Improve included headers
Andreas Rheinhardt [Sat, 12 Jun 2021 20:31:53 +0000 (22:31 +0200)]
avcodec/lossless_videodsp: Improve included headers

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec/avcodec: Don't include cpu.h
Andreas Rheinhardt [Sat, 12 Jun 2021 20:10:11 +0000 (22:10 +0200)]
avcodec/avcodec: Don't include cpu.h

It is not used here at all; instead, add it where it is used without
including it or any of the arch-specific CPU headers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec/avcodec: Don't include hwcontext.h
Andreas Rheinhardt [Sat, 12 Jun 2021 19:04:28 +0000 (21:04 +0200)]
avcodec/avcodec: Don't include hwcontext.h

It is no longer used directly; but it is still indirectly included via
codec.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec/avcodec: Don't include errno.h
Andreas Rheinhardt [Fri, 11 Jun 2021 23:14:27 +0000 (01:14 +0200)]
avcodec/avcodec: Don't include errno.h

This inclusion has been added before libavutil/error.h was split off
from avcodec.h (in 60c144f700e2e362047b00704abcb694d49e549c).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec/avcodec: Stop including channel_layout.h in avcodec.h
Andreas Rheinhardt [Fri, 11 Jun 2021 23:10:58 +0000 (01:10 +0200)]
avcodec/avcodec: Stop including channel_layout.h in avcodec.h

Also include channel_layout.h directly wherever used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec/avcodec: Stop including bsf.h in avcodec.h
Andreas Rheinhardt [Fri, 11 Jun 2021 21:35:33 +0000 (23:35 +0200)]
avcodec/avcodec: Stop including bsf.h in avcodec.h

Also include bsf.h directly wherever it is used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec/adpcm_data: Move tables only used by adpcm.c to it
Andreas Rheinhardt [Thu, 17 Jun 2021 01:41:36 +0000 (03:41 +0200)]
avcodec/adpcm_data: Move tables only used by adpcm.c to it

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec/adpcm_data: Fix type mismatch for ff_adpcm_afc_coeffs
Andreas Rheinhardt [Thu, 17 Jun 2021 01:34:57 +0000 (03:34 +0200)]
avcodec/adpcm_data: Fix type mismatch for ff_adpcm_afc_coeffs

According to the header it is an array of int16_t, yet it is declared as
uint16_t. Fix this by using int16_t troughout and convert the definition
to use values in the range of int16_t.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec/adpcm: Don't include disabled AVCodecs
Andreas Rheinhardt [Tue, 8 Jun 2021 01:25:43 +0000 (03:25 +0200)]
avcodec/adpcm: Don't include disabled AVCodecs

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec/adpcm: Disable dead code
Andreas Rheinhardt [Tue, 8 Jun 2021 16:26:52 +0000 (18:26 +0200)]
avcodec/adpcm: Disable dead code

This change ensures that the linker can drop adpcm_data.o if no decoder
that actually uses anything from there is enabled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec/adpcm: Fix indentation
Andreas Rheinhardt [Tue, 8 Jun 2021 14:52:15 +0000 (16:52 +0200)]
avcodec/adpcm: Fix indentation

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec/adpcm: Use smaller scope for some variables
Andreas Rheinhardt [Mon, 7 Jun 2021 23:03:45 +0000 (01:03 +0200)]
avcodec/adpcm: Use smaller scope for some variables

This is to avoid unused variables warnings after the code for
the disabled encoders has been #if'ed away which will happen in
a subsequent commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec/adpcmenc: Don't include disabled AVCodecs
Andreas Rheinhardt [Tue, 8 Jun 2021 01:25:43 +0000 (03:25 +0200)]
avcodec/adpcmenc: Don't include disabled AVCodecs

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec/adpcmenc: Deduplicate AVClasses
Andreas Rheinhardt [Mon, 7 Jun 2021 14:13:33 +0000 (16:13 +0200)]
avcodec/adpcmenc: Deduplicate AVClasses

The child_class_next API relied on different (de)muxers to use
different AVClasses; yet this API has been replaced by
child_class_iterate.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec/adpcmenc: #if disabled code away, fix build without ADPCM_ARGO
Andreas Rheinhardt [Tue, 8 Jun 2021 00:36:00 +0000 (02:36 +0200)]
avcodec/adpcmenc: #if disabled code away, fix build without ADPCM_ARGO

The adpcm_argo encoder does not use the data from adpcm_data.c directly;
instead it shares a function with the adpcm_argo decoder that is in
adpcm.c. When all the ADPCM decoders and the adpcm_argo encoder are
disabled, adpcm.c is not compiled; yet the code in adpcmenc.c calling
said function from adpcm.c is still present, leading to link errors.

Fix this by disabling the code belonging to disabled codecs in
adpcmenc.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec/adpcmenc: Use smaller scope for some variables
Andreas Rheinhardt [Mon, 7 Jun 2021 23:03:45 +0000 (01:03 +0200)]
avcodec/adpcmenc: Use smaller scope for some variables

This is to avoid unused variables warnings if the code for disabled
encoders is #if'ed away which will happen in a subsequent commit.
In case of buf it also avoids shadowing.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agolavfi/dnn_backend_ov: Rename RequestItem to OVRequestItem
Shubhanshu Saxena [Sun, 11 Jul 2021 16:15:02 +0000 (21:45 +0530)]
lavfi/dnn_backend_ov: Rename RequestItem to OVRequestItem

Rename RequestItem to OVRequestItem in the OpenVINO backend
to avoid confusion.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
3 months agolavfi/dnn_backend_openvino.c: Fix Memory Leak in execute_model_ov
Shubhanshu Saxena [Sun, 11 Jul 2021 16:15:01 +0000 (21:45 +0530)]
lavfi/dnn_backend_openvino.c: Fix Memory Leak in execute_model_ov

In cases where the execution inside the function execute_model_ov fails,
the OVRequestItem must be pushed back to the request_queue before returning
the error. In case pushing back fails, release the allocated memory.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
3 months agolavu/kperf: use ff_thread_once()
J. Dekker [Wed, 21 Jul 2021 14:21:34 +0000 (16:21 +0200)]
lavu/kperf: use ff_thread_once()

Signed-off-by: J. Dekker <jdek@itanimul.li>
3 months agodoc/filters: note expr and eval mode support in overlay_cuda
Gyan Doshi [Wed, 21 Jul 2021 07:38:13 +0000 (13:08 +0530)]
doc/filters: note expr and eval mode support in overlay_cuda

Commit 58c908cf94 added support for expressions for x and y parameters.
Also added was option to set eval frequency.

3 months agoavutil/macos_kperf: add missing header guards
James Almer [Tue, 20 Jul 2021 22:01:02 +0000 (19:01 -0300)]
avutil/macos_kperf: add missing header guards

Fixes fate-source

Signed-off-by: James Almer <jamrial@gmail.com>
3 months agolavu/checkasm: add (private) kperf timing for macOS
J. Dekker [Tue, 20 Jul 2021 17:09:22 +0000 (19:09 +0200)]
lavu/checkasm: add (private) kperf timing for macOS

Signed-off-by: J. Dekker <jdek@itanimul.li>
3 months agoavfilter/af_drmeter: Check that there is data
Michael Niedermayer [Sat, 5 Jun 2021 18:28:24 +0000 (20:28 +0200)]
avfilter/af_drmeter: Check that there is data

Fixes: floating point division by 0
Fixes: -nan is outside the range of representable values of type 'int'
Fixes: Ticket8307

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavfilter/vf_fftdnoiz: Use lrintf() in export_row8()
Michael Niedermayer [Sat, 5 Jun 2021 18:12:08 +0000 (20:12 +0200)]
avfilter/vf_fftdnoiz: Use lrintf() in export_row8()

Fixes: 1.04064e+10 is outside the range of representable values of type 'int'
Fixes: Ticket 8279

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavfilter/vf_mestimate: Check b_count
Michael Niedermayer [Sat, 5 Jun 2021 18:04:45 +0000 (20:04 +0200)]
avfilter/vf_mestimate: Check b_count

Fixes: left shift of negative value -1
Fixes: Ticket8270

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavfilter/vf_signature: Initialize all houghspace elements
Jai Luthra [Tue, 13 Jul 2021 07:55:25 +0000 (13:25 +0530)]
avfilter/vf_signature: Initialize all houghspace elements

Co-authored-by: Oscar <oscar_davids@outlook.com>
3 months agolavu/cpu: Use av_cpu_ prefix
Thilo Borgmann [Tue, 20 Jul 2021 07:33:47 +0000 (09:33 +0200)]
lavu/cpu: Use av_cpu_ prefix

3 months agoavformat/gifdec: log loop count
Gyan Doshi [Mon, 19 Jul 2021 10:53:34 +0000 (16:23 +0530)]
avformat/gifdec: log loop count

3 months agofftools/ffmpeg: Fix runlength for strncmp()
Thilo Borgmann [Mon, 19 Jul 2021 19:23:02 +0000 (21:23 +0200)]
fftools/ffmpeg: Fix runlength for strncmp()

3 months agoavdevice/avfoundation: remove first_audio_pts and first_pts
Steven Liu [Mon, 19 Jul 2021 12:03:25 +0000 (20:03 +0800)]
avdevice/avfoundation: remove first_audio_pts and first_pts

Because these two member of AVFContext not be used.

Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
3 months agoffmpeg: delay readrate enforcement for decoded streams
Gyan Doshi [Mon, 19 Jul 2021 07:24:55 +0000 (12:54 +0530)]
ffmpeg: delay readrate enforcement for decoded streams

Read rate enforcement delayed till first decoded frame is obtained, to
speed up init of output streams.

Thanks to Linjie Fu <linjie.justin.fu@gmail.com> for the initial patch.

3 months agoavformat/argo_brp: use bits_per_coded_sample instead of bits_per_raw_sample
Zane van Iperen [Sat, 17 Jul 2021 23:27:11 +0000 (09:27 +1000)]
avformat/argo_brp: use bits_per_coded_sample instead of bits_per_raw_sample

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 months agoavcodec/argo: use bits_per_coded_sample instead of bits_per_raw_sample
Zane van Iperen [Sat, 17 Jul 2021 23:18:47 +0000 (09:18 +1000)]
avcodec/argo: use bits_per_coded_sample instead of bits_per_raw_sample

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 months agoavformat/pp_bnk: don't set bits_per_raw_sample
Zane van Iperen [Sun, 18 Jul 2021 00:42:33 +0000 (10:42 +1000)]
avformat/pp_bnk: don't set bits_per_raw_sample

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 months agoavformat/kvag: don't set bits_per_raw_sample
Zane van Iperen [Sun, 18 Jul 2021 00:41:54 +0000 (10:41 +1000)]
avformat/kvag: don't set bits_per_raw_sample

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 months agoavformat/apm: don't set bits_per_raw_sample
Zane van Iperen [Sun, 18 Jul 2021 00:41:21 +0000 (10:41 +1000)]
avformat/apm: don't set bits_per_raw_sample

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 months agoavformat/alp: don't set bits_per_raw_sample
Zane van Iperen [Sun, 18 Jul 2021 00:40:30 +0000 (10:40 +1000)]
avformat/alp: don't set bits_per_raw_sample

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 months agoavformat/argo_asf: don't set bits_per_raw_sample
Zane van Iperen [Sat, 17 Jul 2021 23:17:49 +0000 (09:17 +1000)]
avformat/argo_asf: don't set bits_per_raw_sample

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 months agoavformat/argo_cvg: don't set bits_per_raw_sample
Zane van Iperen [Sat, 17 Jul 2021 23:15:16 +0000 (09:15 +1000)]
avformat/argo_cvg: don't set bits_per_raw_sample

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 months agoavcodec/dsd_tablegen: Merge header into dsd.c
Andreas Rheinhardt [Sun, 13 Jun 2021 13:16:14 +0000 (15:16 +0200)]
avcodec/dsd_tablegen: Merge header into dsd.c

Since b492fbcc6e87094804fdf71308dc500976c6b165, the DSD tables are
always initialized at runtime, so merge the dsd_tablegen.h header
into dsd.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavfilter/internal: Mark ff_filter_get_nb_threads() as av_pure
Andreas Rheinhardt [Sat, 12 Jun 2021 23:57:27 +0000 (01:57 +0200)]
avfilter/internal: Mark ff_filter_get_nb_threads() as av_pure

It does not modify anything; it only returns a value, so it fulfills
the requirements for av_pure.
The deeper rationale behind this change is that this function is called
quite often inside arguments to FFMIN which may lead to two calls to it;
declaring this function as av_pure allows the compiler to optimize the
second call away.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoAvoid calling functions repeatedly via FFMIN
Andreas Rheinhardt [Sat, 12 Jun 2021 23:55:40 +0000 (01:55 +0200)]
Avoid calling functions repeatedly via FFMIN

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavcodec/libavcodec.v: Tighten export whitelist
Andreas Rheinhardt [Mon, 14 Jun 2021 20:07:56 +0000 (22:07 +0200)]
avcodec/libavcodec.v: Tighten export whitelist

Currently every symbol (with external linkage) that starts with "av" is
exported. Yet libaom-av1 has lots of functions that are not meant to be
exported and start with "av1_" (I counted 1236); and libvpx has
average_split_mvs. These functions are exported if one links these
libraries statically into a shared libavcodec.so.

Solve this by tightening the whitelist to "av_", "avcodec_", "avpriv_"
and (as a special-case) "avsubtitle_free".

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agofftools/ffmpeg: Fix declaration-after-statement warning
Andreas Rheinhardt [Sat, 17 Jul 2021 21:27:59 +0000 (23:27 +0200)]
fftools/ffmpeg: Fix declaration-after-statement warning

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavutil/hwcontext_videotoolbox: implement hwupload to convert AVFrame to CVPixelBuffer
Aman Karmani [Tue, 29 Jun 2021 21:43:16 +0000 (14:43 -0700)]
avutil/hwcontext_videotoolbox: implement hwupload to convert AVFrame to CVPixelBuffer

Teach AV_HWDEVICE_TYPE_VIDEOTOOLBOX to be able to create AVFrames of type
AV_PIX_FMT_VIDEOTOOLBOX. This can be used to hwupload a regular AVFrame
into its CVPixelBuffer equivalent.

    ffmpeg -init_hw_device videotoolbox -f lavfi -i color=black:640x480 -vf hwupload -c:v h264_videotoolbox -f null -y /dev/null

Signed-off-by: Aman Karmani <aman@tmm1.net>
3 months agox86/tx_float: correctly load the transform length
Lynne [Sun, 18 Jul 2021 13:00:48 +0000 (15:00 +0200)]
x86/tx_float: correctly load the transform length

The field is a standard field, yet we were loading it as if it was
a quadword. This worked for forward transforms by chance, but broke
when the transform was inverse.
checkasm couldn't catch that because we only test forward transforms,
which are identical to inverse transforms but with a different revtab.

3 months agofftools/ffmpeg: fix -t inaccurate recording time
Shiwang.Xie [Sat, 15 May 2021 08:53:56 +0000 (08:53 +0000)]
fftools/ffmpeg: fix -t inaccurate recording time

if input start time is not 0 -t is inaccurate doing stream copy,
will record extra duration according to input start time.
it should base on following cases:

input video start time from 60s, duration is 300s,
1. stream copy:
       ffmpeg -ss 40 -t 60 -i in.mp4 -c copy -y out.mp4
   open_input_file() will seek to 100 and set ts_offset to -100,
   process_input() will offset pkt->pts with ts_offset to make it 0,
   so when do_streamcopy() with -t, exits when ist->pts >= recording_time.

2. stream copy with -copyts:
       ffmpeg -ss 40 -t 60 -copyts -i in.mp4 -c copy -y out.mp4
   open_input_file() will seek to 100 and set ts_offset to 0,
   process_input() will keep raw pkt->pts as ts_offset is 0,
   so when do_streamcopy() with -t, exits when
   ist->pts >= (recording_time+f->start_time+f->ctx->start_time).

3. stream copy with -copyts -start_at_zero:
       ffmpeg -ss 40 -t 60 -copyts -start_at_zero -i in.mp4 -c copy -y out.mp4
   open_input_file() will seek to 120 and set ts_offset to -60 as start_to_zero option,
   process_input() will offset pkt->pts with input file start time,
   so when do_streamcopy() with -t, exits when ist->pts >= (recording_time+f->start_time).

0      60     40      60                     360
|_______|_____|_______|_______________________|
      start   -ss     -t

This fixes ticket #9141.

Signed-off-by: Shiwang.Xie <shiwang.xie666@outlook.com>
3 months agoavformat/subtitles: Deduplicate subtitles' read_(packet|seek|close)
Andreas Rheinhardt [Thu, 8 Jul 2021 21:05:08 +0000 (23:05 +0200)]
avformat/subtitles: Deduplicate subtitles' read_(packet|seek|close)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 months agoavformat/utils: remove AVStreamInternal.orig_codec_id
James Almer [Wed, 14 Jul 2021 19:07:49 +0000 (16:07 -0300)]
avformat/utils: remove AVStreamInternal.orig_codec_id

It's a write only field.

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
3 months agoavfilter/vf_v360: avoid doubles in fov_from_dfov()
Paul B Mahol [Sat, 17 Jul 2021 21:23:20 +0000 (23:23 +0200)]
avfilter/vf_v360: avoid doubles in fov_from_dfov()

3 months agoffmpeg: add option readrate
Gyan Doshi [Fri, 16 Jul 2021 12:29:39 +0000 (17:59 +0530)]
ffmpeg: add option readrate

Allows to read inputs at arbitrary rates.
-re is equivalent to -readrate 1

Tested with -copyts {+ start_at_zero}, -ss, streamcopied & decoded streams.

3 months agoavfilter/vf_chromanr: add also euclidean distance for calculations
Paul B Mahol [Sat, 17 Jul 2021 13:18:30 +0000 (15:18 +0200)]
avfilter/vf_chromanr: add also euclidean distance for calculations

3 months agoavfilter/vf_v360: fix visibility test for fisheye projection
Daniel Playfair Cal [Sat, 17 Jul 2021 09:28:56 +0000 (11:28 +0200)]
avfilter/vf_v360: fix visibility test for fisheye projection

Previously the visibility test referred to a circle in the input. This
changes it so that it refers accurately to the entire area in the input.

3 months agotools/target_dec_fuzzer: Fuzz FF_DEBUG_*
Michael Niedermayer [Fri, 7 Feb 2020 13:12:39 +0000 (14:12 +0100)]
tools/target_dec_fuzzer: Fuzz FF_DEBUG_*

This should increase coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agotools/target_dec_fuzzer: Fuzz AV_CODEC_FLAG2_EXPORT_MVS
Michael Niedermayer [Fri, 7 Feb 2020 13:12:17 +0000 (14:12 +0100)]
tools/target_dec_fuzzer: Fuzz AV_CODEC_FLAG2_EXPORT_MVS

This should increase coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agotools/target_dec_fuzzer: Set extradata for the parser
Michael Niedermayer [Fri, 7 Feb 2020 13:04:52 +0000 (14:04 +0100)]
tools/target_dec_fuzzer: Set extradata for the parser

This should improve coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agotools/target_dec_fuzzer: Fuzz skip_frame
Michael Niedermayer [Fri, 7 Feb 2020 12:15:55 +0000 (13:15 +0100)]
tools/target_dec_fuzzer: Fuzz skip_frame

Should allow coverage of related code

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavformat/mov: do not ignore errors in mov_metadata_hmmt()
Michael Niedermayer [Sun, 11 Jul 2021 12:27:22 +0000 (14:27 +0200)]
avformat/mov: do not ignore errors in mov_metadata_hmmt()

Fixes: Timeout
Fixes: 35637/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6311060272447488

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavformat/mxfdec: Check size for shrinking
Michael Niedermayer [Sun, 11 Jul 2021 10:39:34 +0000 (12:39 +0200)]
avformat/mxfdec: Check size for shrinking

av_shrink_packet() takes int size, so size must fit in int
Fixes: out of array access
Fixes: 35607/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-4875541323841536

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agoavcodec/exr: Check uncompressed_size against max_pixels
Michael Niedermayer [Sun, 27 Jun 2021 17:25:06 +0000 (19:25 +0200)]
avcodec/exr: Check uncompressed_size against max_pixels

Fixes: Timeout
Fixes: 35286/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-6557139802914816
Fixes: 31253/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-4901782326214656

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 months agofftools/cmdutils.c: Add cmd line option to override detection of cpu count.
Thilo Borgmann [Sun, 6 Jun 2021 13:15:50 +0000 (15:15 +0200)]
fftools/cmdutils.c: Add cmd line option to override detection of cpu count.

3 months agolavu/cpu.c: Add av_force_cpu_count() to override auto-detection.
Thilo Borgmann [Sun, 6 Jun 2021 13:15:00 +0000 (15:15 +0200)]
lavu/cpu.c: Add av_force_cpu_count() to override auto-detection.