Commit Graph

103038 Commits

Author SHA1 Message Date
Andreas Rheinhardt 1be3d8a0cb 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>
2021-07-22 11:14:31 +02:00
Andreas Rheinhardt 57b5ec6ba7 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>
2021-07-22 11:14:16 +02:00
Andreas Rheinhardt 73b847e136 avcodec/adpcm_data: Move tables only used by adpcm.c to it
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 08:31:23 +02:00
Andreas Rheinhardt ac5bd4e41a 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>
2021-07-22 08:31:23 +02:00
Andreas Rheinhardt 0a67ca63e4 avcodec/adpcm: Don't include disabled AVCodecs
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 08:31:23 +02:00
Andreas Rheinhardt 0f168344f1 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>
2021-07-22 08:30:18 +02:00
Andreas Rheinhardt 6914aa7fb4 avcodec/adpcm: Fix indentation
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 08:12:20 +02:00
Andreas Rheinhardt 421de73a10 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>
2021-07-22 08:06:10 +02:00
Andreas Rheinhardt c8a8691c97 avcodec/adpcmenc: Don't include disabled AVCodecs
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 08:00:39 +02:00
Andreas Rheinhardt 62e3d01cc7 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>
2021-07-22 07:50:05 +02:00
Andreas Rheinhardt 63f736f476 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>
2021-07-22 07:35:31 +02:00
Andreas Rheinhardt 10f8f06a56 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>
2021-07-22 07:32:09 +02:00
Shubhanshu Saxena 0bc7ddc460 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>
2021-07-22 08:13:14 +08:00
Shubhanshu Saxena 429954822c 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>
2021-07-22 08:13:14 +08:00
J. Dekker c866a099b2 lavu/kperf: use ff_thread_once()
Signed-off-by: J. Dekker <jdek@itanimul.li>
2021-07-21 16:35:27 +02:00
Gyan Doshi f614390ecc 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.
2021-07-21 13:08:13 +05:30
James Almer f9d5050d28 avutil/macos_kperf: add missing header guards
Fixes fate-source

Signed-off-by: James Almer <jamrial@gmail.com>
2021-07-20 19:01:02 -03:00
J. Dekker 9a727235fd lavu/checkasm: add (private) kperf timing for macOS
Signed-off-by: J. Dekker <jdek@itanimul.li>
2021-07-20 19:40:03 +02:00
Michael Niedermayer 4f49fa6abe 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>
2021-07-20 17:16:13 +02:00
Michael Niedermayer 1f21349d20 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>
2021-07-20 17:16:13 +02:00
Michael Niedermayer 06af6e101b avfilter/vf_mestimate: Check b_count
Fixes: left shift of negative value -1
Fixes: Ticket8270

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-20 17:16:13 +02:00
Jai Luthra 012804d2e9 avfilter/vf_signature: Initialize all houghspace elements
Co-authored-by: Oscar <oscar_davids@outlook.com>
2021-07-20 19:44:16 +05:30
Thilo Borgmann c1bf56a526 lavu/cpu: Use av_cpu_ prefix 2021-07-20 10:31:41 +02:00
Gyan Doshi cd7043131f avformat/gifdec: log loop count 2021-07-20 11:20:04 +05:30
Thilo Borgmann 05c9f6f4ef fftools/ffmpeg: Fix runlength for strncmp() 2021-07-19 21:23:02 +02:00
Steven Liu b67263e0e8 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>
2021-07-19 14:10:06 +02:00
Gyan Doshi 6f20685228 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.
2021-07-19 12:54:55 +05:30
Zane van Iperen 981d49e373
avformat/argo_brp: use bits_per_coded_sample instead of bits_per_raw_sample
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-07-19 14:14:39 +10:00
Zane van Iperen f687f8e0d3
avcodec/argo: use bits_per_coded_sample instead of bits_per_raw_sample
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-07-19 14:14:35 +10:00
Zane van Iperen 55801421b3
avformat/pp_bnk: don't set bits_per_raw_sample
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-07-19 10:47:25 +10:00
Zane van Iperen 5783bae9e5
avformat/kvag: don't set bits_per_raw_sample
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-07-19 10:47:25 +10:00
Zane van Iperen 5362fa2b75
avformat/apm: don't set bits_per_raw_sample
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-07-19 10:47:25 +10:00
Zane van Iperen 0c538ce30d
avformat/alp: don't set bits_per_raw_sample
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-07-19 10:47:24 +10:00
Zane van Iperen b28a3135af
avformat/argo_asf: don't set bits_per_raw_sample
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-07-19 10:47:24 +10:00
Zane van Iperen 9f502d8c8d
avformat/argo_cvg: don't set bits_per_raw_sample
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-07-19 10:47:18 +10:00
Andreas Rheinhardt 1c2d8ff92b avcodec/dsd_tablegen: Merge header into dsd.c
Since b492fbcc6e, 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>
2021-07-19 00:21:42 +02:00
Andreas Rheinhardt b76f9bcfd0 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>
2021-07-18 22:33:34 +02:00
Andreas Rheinhardt f9136d6026 Avoid calling functions repeatedly via FFMIN
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-18 22:06:20 +02:00
Andreas Rheinhardt e1836b191b 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>
2021-07-18 21:50:52 +02:00
Andreas Rheinhardt 3ccfd27f1d fftools/ffmpeg: Fix declaration-after-statement warning
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-18 21:09:02 +02:00
Aman Karmani 504c60660d 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>
2021-07-18 12:01:16 -07:00
Lynne 997f9bdb99
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.
2021-07-18 15:04:57 +02:00
Shiwang.Xie 694545b6d5 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>
2021-07-18 09:59:02 +05:30
Andreas Rheinhardt ea5bdc8893 avformat/subtitles: Deduplicate subtitles' read_(packet|seek|close)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-18 04:26:35 +02:00
James Almer ef1302db2d 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>
2021-07-17 19:41:45 -03:00
Paul B Mahol 305be41374 avfilter/vf_v360: avoid doubles in fov_from_dfov() 2021-07-17 23:27:51 +02:00
Gyan Doshi c320b78e95 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.
2021-07-17 20:34:21 +05:30
Paul B Mahol 075157ec86 avfilter/vf_chromanr: add also euclidean distance for calculations 2021-07-17 15:18:30 +02:00
Daniel Playfair Cal 7f6d20931b 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.
2021-07-17 11:28:56 +02:00
Michael Niedermayer 748c3fa52a tools/target_dec_fuzzer: Fuzz FF_DEBUG_*
This should increase coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-17 10:48:27 +02:00