summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* avcodec/cbs: constify decompose_unit_typesJames Almer2021-01-10
| | | | | | | CBS doesn't change its contents in any way whatsoever internally, and most users already set it to a const array. Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/vf_convolution: use correct stride variablePaul B Mahol2021-01-10
|
* doc/ffmpeg: document max_error_rateGyan Doshi2021-01-10
|
* avformat: remove some mpegts details from AVStreamMarton Balint2021-01-09
| | | | | | | | | | | | | | | | These fields were added to support -merge_pmt_versions, but the mpegts demuxer is also keeping track its programs internally, so that should be a better place to handle it. Also it is not a very good idea to keep fields like program_num or pmt_stream_idx in an AVStream, because a single stream can be part of multiple programs, multiple PMTs, so the stream attributes can refer to any program the stream is part of. Since they are not part of public API, lets simply remove them, or rather replace them with placeholders for ABI compatibility with libavdevice. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mpegts: use stream index based lookup with merge_pmt_versions if ↵Marton Balint2021-01-09
| | | | | | | | | | | | | | stream identifier matches multiple streams Also make sure we are checking the old state of the streams because otherwise some streams might already have the newly parsed stream identifiers which corrupts matching. Fixes streams having the same identifier mixed up on pmt version change. Fixes ticket #9006. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mpegts: only clear programs which no longer exist or have a new PMTMarton Balint2021-01-09
| | | | | | | | | | | Otherwise there can be a small period when the programs only contain the PMT pid. Also make sure skip_clear only affects AVProgram clear, and that pmt_pid is always kept as the first entry of the PID list of the programs. Also reject PMTs for programs on the wrong PID. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mpegts: rework clearing and adding pid to programMarton Balint2021-01-09
| | | | | | And use better function names. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mpegts: never discard PAT pidMarton Balint2021-01-09
| | | | | | | | PID 0 was removed from the pid list when then PMT was parsed, it is better to explictly avoid it from being discarded instead of keeing it in the list of every program. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/utils: do not overwrite already existing program with defaults in ↵Marton Balint2021-01-09
| | | | | | | | | av_new_program av_new_program returns the existing program if that already exists, in that case it makes no sense to overwrite existing attributes. Signed-off-by: Marton Balint <cus@passwd.hu>
* lavu/tx: clip when converting table values to fixed-pointLynne2021-01-09
| | | | | | | | | | | | | | | | | | INT32_MAX (2147483647) isn't exactly representable by a floating point value, with the closest being 2147483648.0. So when rescaling a value of 1.0, this could overflow when casting the 64-bit value returned from lrintf() into 32 bits. Unfortunately the properties of integer overflows don't match up well with how a Fourier Transform operates. So clip the value before casting to a 32-bit int. Should be noted we don't have overflows with the table values we're currently using. However, converting a Kaiser-Bessel window function with a length of 256 and a parameter of 5.0 to fixed point did create overflows. So this is more of insurance to save debugging time in case something changes in the future. The macro is only used during init, so it being a little slower is not a problem.
* sbc: do not set sample format in parserArnaud Vrac2021-01-09
| | | | | | | | | | | | Commit bdd31feec934 changed the SBC decoder to only set the output sample format on init, instead of setting it explicitly on each frame, which is correct. But the SBC parser overrides the sample format to S16, which triggers a crash when combining the parser and the decoder. Fix the issue by not setting the sample format anymore in the parser, which is wrong. Signed-off-by: James Almer <jamrial@gmail.com>
* avdevice/decklink_dec: mark get_frame_timecode and get_bmd_timecode staticChristopher Degawa2021-01-09
| | | | | | | | | | | The function is not used anywhere else and is causing mingw-w64 clang builds to fail with ffmpeg-git/libavdevice/decklink_dec.cpp:792:5: error: no previous prototype for function 'get_bmd_timecode' [-Werror,-Wmissing-prototypes] int get_bmd_timecode(AVFormatContext *avctx, AVTimecode *tc, AVRational frame_rate, BMDTimecodeFormat tc_format, IDeckLinkVideoInputFrame *videoFrame) Signed-off-by: Christopher Degawa <ccom@randomderp.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mov: adjust skip_samples according to seek timestampMatthieu Bouron2021-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently skip_samples is set to start_pad if sample_time is lesser or equal to 0. This can cause issues if the stream starts with packets that have negative pts. Calling avformat_seek_file() with ts set to 0 on such streams makes the mov demuxer return the right corresponding packets (near the 0 timestamp) but set skip_samples to start_pad which is incorrect as the audio decoder will discard the returned samples according to skip_samples from the first packet it receives (which has its timestamp near 0). For example, considering the following audio stream with start_pad=1344: [PKT pts=-1344] [PKT pts=-320] [PKT pts=704] [PKT pts=1728] [...] Calling avformat_seek_file() with ts=0 makes the next call to av_read_frame() return the packet with pts=-320 and a skip samples side data set to 1344 (start_pad). This makes the audio decoder incorrectly discard (1344 - 320) samples. This commit makes the move demuxer adjust skip_samples according to the stream start_pad, seek timestamp and first sample timestamp. The above example will now result in av_read_frame() still returning the packet with pts=-320 but with a skip samples side data set to 320 (src_pad - (seek_timestamp - first_timestamp)). This makes the audio decoder only discard 320 samples (from pts=-320 to pts=0). Signed-off-by: Marton Balint <cus@passwd.hu>
* doc/protocols: explain tcp listen option descriptionLingjiang Fang2021-01-09
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/nvenc: fix timestamp offset ticks logicTimo Rothenpieler2021-01-09
|
* avcodec/ac3dec: Make decoders init-threadsafeAndreas Rheinhardt2021-01-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/ac3dec: Check operations that can failAndreas Rheinhardt2021-01-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/ac3enc: Factor common end of float/fixed encode_frame outAndreas Rheinhardt2021-01-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/ac3enc_template: Perform compile-time checks at compile-timeAndreas Rheinhardt2021-01-09
| | | | | | | | | Runtime checks for whether the encoder is fixed-point or not are unnecessary here as this is a template; furthermore, there is no fixed-point EAC-3 encoder, so some checks for whether one is in EAC-3 mode can be omitted when doing fixed-point encoding. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/[e]ac3enc: Don't invade CONFIG_ namespaceAndreas Rheinhardt2021-01-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/ac3enc: Set function pointers earlierAndreas Rheinhardt2021-01-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/[e]ac3enc: Make encoders init-threadsafe, fix raceAndreas Rheinhardt2021-01-09
| | | | | | | | | | | ff_eac3_exponent_init() set values twice when initializing a static table; ergo the initialization code must not run concurrently with a running EAC-3 encoder. Yet this code is executed every time an EAC-3 encoder is initialized. So use ff_thread_once() for this and also for a similar initialization performed for all AC-3 encoders to make them all init-threadsafe. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/wmaprodec: Check packet sizeMichael Niedermayer2021-01-08
| | | | | | | | Fixes: left shift of negative value -25824 Fixes: 27754/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XMA2_fuzzer-5760255962906624 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/dhav: Check position for overflowMichael Niedermayer2021-01-08
| | | | | | | | Fixes: signed integer overflow: 9223372036854775807 + 32768 cannot be represented in type 'long' Fixes: 27744/clusterfuzz-testcase-minimized-ffmpeg_dem_DHAV_fuzzer-5179319491756032 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/rasc: Check frame before clearingMichael Niedermayer2021-01-08
| | | | | | | | Fixes: null pointer dereference Fixes: 27737/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-5769028685266944 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/utils: Change compute_chapters_end() from O(n²) to O(n log n)Michael Niedermayer2021-01-08
| | | | | | | | Fixes: Timeout (49sec -> 9sec) Fixes: 27427/clusterfuzz-testcase-minimized-ffmpeg_dem_FFMETADATA_fuzzer-5140589838073856 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/fft_template: Only check for FF_FFT_PERM_AVX on ARCH_X86Andreas Rheinhardt2021-01-08
| | | | | | | | Also do it for FFT_FLOAT only, as this is the only combination for which it can be set. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/vsrc_testsrc: Deduplicate optionsAndreas Rheinhardt2021-01-08
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_biquads: Don't redundantly set AVClassAndreas Rheinhardt2021-01-08
| | | | | | It is already set generically in ff_filter_alloc(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_biquads: Deduplicate optionsAndreas Rheinhardt2021-01-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/vf_blend: Deduplicate optionsAndreas Rheinhardt2021-01-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_asupercut: Deduplicate optionsAndreas Rheinhardt2021-01-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/vf_neighbor: Deduplicate optionsAndreas Rheinhardt2021-01-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/vf_convolution: Deduplicate filter optionsAndreas Rheinhardt2021-01-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/hashenc: Deduplicate (stream)hash optionsAndreas Rheinhardt2021-01-08
| | | | | | Also saves relocations. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/wavpack: Deduplicate exp and log tablesAndreas Rheinhardt2021-01-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/mxf: Deduplicate random_index_pack_keyAndreas Rheinhardt2021-01-08
| | | | | Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/vf_qp: Deduplicate variable names arraysAndreas Rheinhardt2021-01-08
| | | | | | This also avoids relocations. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/vp3data: Deduplicate coeff_tablesAndreas Rheinhardt2021-01-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/twinvq, metasound_data: Deduplicate lsp tablesAndreas Rheinhardt2021-01-08
| | | | | | Saves about 24KB. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/metasound: Deduplicate dataAndreas Rheinhardt2021-01-08
| | | | | | Saves about 13KB; also reduces the amount of relocations. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/g723_1: Move tables to their only userAndreas Rheinhardt2021-01-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/g723_1: Deduplicate arraysAndreas Rheinhardt2021-01-08
| | | | | | Saves about 17KB. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/libopusenc: Fix for header pre-skip valueArthur Taylor2021-01-07
| | | | | | | | | The Opus header initial padding preskip amount is always to be expressed relative to 48kHz. However, the encoder delay returned from querying libopus is relative to the encoding samplerate. Multiply by the samplerate conversion factor to correct. Signed-off-by: Arthur Taylor <art@ified.ca>
* avformat/vividas: Check number of audio channelsMichael Niedermayer2021-01-05
| | | | | | | | Fixes: division by 0 Fixes: 28597/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-5752201490333696 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/alsdec: Fix integer overflow with quant_cofMichael Niedermayer2021-01-05
| | | | | | | | Fixes: signed integer overflow: -210824 * 16384 cannot be represented in type 'int' Fixes: 28670/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5682310846480384 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* tools/target_dem_fuzzer.c: Decrease maxblocksMichael Niedermayer2021-01-05
| | | | | | | | | | | | Fixes: Timeout Fixes: 28606/clusterfuzz-testcase-minimized-ffmpeg_dem_FRM_fuzzer-5123311424110592 Fixes: 28796/clusterfuzz-testcase-minimized-ffmpeg_dem_R3D_fuzzer-5945803411685376 Fixes: 28821/clusterfuzz-testcase-minimized-ffmpeg_dem_BRSTM_fuzzer-6044239834251264 Fixes: 28841/clusterfuzz-testcase-minimized-ffmpeg_dem_SIFF_fuzzer-5485368388485120 Fixes: 28862/clusterfuzz-testcase-minimized-ffmpeg_dem_AST_fuzzer-5081306790756352 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/av1dec: add an option to select an operating pointJames Almer2021-01-04
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: add an option to select an operating pointJames Almer2021-01-04
| | | | | | | | | This implements the function drop_obu() as defined in Setion 6.2.1 from the spec. In a reading only scenario, units that belong to an operating point the caller doesn't want should not be parsed. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs: allow cbs_read_fragment_content() to skip decomposition of unitsJames Almer2021-01-04
| | | | | | | | | | The caller may not need all units in a fragment in reading only scenarios. They could in fact alter global state stored in the private CodedBitstreamType fields in an undesirable way. With this change, unit decomposition can be skipped based on parsed values within the unit. Signed-off-by: James Almer <jamrial@gmail.com>